本文整理汇总了C#中ADODB.Recordset.MoveNext方法的典型用法代码示例。如果您正苦于以下问题:C# ADODB.Recordset.MoveNext方法的具体用法?C# ADODB.Recordset.MoveNext怎么用?C# ADODB.Recordset.MoveNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ADODB.Recordset
的用法示例。
在下文中一共展示了ADODB.Recordset.MoveNext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getRoadName
public string getRoadName()
{
try
{
Position PoiX = new Position();
PoiX.X = Lat; PoiX.Y = Lon;
double tempLen = 1000000;
string tempTown = "";
ADODB.Recordset RST = new ADODB.Recordset();
/* string sqlSTR = "SELECT name,the_geom FROM " + this.roadsTableName +" WHERE the_geom && 'BOX3D(" +
(Lon - 0.1) + " " + (Lat - 0.1) + "," + (Lon + 0.1) + " " + (Lat + 0.1) +
") '::box3d AND distance( the_geom, GeometryFromText( 'POINT(" + Lon + " " + Lat +
")', -1 ) ) < 0.11";
string sqlSTROther = "SELECT name,the_geom FROM " + this.roadsTableName + " WHERE the_geom && 'BOX3D(" +
(Lon - 1) + " " + (Lat - 1) + "," + (Lon + 1) + " " + (Lat + 1) +
") '::box3d AND distance( the_geom, GeometryFromText( 'POINT(" + Lon + " " + Lat +
")', -1 ) ) < 1.1";*/
string sqlSTR = "SELECT rd_name,the_geom FROM kRoads WHERE the_geom && 'BOX3D(" +
(Lon - 0.1) + " " + (Lat - 0.1) + "," + (Lon + 0.1) + " " + (Lat + 0.1) +
") '::box3d AND distance( the_geom, GeometryFromText( 'POINT(" + Lon + " " + Lat +
")', -1 ) ) < 0.11";
string sqlSTROther = "SELECT rd_name,the_geom FROM kRoads WHERE the_geom && 'BOX3D(" +
(Lon - 1) + " " + (Lat - 1) + "," + (Lon + 1) + " " + (Lat + 1) +
") '::box3d AND distance( the_geom, GeometryFromText( 'POINT(" + Lon + " " + Lat +
")', -1 ) ) < 1.1";
RST.Open(sqlSTR, this.odbcDatabaseConnection, ADODB.CursorTypeEnum.adOpenDynamic,
ADODB.LockTypeEnum.adLockBatchOptimistic, 0);
if (RST.EOF == true)
{
try { RST.Close(); }
catch { }
RST.Open(sqlSTROther, this.odbcDatabaseConnection, ADODB.CursorTypeEnum.adOpenDynamic,
ADODB.LockTypeEnum.adLockBatchOptimistic, 0);
}
if (RST.EOF == false)
{
RST.MoveFirst();
while (RST.EOF == false)
{
/*we are no longer dealing with a single point we are
* dealind with a line string*/
string Coord = RST.Fields["the_geom"].Value.ToString();
int Len = Coord.Length;
Coord = Right(Coord, (Len - 25));
Len = Coord.Length;
Coord = Mid(Coord, 0, (Len - 2));
char[] SepChar = { ',' };
Array pointArray = Coord.Split(SepChar);
/*lets loop through the line string*/
for (int p = 0; p < pointArray.Length; p++)
{
try
{
char[] pointSep = { ' ' };
Array coordArray = pointArray.GetValue(p).ToString().Split(pointSep);
double xlon = Convert.ToDouble(coordArray.GetValue(0).ToString());
double xlat = Convert.ToDouble(coordArray.GetValue(1).ToString());
Position PoiY = new Position();
PoiY.X = xlat; PoiY.Y = xlon;
Calculations calc = new Calculations();
double xLen = 10000001;
try { xLen = calc.CalculateDistace(PoiX, PoiY); }
catch { }
calc = null;
//MessageBox.Show(xLen.ToString());
if (xLen < tempLen)
{
tempLen = xLen;
if (tempLen > 0.5)
{ tempTown = " Along Unknown Road"; }
else
{ tempTown = " Along " + RST.Fields["rd_name"].Value.ToString(); }
}
//PoiY = null;
coordArray = null;
//Application.DoEvents();
}
catch { }
}
//Application.DoEvents();
RST.MoveNext();
}
RST.Close();
RST = null;
}
if (tempLen != 1000000)
{
//.........这里部分代码省略.........
示例2: ImportWorkOrder
public void ImportWorkOrder()
{
string woPath = "http://nwszmail/public/namwah/WorkOrders/";
string strSQL = "";
ADODB.Connection cnn = new ADODB.Connection();
ADODB.Recordset rst = new ADODB.Recordset();
Item item;
WorkOrder wo;
string partNo;
string woNo;
session.BeginTransaction();
CacheItem();
CacheWo();
ConnectDB(cnn, woPath);
strSQL = "SELECT \"nw:partno\" , \"nw:partname\", \"nw:parttype\", \"nw:wo:no\", ";
strSQL = strSQL + " \"nw:wo:needqty\", \"nw:wo:needdate\", \"nw:wo:ssblankuseqty\", \"nw:wo:extra\" ";
strSQL = strSQL + " FROM \"" + woPath;
strSQL = strSQL + "\" WHERE (\"DAV:ishidden\" = false)";
rst.Open(strSQL, cnn, ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockBatchOptimistic, 1);
while (!rst.EOF)
{
partNo = rst.Fields["nw:partno"].Value.ToString();
woNo = rst.Fields["nw:wo:no"].Value.ToString();
if (dictItem.ContainsKey(partNo))
{
if (dictWo.ContainsKey(woNo))
{
WorkOrder oldWo = dictWo[woNo];
if (oldWo.NeedQty != float.Parse(rst.Fields["nw:wo:needqty"].Value.ToString()))
{
oldWo.NeedQty = float.Parse(rst.Fields["nw:wo:needqty"].Value.ToString());
oldWo.Save();
}
}
else
{
item = dictItem[partNo];
wo = new WorkOrder(session, woNo);
wo.Item = item;
wo.NeedDate = DateTime.Parse(rst.Fields["nw:wo:needdate"].Value.ToString());
wo.NeedQty = float.Parse(rst.Fields["nw:wo:needqty"].Value.ToString());
if (rst.Fields["nw:wo:extra"].Value.ToString() != "")
wo.ExtraQty = float.Parse(rst.Fields["nw:wo:extra"].Value.ToString());
if (rst.Fields["nw:wo:ssblankuseqty"].Value.ToString() != "")
wo.ssBlankUseQty = float.Parse(rst.Fields["nw:wo:ssblankuseqty"].Value.ToString());
wo.Save();
}
}
rst.MoveNext();
}
session.CommitTransaction();
}
示例3: ImportHKIPO
public void ImportHKIPO()
{
string ipoPath = "http://nwszmail/public/namwah/WorkOrders/Purchasing/InternalPurchaseOrders";
string strSQL = "";
ADODB.Connection cnn = new ADODB.Connection();
ADODB.Recordset rst = new ADODB.Recordset();
Item item;
PurchOrderLine poLine;
WorkOrder wo;
string partNo;
string woNo;
string ipoNo;
session.BeginTransaction();
CacheItem();
CacheWo();
CacheIpo();
ConnectDB(cnn, ipoPath);
strSQL = "SELECT \"nw:partno\" , \"nw:partname\", \"nw:parttype\", \"nw:wo:no\", \"nw:supplier\", ";
strSQL = strSQL + " \"nw:jo:needqty\", \"nw:jo:needdate\", \"nw:jo:arrivedqty\", \"nw:jo:no\" ";
strSQL = strSQL + " FROM \"" + ipoPath;
strSQL = strSQL + "\" WHERE (\"DAV:ishidden\" = false)";
rst.Open(strSQL, cnn, ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockBatchOptimistic, 1);
while (!rst.EOF)
{
partNo = rst.Fields["nw:partno"].Value.ToString();
woNo = rst.Fields["nw:wo:no"].Value.ToString();
ipoNo = rst.Fields["nw:jo:no"].Value.ToString();
if (dictPoLine.ContainsKey(ipoNo))
{
PurchOrderLine oldPoLine = dictPoLine[ipoNo];
if (oldPoLine.NeedQty != float.Parse(rst.Fields["nw:jo:needqty"].Value.ToString()) ||
oldPoLine.ReceivedQty != float.Parse(rst.Fields["nw:jo:arrivedqty"].Value.ToString()))
{
oldPoLine.NeedQty = float.Parse(rst.Fields["nw:jo:needqty"].Value.ToString());
oldPoLine.SetReceivedQty(float.Parse(rst.Fields["nw:jo:arrivedqty"].Value.ToString()));
oldPoLine.Save();
}
}
else
{
if (dictItem.ContainsKey(partNo) && dictWo.ContainsKey(woNo))
{
item = dictItem[partNo];
wo = dictWo[woNo];
poLine = new PurchOrderLine(session);
poLine.WorkOrder = wo;
poLine.Item = item;
poLine.SetPurchOrderLineNo(ipoNo);
poLine.NeedDate = DateTime.Parse(rst.Fields["nw:jo:needdate"].Value.ToString());
poLine.NeedQty = float.Parse(rst.Fields["nw:jo:needqty"].Value.ToString());
poLine.Vendor = GetVendor(rst.Fields["nw:supplier"].Value.ToString());
poLine.SetReceivedQty(float.Parse(rst.Fields["nw:jo:arrivedqty"].Value.ToString()));
poLine.Unit = item.Unit;
poLine.Warehouse = item.Warehouse;
poLine.Save();
}
}
rst.MoveNext();
}
session.CommitTransaction();
}
示例4: showLabels
private void showLabels()
{
rs = modRecordSet.getRS(ref "SELECT Person.PersonID, [Person_FirstName] & ' ' & [Person_LastName] AS PersonName, Person.Person_QuickAccess, Label.* From Person, Label Where Person.Person_Disabled = False And Label.Label_Type = 3 ANd PersonID <> 1 ORDER BY [Person_FirstName] & ' ' & [Person_LastName];");
this.lstPerson.Items.Clear();
string tmpString = null;
while (!(rs.EOF)) {
tmpString = rs.Fields("PersonName").Value + " " + rs.Fields("PersonID").Value;
lstPerson.Items.Add(tmpString);
tmpString = "";
rs.MoveNext();
}
}
示例5: loadFilter
public bool loadFilter(ref string filter_Renamed)
{
bool functionReturnValue = false;
ADODB.Recordset rs = new ADODB.Recordset();
ADODB.Recordset RSitem = new ADODB.Recordset();
short lCNT = 0;
rs = modRecordSet.getRS(ref "SELECT * From ftOrderSet Where (((ftSet_Group) = 'order')) ORDER BY ftSet_Order;");
if (rs.BOF | rs.EOF) {
functionReturnValue = false;
} else {
lCNT = -1;
objectArray = new object[rs.RecordCount];
while (!(rs.EOF)) {
lCNT = lCNT + 1;
switch (rs.Fields("ftset_type").Value) {
case 2:
if (lCNT) {
//_frmList_0.
//frmList.Load(lCNT)
//cmdList.Load(lCNT)
cmdList[lCNT].Parent = _frmList_0;
//lblList.Load(lCNT)
_lblList_0.Parent = _frmList_0;
}
_frmList_0.Visible = true;
_cmdList_0.Visible = true;
_lblList_0.Visible = true;
if (lCNT)
_frmList_0.Top = sizeConvertors.twipsToPixels(lCNT * sizeConvertors.pixelToTwips(_frmList_0.Height, false) + sizeConvertors.pixelToTwips(_frmList_0.Top, false), false);
_frmList_0.Text = rs.Fields("ftset_DisplayName").Value;
_frmList_0.Tag = rs.Fields("ftset_Name").Value;
_lblList_0.Text = "";
RSitem = modRecordSet.getRS(ref "SELECT ftData_Heading From ftOrder WHERE (ftData_PersonID = " + modRecordSet.gPersonID + ") AND (ftData_FieldName = '" + Strings.Replace(_frmList_0.Tag, "'", "''") + "')");
if (RSitem.BOF | RSitem.EOF) {
} else {
_lblList_0.Text = RSitem.Fields("ftData_Heading").Value;
}
objectArray[lCNT] = _frmList_0;
break;
}
rs.MoveNext();
}
this.Height = sizeConvertors.twipsToPixels(objectArray[Information.UBound(objectArray)].Top + objectArray[Information.UBound(objectArray)].Height + 1000, false);
loadLanguage();
ShowDialog();
functionReturnValue = true;
}
return functionReturnValue;
}
示例6: cmdInv_Click
//.........这里部分代码省略.........
break;
case 1:
sql = "SELECT Deposit.Deposit_Name AS longName, Deposit.Deposit_ReceiptName AS receiptName, Deposit.Deposit_Key AS code From Deposit WHERE (((DepositID)=" + rs.Fields("SaleItem_StockItemID").Value + "));";
rsItems = modRecordSet.getRS(ref sql);
if (rsItems.RecordCount) {
lLineitem.name = rs.Fields("longName").Value + "-Unit";
lLineitem.receiptName = rs.Fields("receiptName").Value + "(U)";
lLineitem.code = rsItems.Fields("Code").Value + "";
}
rsItems.Close();
break;
case 2:
sql = "SELECT Deposit.Deposit_Name AS longName, Deposit.Deposit_ReceiptName AS receiptName, Deposit.Deposit_Key AS code From Deposit WHERE (((DepositID)=" + rs.Fields("SaleItem_StockItemID").Value + "));";
rsItems = modRecordSet.getRS(ref sql);
if (rsItems.RecordCount) {
lLineitem.name = rs.Fields("longName").Value + "-Empty Crate";
lLineitem.receiptName = rs.Fields("receiptName").Value + "(E)";
lLineitem.code = rsItems.Fields("Code").Value + "";
}
rsItems.Close();
break;
case 3:
sql = "SELECT Deposit.Deposit_Name AS longName, Deposit.Deposit_ReceiptName AS receiptName, Deposit.Deposit_Key AS code From Deposit WHERE (((DepositID)=" + rs.Fields("SaleItem_StockItemID").Value + "));";
rsItems = modRecordSet.getRS(ref sql);
if (rsItems.RecordCount) {
lLineitem.name = rs.Fields("longName").Value + "-Full Case";
lLineitem.receiptName = rs.Fields("receiptName").Value + "(F)";
lLineitem.code = rsItems.Fields("Code").Value + "";
}
rsItems.Close();
break;
}
lTransaction.lineItems.Add(ref lLineitem);
rs.MoveNext();
}
rs.Close();
sql = "SELECT Customer.*, CustomerTransaction.* FROM (CustomerTransaction INNER JOIN Sale ON CustomerTransaction.CustomerTransaction_ReferenceID = Sale.SaleID) INNER JOIN Customer ON CustomerTransaction.CustomerTransaction_CustomerID = Customer.CustomerID WHERE (((Sale.SaleID)=" + lID + "));";
rs.Open(sql, cn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, ADODB.CommandTypeEnum.adCmdText);
if (rs.RecordCount) {
lCustomer.channelID = lTransaction.channelID;
lCustomer.creditLimit = rs.Fields("Customer_ChannelID").Value;
lCustomer.department = rs.Fields("Customer_DepartmentName").Value + "";
lCustomer.fax = rs.Fields("Customer_Fax").Value + "";
lCustomer.Key = rs.Fields("CustomerID").Value;
lCustomer.name = rs.Fields("Customer_InvoiceName").Value + "";
lCustomer.outstanding = 0;
lCustomer.person = rs.Fields("Customer_FirstName").Value + " " + rs.Fields("Customer_Surname").Value;
lCustomer.physical = rs.Fields("Customer_PhysicalAddress").Value + "";
lCustomer.postal = rs.Fields("Customer_PostalAddress").Value + "";
lCustomer.signed_Renamed = rs.Fields("CustomerTransaction_PersonName").Value;
lCustomer.telephone = rs.Fields("Customer_Telephone").Value + "";
lCustomer.terms = Convert.ToInt16(rs.Fields("Customer_Terms").Value + "");
lCustomer.tax = rs.Fields("Customer_VatNumber").Value + "";
if (rs.Fields("CustomerTransaction_TransactionTypeID").Value == 3) {
lTransaction.transactionType = "Payment";
lTransaction.paymentDiscount = 0;
}
lTransaction.customer_Renamed = lCustomer;
}
rs.Close();
sql = "SELECT Consignment.* FROM Consignment INNER JOIN Sale ON Consignment.Consignment_SaleID = Sale.SaleID WHERE (((Sale.SaleID)=" + lID + "));";
rs.Open(sql, cn, ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockReadOnly, ADODB.CommandTypeEnum.adCmdText);
if (rs.BOF & rs.EOF) {
} else {
lSpecial.address = rs.Fields("Consignment_Address").Value;
示例7: DataList1_DblClick
private void DataList1_DblClick(System.Object eventSender, KeyPressEventArgs eventArgs)
{
ADODB.Recordset rs = default(ADODB.Recordset);
ADODB.Recordset rst = default(ADODB.Recordset);
ADODB.Recordset rsInner = default(ADODB.Recordset);
ADODB.Recordset rsShelf = default(ADODB.Recordset);
ADODB.Recordset rsBClabel = default(ADODB.Recordset);
short HoldBClabelItem_BCLabelID = 0;
string TheSample = null;
short IntLabelID = 0;
short IncrBClabelID = 0;
rs = new ADODB.Recordset();
rst = new ADODB.Recordset();
rsInner = new ADODB.Recordset();
rsShelf = new ADODB.Recordset();
rsBClabel = new ADODB.Recordset();
short TheeMaxID = 0;
modRecordSet.cnnDB.Execute("DELETE * FROM BClabel;");
modRecordSet.cnnDB.Execute("DELETE * FROM BClabelItem;");
modApplication.IntDesign = 1;
//New code
HoldBClabelItem_BCLabelID = 1;
rs = modRecordSet.getRS(ref "SELECT BClabel.*, BClabelItem.* FROM BClabel INNER JOIN BClabelItem ON BClabel.BClabelID = BClabelItem.BClabelItem_BCLabelID");
if (rs.RecordCount > 0) {
if (string.IsNullOrEmpty(Strings.Trim(DataList1.CurrentCell.Value.ToString()))) {
if (modApplication.TheType == 2) {
Interaction.MsgBox("Please select Stock Barcode Design and click Next", MsgBoxStyle.Information, "4Pos Back Office");
return;
} else {
Interaction.MsgBox("Please select Shelf Talker Design and click Next", MsgBoxStyle.Information, "4Pos Back Office");
return;
}
} else {
}
modApplication.MyLIDWHole = Convert.ToInt16(DataList1.CurrentCell.Value);
rs = modRecordSet.getRS(ref "SELECT BClabel.*, BClabelItem.* FROM BClabel INNER JOIN BClabelItem ON BClabel.BClabel_LabelID = BClabelItem.BClabelItem_LabelID WHERE BClabelItem.BClabelItem_LabelID=" + modApplication.MyLIDWHole + "");
if (rs.RecordCount == 0) {
IncrBClabelID = 1;
rsInner = modRecordSet.getRS(ref "SELECT Label.*, LabelItem.* FROM Label INNER JOIN LabelItem ON Label.LabelID = LabelItem.labelItem_LabelID WHERE Label.Label_Type=2;");
rsBClabel = modRecordSet.getRS(ref "INSERT INTO BClabel(BClabel_Name,BClabel_Type,BClabel_Disabled,BClabel_Height,BClabel_LabelID)VALUES('Stock','Stock','" + 0 + "',15," + rsInner.Fields("LabelID").Value + ")");
//Set rsBClabel = getRS("INSERT INTO BClabel(BClabelID,BClabel_Name,BClabel_Type,BClabel_Disabled,BClabel_Height,BClabel_LabelID)VALUES(1,'Stock','Stock','" & 0 & "',15," & rsInner("LabelID") & ")")
while (!(rsInner.EOF)) {
//****
//Inserting information into BCLabel
//***
if (string.IsNullOrEmpty(Strings.Trim(rsInner.Fields("labelItem_Sample").Value))) {
TheSample = " ";
//UPGRADE_WARNING: Use of Null/IsNull() detected. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="2EED02CB-5C0E-4DC1-AE94-4FAA3A30F51A"'
} else if (Information.IsDBNull(rsInner.Fields("labelItem_Sample").Value)) {
TheSample = " ";
} else {
TheSample = rsInner.Fields("labelItem_Sample").Value;
}
rst = modRecordSet.getRS(ref "INSERT INTO BClabelItem(BClabelItem_BCLabelID,BClabelItem_Line,BClabelItem_Field,BClabelItem_Align,BClabelItem_Size,BClabelItem_Bold,BClabelItem_Sample,BClabelItem_Disabled,BClabelItem_LabelID)VALUES(" + HoldBClabelItem_BCLabelID + "," + rsInner.Fields("labelItem_Line").Value + ",'" + rsInner.Fields("labelItem_Field").Value + "'," + rsInner.Fields("labelItem_Align").Value + "," + rsInner.Fields("labelItem_Size").Value + "," + rsInner.Fields("labelItem_Bold").Value + ",'" + TheSample + "','" + 0 + "'," + rsInner.Fields("labelItem_LabelID").Value + ")");
IntLabelID = rsInner.Fields("labelItem_LabelID").Value;
rsInner.MoveNext();
//****
//If the ID is still for the same design then dont increment HoldBClabelItem_BCLabelID
//****
// ERROR: Not supported in C#: OnErrorStatement
if (IntLabelID != rsInner.Fields("labelItem_LabelID").Value) {
HoldBClabelItem_BCLabelID = HoldBClabelItem_BCLabelID + 1;
IncrBClabelID = IncrBClabelID + 1;
if (rsInner.Fields("Label_Top").Value == 3) {
rsBClabel = modRecordSet.getRS(ref "INSERT INTO BClabel(BClabelID,BClabel_Name,BClabel_Type,BClabel_Disabled,BClabel_Height,BClabel_LabelID)VALUES(" + IncrBClabelID + ",'Stock','Stock','" + 0 + "',15," + rsInner.Fields("LabelID").Value + ")");
} else {
rsBClabel = modRecordSet.getRS(ref "INSERT INTO BClabel(BClabelID,BClabel_Name,BClabel_Type,BClabel_Disabled,BClabel_Height,BClabel_LabelID)VALUES(" + IncrBClabelID + ",'Stock','Stock','" + 0 + "',30," + rsInner.Fields("LabelID").Value + ")");
}
} else {
}
}
rst = modRecordSet.getRS(ref "SELECT Max(BClabelID) As MaxLaID FROM BClabel");
//Dim TheeMaxID As Integer
TheeMaxID = rst.Fields("MaxLaID").Value;
rsInner = modRecordSet.getRS(ref "SELECT Label.*, LabelItem.* FROM Label INNER JOIN LabelItem ON Label.LabelID = LabelItem.labelItem_LabelID WHERE Label.Label_Type=1;");
//****
//Inserting For shelf talker
//****
TheeMaxID = TheeMaxID + 1;
rsBClabel = modRecordSet.getRS(ref "INSERT INTO BClabel(BClabelID,BClabel_Name,BClabel_Type,BClabel_Disabled,BClabel_Height,BClabel_LabelID)VALUES(" + IncrBClabelID + ",'Stock','Stock','" + 0 + "',15," + rsInner.Fields("LabelID").Value + ")");
while (!(rsInner.EOF)) {
//.........这里部分代码省略.........
示例8: Command2_Click
private void Command2_Click(System.Object eventSender, System.EventArgs eventArgs)
{
string lString = null;
string sql = null;
ADODB.Recordset rsWebDBs = default(ADODB.Recordset);
Module1.bBranchChange = false;
string ret = null;
string dtDate = null;
string dtMonth = null;
string stPass = null;
if (Module1.BranchType == "1") {
//UPGRADE_WARNING: Add a delegate for AddressOf TimerProc Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="E9E157F7-EF0C-4016-87B7-7D7FBBC6EE08"'
//SetTimer(Handle.ToInt32, NV_INPUTBOX, 10, TimerProc)
ret = Interaction.InputBox("Enter Password");
//Construct password...........
if (Strings.Len(DateAndTime.Day(DateAndTime.Today)) == 1)
dtDate = "0" + Conversion.Str(DateAndTime.Day(DateAndTime.Today));
else
dtDate = Strings.Trim(Conversion.Str(DateAndTime.Day(DateAndTime.Today)));
dtDate = Strings.Replace(dtDate, " ", "");
if (Strings.Len(DateAndTime.Month(DateAndTime.Today)) == 1)
dtMonth = "0" + Conversion.Str(DateAndTime.Month(DateAndTime.Today));
else
dtMonth = Strings.Trim(Conversion.Str(DateAndTime.Month(DateAndTime.Today)));
dtMonth = Strings.Replace(dtMonth, " ", "");
//Create password
stPass = dtDate + "##" + dtMonth;
stPass = Strings.Replace(stPass, " ", "");
if (Strings.Trim(ret) == stPass) {
Module1.bBranchChange = true;
} else {
Interaction.MsgBox("Incorrect password was entered!!!", MsgBoxStyle.Exclamation, "Incorrect Passwords");
return;
}
}
cmdClear_Click();
cmdPulsante_Click(cmdPulsante[0], new System.EventArgs());
cmdPulsante_Click(cmdPulsante[7], new System.EventArgs());
cmdPulsante_Click(cmdPulsante[1], new System.EventArgs());
if (Module1.BranchType == "0") {
cmdPulsante_Click(cmdPulsante[0], new System.EventArgs());
rsWebDBs = new ADODB.Recordset();
sql = "SELECT * FROM GRVSale WHERE (GRVSale_HeadOfficeID = " + Convert.ToInt16(Module1.HOfficeID) + ") AND (GRVSale_BranchID = " + Convert.ToInt16(Module1.BranchID) + ") AND (GRVSale_Done = 'False');";
var _with1 = rsWebDBs;
_with1.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
_with1.CursorType = ADODB.CursorTypeEnum.adOpenForwardOnly;
_with1.LockType = ADODB.LockTypeEnum.adLockBatchOptimistic;
_with1.Source = sql;
_with1.ActiveConnection = Module1.sqlDBcn;
_with1.Open();
_with1.ActiveConnection = null;
if (rsWebDBs.RecordCount) {
tryCheckZip:
if (fso.FileExists(modRecordSet.serverPath + "data.zip")) {
Interaction.MsgBox("There are 'Sale to GRV' outstanding to be processed. Please click 'OK' once 4POS Domain Controller finished with Pricing update.");
goto tryCheckZip;
}
lString = Strings.Replace(Convert.ToString(DateAndTime.Now), " ", "_");
lString = Strings.Replace(lString, "/", "-");
lString = Strings.Replace(lString, ":", "");
if (fso.FolderExists(gPathHO + "download\\" + lString)) {
} else {
fso.CreateFolder(gPathHO + "download\\" + lString);
}
while (!(rsWebDBs.EOF)) {
cmdPulsante_Click(cmdPulsante[1], new System.EventArgs());
cmdPulsante_Click(cmdPulsante[0], new System.EventArgs());
DownLoadFile_GRV(ref false, ref Convert.ToString(Strings.Split(rsWebDBs("GRVSale_Path"), "/grv/")[1]), ref gPathHO + "download\\" + lString, ref true);
Module1.sGRVSales = gPathHO + "download\\" + lString + "\\" + Convert.ToString(Strings.Split(rsWebDBs("GRVSale_Path"), "/grv/")[1]);
//frmGRVimport.Tag = lString
My.MyProject.Forms.frmGRVimport.ShowDialog();
if (Module1.sGRVSales == "DONE") {
sql = "UPDATE GRVSale SET GRVSale_Done = 'True' WHERE (GRVSaleID = " + rsWebDBs("GRVSaleID").Value + ");";
Module1.sqlDBcn.Execute(sql);
}
Module1.sGRVSales = "";
rsWebDBs.MoveNext();
}
}
cmdPulsante_Click(cmdPulsante[1], new System.EventArgs());
}
Module1.sGRVSales = "";
Interaction.MsgBox("Process Finished.");
}
示例9: loadFilter
public bool loadFilter(ref string filter_Renamed)
{
bool functionReturnValue = false;
object modGeneral = null;
object lDOM = null;
object lNode = null;
ADODB.Recordset rs = new ADODB.Recordset();
ADODB.Recordset RSitem = new ADODB.Recordset();
short lCNT = 0;
rs = modRecordSet.getRS(ref "SELECT ftSet.* From ftSet Where (((ftSet.ftSet_Group) = '" + Strings.Replace(filter_Renamed, "'", "''") + "')) ORDER BY ftSet.ftSet_Order;");
if (rs.BOF | rs.EOF) {
functionReturnValue = false;
} else {
lCNT = -1;
objectArray = new object[rs.RecordCount];
while (!(rs.EOF)) {
lCNT = lCNT + 1;
switch (rs.Fields("ftset_type").Value) {
case 2:
if (lCNT) {
this.Controls.Add(_frmList_0);
//_frmList_0.Controls.Add(lCNT)
//_cmdList_0.Load(lCNT)
cmdList[lCNT].Parent = frmList[lCNT];
//lblList.Load(lCNT)
lblList[lCNT].Parent = frmList[lCNT];
}
frmList[lCNT].Visible = true;
cmdList[lCNT].Visible = true;
lblList[lCNT].Visible = true;
frmList[lCNT].Top = sizeConvertors.twipsToPixels(sizeConvertors.pixelToTwips(frmList[0].Top, false) + lCNT * sizeConvertors.pixelToTwips(frmList[0].Height, false), false);
frmList[lCNT].Text = rs.Fields("ftset_DisplayName").Value;
frmList[lCNT].Tag = rs.Fields("ftset_Name").Value;
lblList[lCNT].Text = "";
RSitem = modRecordSet.getRS(ref "SELECT ftData_Heading From ftData WHERE (ftData_PersonID = " + modRecordSet.gPersonID + ") AND (ftData_FieldName = '" + Strings.Replace(frmList[lCNT].Tag, "'", "''") + "')");
if (RSitem.BOF | RSitem.EOF) {
} else {
lblList[lCNT].Text = RSitem.Fields("ftData_Heading").Value;
}
objectArray[lCNT] = frmList[lCNT];
break;
case 1:
if (lCNT) {
//frmString.Load(lCNT)
//txtString.Load(lCNT)
_txtString_0.Parent = frmString[lCNT];
}
_frmString_0.Visible = true;
_txtString_0.Visible = true;
_frmString_0.Top = sizeConvertors.twipsToPixels(sizeConvertors.pixelToTwips(frmList[0].Top, false) + lCNT * sizeConvertors.pixelToTwips(frmList[0].Height, false), false);
_frmString_0.Text = lNode.selectSingleNode("@name").Text;
_frmString_0.Tag = lNode.selectSingleNode("@id").Text;
_txtString_0.Text = "";
lDOM = modGeneral.lsData.sql("SELECT ftData_Data From ftData WHERE (ftData_PersonID = " + modRecordSet.gPersonID + ") AND (ftData_FieldName = '" + Strings.Replace(frmString[lCNT].Tag, "'", "''") + "')");
if (lDOM == null) {
} else {
if (lDOM.documentElement.selectSingleNode("/root/ftData/@ftData_Data") == null) {
} else {
_txtString_0.Text = lDOM.documentElement.selectSingleNode("/root/ftData/@ftData_Data").Text;
}
}
_txtString_0.Tag = _txtString_0.Text;
objectArray[lCNT] = _frmString_0;
break;
}
rs.MoveNext();
}
this.Height = sizeConvertors.twipsToPixels(objectArray[Information.UBound(objectArray)].Top + objectArray[Information.UBound(objectArray)].Height + 1000, false);
loadLanguage();
ShowDialog();
//UPGRADE_WARNING: Couldn't resolve default property of object loadFilter. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
functionReturnValue = true;
}
return functionReturnValue;
}
示例10: cmdExit_Click
private void cmdExit_Click(System.Object eventSender, System.EventArgs eventArgs)
{
//On Error GoTo ErrH
ADODB.Recordset rs = default(ADODB.Recordset);
ADODB.Recordset rst = default(ADODB.Recordset);
ADODB.Recordset rsHave = default(ADODB.Recordset);
ADODB.Recordset rsMaxID = default(ADODB.Recordset);
short HoldBClabelItem_BCLabelID = 0;
string TheSample = null;
ADODB.Recordset rsInner = default(ADODB.Recordset);
short HoldLaIDVaBack = 0;
short TMaxID = 0;
rs = new ADODB.Recordset();
rst = new ADODB.Recordset();
rsHave = new ADODB.Recordset();
rsInner = new ADODB.Recordset();
rsMaxID = new ADODB.Recordset();
modApplication.IntDesign = 0;
//New code
rs = modRecordSet.getRS(ref "DELETE * FROM BClabelItemUndo");
strheight = 0;
strwidht = 0;
rs = modRecordSet.getRS(ref "SELECT * FROM LabelItem WHERE labelItem_LabelID=" + modApplication.MyLIDWHole + "");
if (rs.RecordCount == 1) {
rs = modRecordSet.getRS(ref "DELETE * FROM LabelItem WHERE labelItem_LabelID=" + modApplication.MyLIDWHole + "");
rs = modRecordSet.getRS(ref "DELETE * FROM Label WHERE LabelID=" + modApplication.MyLIDWHole + "");
rs = modRecordSet.getRS(ref "DELETE * FROM BClabel WHERE BClabel_LabelID=" + modApplication.MyLIDWHole + "");
rs = modRecordSet.getRS(ref "DELETE * FROM BClabelItem WHERE BClabelItem_LabelID=" + modApplication.MyLIDWHole + "");
this.Close();
My.MyProject.Forms.frmDesign.RefreshLoad(ref modApplication.TheType);
return;
} else {
}
rs = modRecordSet.getRS(ref "SELECT Max(LabelItem.labelItem_LabelID) as TheMaxID FROM LabelItem");
TMaxID = rs.Fields("TheMaxID").Value;
rs = modRecordSet.getRS(ref "SELECT * FROM LabelItem ORDER BY labelItem_LabelID");
rs.MoveFirst();
//Loading BClabelItem with Infor from LabelItem
while (!(rs.EOF)) {
// ERROR: Not supported in C#: OnErrorStatement
rsHave = modRecordSet.getRS(ref "SELECT * FROM BClabelItem WHERE BClabelItem_LabelID=" + rs.Fields("labelItem_LabelID").Value + "");
HoldBClabelItem_BCLabelID = rsHave.Fields("BClabelItem_BCLabelID").Value;
rst = modRecordSet.getRS(ref "DELETE * FROM BClabelItem WHERE BClabelItem_LabelID =" + rs.Fields("labelItem_LabelID").Value + "");
rsInner = modRecordSet.getRS(ref "SELECT * FROM LabelItem WHERE labelItem_LabelID=" + rs.Fields("labelItem_LabelID").Value + "");
while (!(rsInner.EOF)) {
if (Information.IsDBNull(rsInner.Fields("labelItem_Sample").Value)) {
TheSample = " ";
} else {
TheSample = rsInner.Fields("labelItem_Sample").Value;
}
rst = modRecordSet.getRS(ref "INSERT INTO BClabelItem(BClabelItem_BCLabelID,BClabelItem_Line,BClabelItem_Field,BClabelItem_Align,BClabelItem_Size,BClabelItem_Bold,BClabelItem_Sample,BClabelItem_Disabled,BClabelItem_LabelID)VALUES(" + HoldBClabelItem_BCLabelID + "," + rsInner.Fields("labelItem_Line").Value + ",'" + rsInner.Fields("labelItem_Field").Value + "'," + rsInner.Fields("labelItem_Align").Value + "," + rsInner.Fields("labelItem_Size").Value + "," + rsInner.Fields("labelItem_Bold").Value + ",'" + TheSample + "','" + 0 + "'," + rsInner.Fields("labelItem_LabelID").Value + ")");
rsInner.MoveNext();
}
HoldLaIDVaBack = rs.Fields("labelItem_LabelID").Value;
rs.MoveNext();
while (!(rs.Fields("labelItem_LabelID").Value != HoldLaIDVaBack)) {
if (rs.Fields("labelItem_LabelID").Value == TMaxID) {
rs.MoveLast();
rs.MoveNext();
break; // TODO: might not be correct. Was : Exit Do
}
rs.MoveNext();
}
}
this.Close();
My.MyProject.Forms.frmDesign.RefreshLoad(ref modApplication.TheType);
//ErrH: frmDesign.RefreshLoad TheType
//frmdesign.RefreshLoad TheType
}
示例11: labelsfile
private void labelsfile()
{
System.Windows.Forms.CheckBox chk6 = new System.Windows.Forms.CheckBox();
System.Windows.Forms.CheckBox chk5 = new System.Windows.Forms.CheckBox();
System.Windows.Forms.CheckBox chk4 = new System.Windows.Forms.CheckBox();
System.Windows.Forms.CheckBox chk3 = new System.Windows.Forms.CheckBox();
System.Windows.Forms.CheckBox chk2 = new System.Windows.Forms.CheckBox();
System.Windows.Forms.CheckBox chk1 = new System.Windows.Forms.CheckBox();
int lValue = 0;
Scripting.FileSystemObject fso = new Scripting.FileSystemObject();
string strname = null;
ADODB.Recordset rsNew = default(ADODB.Recordset);
rsNew = new ADODB.Recordset();
// ERROR: Not supported in C#: OnErrorStatement
//openConnection
gPersonID = 1;
//If loadBarcodePrinter() Then
Debug.Print(gLBLwidth);
lValue = gLBLwidth;
rsNew = modRecordSet.getRS(ref "SELECT * FROM Label WHERE LabelID=" + modApplication.MyLIDWHole + " ORDER BY Label_Type,LabelID");
modApplication.SelectLabelName = rsNew.Fields("Label_Name").Value;
this.lbldesign.Text = modApplication.SelectLabelName;
twipsToMM = 57;
int StHi = 0;
int StWi = 0;
while (!(rsNew.EOF)) {
if (modApplication.TheSelectedPrinterNew != 2) {
strwidht = rsNew.Fields("Label_Width").Value;
strheight = rsNew.Fields("Label_Height").Value;
} else {
strwidht = this.HSWidth.Value;
strheight = this.HSHeight.Value;
}
_chkFields_0.CheckState = chk1.Checked;
_chkFields_1.CheckState = chk2.Checked;
_chkFields_2.CheckState = chk3.Checked;
_chkFields_3.CheckState = chk4.Checked;
_chkFields_4.CheckState = chk5.Checked;
_chkFields_5.CheckState = chk6.Checked;
modApplication.LaIDHold = rsNew.Fields("LabelID").Value;
HSHeight.Value = strheight;
if (modApplication.TheSelectedPrinterNew == 2) {
HSHeight_Change(0);
}
HSWidth.Value = strwidht;
if (modApplication.TheSelectedPrinterNew == 2) {
HSHeight_Change(0);
}
rsNew.MoveNext();
}
modApplication.TheSelectedPrinterNew = 0;
modApplication.IntDesign = 0;
Debug.Print(gLBLwidth);
return;
errLoad:
// ERROR: Not supported in C#: ResumeStatement
updatte();
}
示例12: cmdAdd_Click
//.........这里部分代码省略.........
}
//if field is equal to code the sample is space
if (rsNoRec.Fields("BClabelItem_Field").Value == "code") {
TheNames1 = " ";
//if the field is equal to line the sample is space
} else if (rsNoRec.Fields("BClabelItem_Field").Value == "line") {
TheNames1 = " ";
} else if (rsNoRec.Fields("BClabelItem_Field").Value == "blank") {
TheNames1 = " ";
} else {
if (modApplication.TheNames == "line") {
TheNames1 = " ";
} else {
TheNames1 = rsNoRec.Fields("BClabelItem_Sample").Value;
}
}
//if field is equal to code
if (rsNoRec.Fields("BClabelItem_Field").Value == "code") {
rs = modRecordSet.getRS(ref "INSERT INTO LabelItem(labelItem_LabelID,labelItem_Line,labelItem_Field,labelItem_Align,labelItem_Size,labelItem_Bold,labelItem_Sample) VALUES (" + TheLaID + "," + rsNoRec.Fields("BClabelItem_Line").Value + ",'code'," + rsNoRec.Fields("BClabelItem_Align").Value + "," + rsNoRec.Fields("BClabelItem_Size").Value + "," + rsNoRec.Fields("BClabelItem_Bold").Value + ",'" + TheNames1 + "')");
//if field is equal to line
} else if (rsNoRec.Fields("BClabelItem_Field").Value == "line") {
rs = modRecordSet.getRS(ref "INSERT INTO LabelItem(labelItem_LabelID,labelItem_Line,labelItem_Field,labelItem_Align,labelItem_Size,labelItem_Bold,labelItem_Sample) VALUES (" + TheLaID + "," + rsNoRec.Fields("BClabelItem_Line").Value + ",'line'," + rsNoRec.Fields("BClabelItem_Align").Value + "," + rsNoRec.Fields("BClabelItem_Size").Value + "," + rsNoRec.Fields("BClabelItem_Bold").Value + ",'" + TheNames1 + "')");
//****
//New code for Blank
//if field is equal to line
} else if (rsNoRec.Fields("BClabelItem_Field").Value == "blank") {
rs = modRecordSet.getRS(ref "INSERT INTO LabelItem(labelItem_LabelID,labelItem_Line,labelItem_Field,labelItem_Align,labelItem_Size,labelItem_Bold,labelItem_Sample) VALUES (" + TheLaID + "," + rsNoRec.Fields("BClabelItem_Line").Value + ",'blank'," + rsNoRec.Fields("BClabelItem_Align").Value + "," + rsNoRec.Fields("BClabelItem_Size").Value + "," + rsNoRec.Fields("BClabelItem_Bold").Value + ",'" + TheNames1 + "')");
//****
} else {
rs = modRecordSet.getRS(ref "INSERT INTO LabelItem(labelItem_LabelID,labelItem_Line,labelItem_Field,labelItem_Align,labelItem_Size,labelItem_Bold,labelItem_Sample) VALUES (" + TheLaID + "," + rsNoRec.Fields("BClabelItem_Line").Value + ",'" + rsNoRec.Fields("BClabelItem_Field").Value + "'," + rsNoRec.Fields("BClabelItem_Align").Value + "," + rsNoRec.Fields("BClabelItem_Size").Value + "," + rsNoRec.Fields("BClabelItem_Bold").Value + ",'" + MySamp + "')");
}
rsNoRec.MoveNext();
}
rs = modRecordSet.getRS(ref "SELECT * FROM BClabel WHERE BClabelID=" + modApplication.RecSel + "");
//For Inserting New Record into BClabel
rsCName = modRecordSet.getRS(ref "INSERT INTO BClabel(BClabelID,BClabel_Name,BClabel_Type,BClabel_Disabled,BClabel_Height,BClabel_LabelID)VALUES(" + RecSel1 + ",'" + rs.Fields("BClabel_Name").Value + "','" + rs.Fields("BClabel_Type").Value + "'," + rs.Fields("BClabel_Disabled").Value + "," + rs.Fields("BClabel_Height").Value + "," + TheLaID + ")");
rs = modRecordSet.getRS(ref "SELECT * FROM LabelItem WHERE labelItem_LabelID=" + TheLaID + "");
//For Inserting New record into BCLabelItem
//If rs.RecordCount > 0 Then
//End If
while (!(rs.EOF)) {
rsCName = modRecordSet.getRS(ref "INSERT INTO BClabelItem(BClabelItem_BCLabelID,BClabelItem_Line,BClabelItem_Field,BClabelItem_Align,BClabelItem_Size,BClabelItem_Bold,BClabelItem_Sample,BClabelItem_Disabled,BClabelItem_LabelID)VALUES(" + RecSel1 + "," + rs.Fields("labelItem_Line").Value + ",'" + rs.Fields("labelItem_Field").Value + "'," + rs.Fields("labelItem_Align").Value + "," + rs.Fields("labelItem_Size").Value + "," + rs.Fields("labelItem_Bold").Value + ",'" + rs.Fields("labelItem_Sample").Value + "','" + 0 + "'," + TheLaID + ")");
rs.MoveNext();
}
//000
rsCName = modRecordSet.getRS(ref "SELECT * FROM BClabelItemUndo");
if (rsCName.RecordCount > 0) {
rs = modRecordSet.getRS(ref "SELECT * FROM BClabelItemUndo");
} else {
modApplication.TheSelectedPrinterNew = 2;
modApplication.MyLIDWHole = TheLaID;
labelsfile();
return;
}
//rs.MoveLast
while (!(rs.EOF)) {
rsNoRec = modRecordSet.getRS(ref "SELECT * FROM BClabelItem WHERE BClabelItemID =" + rs.Fields("BClabelItemID").Value + " AND BClabelItem_Field='" + rs.Fields("BClabelItem_Field").Value + "'");
示例13: CopyTable
public void CopyTable(ADOX.Table tblAccess)
{
ADODB.Recordset recMaster = new ADODB.Recordset();
ADODB.Recordset recLoop = new ADODB.Recordset();
int intLoop = 0;
string strInfile = "";
string strSQL = "SELECT ";
string strRecord;
string strLoadFilePath = strSourceDbPath.Replace("\\", "\\\\");
string strFileName = strTempPath + tblAccess.Name + ".txt";
StreamWriter sw = new StreamWriter(strFileName, false);
//create the infile
strInfile += "LOAD DATA LOCAL INFILE '" + strFileName + "' INTO TABLE " + strMySQLDBName + "." + tblAccess.Name + " ";
strInfile += "FIELDS TERMINATED BY ',' ";
strInfile += "ESCAPED BY '\\\\' ";
strInfile += "LINES TERMINATED BY 0x0d0a ";
strInfile += "(";
//loop through fields to enumerate them for the infile and build a select statement
for (intLoop = 0; intLoop < tblAccess.Columns.Count; intLoop++)
{
strInfile += MySQLName((tblAccess.Columns[intLoop].Name));
switch (tblAccess.Columns[intLoop].Type)
{
case ADOX.DataTypeEnum.adDate: //convert to MySQL datetime format
strSQL += "FORMAT([" + tblAccess.Columns[intLoop].Name + "], 'YYYY-MM-DD HH:MM:SS') as " + tblAccess.Columns[intLoop].Name;
break;
default:
strSQL += "[" + tblAccess.Columns[intLoop].Name + "]";
break;
}
if (intLoop < tblAccess.Columns.Count - 1)
{
strSQL += ",";
strInfile += ", ";
}
}
strInfile += ");";
strSQL += " FROM [" + tblAccess.Name + "]";
//open the "Master" recordset
recMaster.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
recMaster.Open(strSQL, conJCMS_db, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic, 0);
//create the "Loop" recordset, this is a clone of the master, with the exception
//that the definedsize for text fields is lengthened. This is because the added
//escape characters could potentially exceed the field length in the master recordset
recLoop.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
ADODB.Fields fdsLoop = recLoop.Fields;
ADODB.Fields fdsMaster = recMaster.Fields;
foreach (ADODB.Field fldIn in fdsMaster)
{
if (fldIn.Type.ToString().IndexOf("Char") > 0)
{
fdsLoop.Append(fldIn.Name,
fldIn.Type,
fldIn.DefinedSize + 30,
ADODB.FieldAttributeEnum.adFldIsNullable,
null);
}
else
{
fdsLoop.Append(fldIn.Name,
fldIn.Type,
fldIn.DefinedSize,
ADODB.FieldAttributeEnum.adFldIsNullable,
null);
}
}
recLoop.Open(System.Reflection.Missing.Value, System.Reflection.Missing.Value, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic, 0);
recLoop.AddNew(System.Reflection.Missing.Value, System.Reflection.Missing.Value);
while (!recMaster.EOF)
{
for (int columnIndex = 0; columnIndex < recMaster.Fields.Count; columnIndex++)
{
recLoop.Fields[columnIndex].Value = recMaster.Fields[columnIndex].Value;
if (recLoop.Fields[columnIndex].Value.ToString().Length > 0)
{
if ((recLoop.Fields[columnIndex].Value.ToString().IndexOf("\\", 0) + 1) > 0)
{
recLoop.Fields[columnIndex].Value = recLoop.Fields[columnIndex].Value.ToString().Replace("\\", "\\\\");
}
if ((recLoop.Fields[columnIndex].Value.ToString().IndexOf(",", 0) + 1) > 0)
{
recLoop.Fields[columnIndex].Value = recLoop.Fields[columnIndex].Value.ToString().Replace(",", "\\,");
}
if ((recLoop.Fields[columnIndex].Value.ToString().IndexOf(System.Environment.NewLine, 0) + 1) > 0)
{
recLoop.Fields[columnIndex].Value = recLoop.Fields[columnIndex].Value.ToString().Replace(System.Environment.NewLine, " ");
}
}
}
strRecord = recLoop.GetString(ADODB.StringFormatEnum.adClipString, 1, ",", System.Environment.NewLine, "\\N");
recLoop.MovePrevious();
sw.Write(strRecord);
recMaster.MoveNext();
//.........这里部分代码省略.........
示例14: cmdPrintHistory_Click
private void cmdPrintHistory_Click(System.Object eventSender, System.EventArgs eventArgs)
{
int i = 0;
int x = 0;
string sql = null;
string databaseName = null;
short y = 0;
short lMonth = 0;
ADODB.Connection cn = default(ADODB.Connection);
ADODB.Recordset rs = new ADODB.Recordset();
bool bReset = false;
// ERROR: Not supported in C#: OnErrorStatement
//If cmdShowHistory.Caption = "Show Full History " Then
// cmdShowHistory.Caption = "Show Current Month"
//ElseIf cmdShowHistory.Caption = "Show Full History" Then
// cmdShowHistory.Caption = "Show Current Month"
//Else
// cmdShowHistory.Caption = "Show Full History "
// cmdsearch_Click
// Exit Sub
//End If
if (gLoading)
return;
gLoading = true;
Cursor = System.Windows.Forms.Cursors.WaitCursor;
System.Windows.Forms.Application.DoEvents();
y = cmbMonth.Items.Count - 1;
//lvTransaction.ListItems.Clear
//lblcount.Caption = "0 of 0"
//lvTransaction.Visible = False
sql = "DELETE tempCustomerHistory.* FROM tempCustomerHistory;";
modRecordSet.cnnDB.Execute(sql);
string lPosString = null;
//(cmbMonth.ListCount - 1)
for (i = 0; i <= y; i++) {
lMonth = Convert.ToInt32(cmbMonth.SelectedItem(i));
if (lMonth == gMonthEnd) {
databaseName = "pricing.mdb";
} else {
databaseName = "Month" + lMonth + ".mdb";
}
cn = modRecordSet.openConnectionInstance(ref databaseName);
if (cn == null) {
goto nextMonth;
//Exit Sub
}
//Dim lString As String
//Dim lCustomerString As String
//Dim lStockString As String
if (this.cmbPOS.SelectedIndex)
lPosString = " AND (Sale_PosID=" + cmbPOS.SelectedIndex + ")";
sql = "SELECT CustomerTransaction.CustomerTransactionID, CustomerTransaction.CustomerTransaction_CustomerID, CustomerTransaction.CustomerTransaction_TransactionTypeID, CustomerTransaction.CustomerTransaction_DayEndID, CustomerTransaction.CustomerTransaction_MonthEndID, CustomerTransaction.CustomerTransaction_ReferenceID, CustomerTransaction.CustomerTransaction_Date, CustomerTransaction.CustomerTransaction_Description, CustomerTransaction.CustomerTransaction_Amount, CustomerTransaction.CustomerTransaction_Reference, CustomerTransaction.CustomerTransaction_PersonName," + " TransactionType.TransactionType_Name, IIf([CustomerTransaction_Amount]>0,[CustomerTransaction_Amount],Null) AS debit, IIf([CustomerTransaction_Amount]<0,[CustomerTransaction_Amount],Null) AS credit FROM CustomerTransaction INNER JOIN TransactionType ON CustomerTransaction.CustomerTransaction_TransactionTypeID = TransactionType.TransactionTypeID WHERE (((CustomerTransaction.CustomerTransaction_CustomerID)=" + adoPrimaryRS.Fields("CustomerID").Value + ") AND (CustomerTransaction.CustomerTransaction_MonthEndID=(" + lMonth + "))) ORDER BY CustomerTransaction.CustomerTransactionID DESC;";
sql = "SELECT * FROM CustomerTransaction WHERE (((CustomerTransaction.CustomerTransaction_CustomerID)=" + adoPrimaryRS.Fields("CustomerID").Value + ") AND (CustomerTransaction.CustomerTransaction_MonthEndID=(" + lMonth + "))) ORDER BY CustomerTransaction.CustomerTransactionID DESC;";
Debug.Print(sql);
rs.Open(sql, cn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, ADODB.CommandTypeEnum.adCmdText);
//Dim lvItem As listItem
x = 0;
//lvTransaction.Visible = False
while (!(rs.EOF)) {
x = x + 1;
if (gLoading) {
} else {
break; // TODO: might not be correct. Was : Exit Do
}
bResetError:
//lblcount.Caption = x & " of " & rs.RecordCount
System.Windows.Forms.Application.DoEvents();
if (bReset) {
bReset = false;
// ERROR: Not supported in C#: OnErrorStatement
sql = "INSERT INTO tempCustomerHistory ( CustomerTransactionID, CustomerTransaction_CustomerID, CustomerTransaction_TransactionTypeID, CustomerTransaction_DayEndID, CustomerTransaction_MonthEndID, CustomerTransaction_ReferenceID, CustomerTransaction_Date, CustomerTransaction_Description, CustomerTransaction_Amount, CustomerTransaction_Reference, CustomerTransaction_PersonName, CustomerTransaction_Done ) ";
sql = sql + "SELECT " + rs.Fields("CustomerTransactionID").Value + ", " + rs.Fields("CustomerTransaction_CustomerID").Value + ", " + rs.Fields("CustomerTransaction_TransactionTypeID").Value + ", " + rs.Fields("CustomerTransaction_DayEndID").Value + ", " + rs.Fields("CustomerTransaction_MonthEndID").Value + ", " + rs.Fields("CustomerTransaction_ReferenceID").Value + ", #" + rs.Fields("CustomerTransaction_Date").Value + "#, '" + rs.Fields("CustomerTransaction_Description").Value + "', " + rs.Fields("CustomerTransaction_Amount").Value + ", '" + rs.Fields("CustomerTransaction_Reference").Value + "', '" + rs.Fields("CustomerTransaction_PersonName").Value + "', " + rs.Fields("CustomerTransaction_Done").Value + ";";
modRecordSet.cnnDB.Execute(sql);
} else {
sql = "INSERT INTO tempCustomerHistory ( CustomerTransactionID, CustomerTransaction_CustomerID, CustomerTransaction_TransactionTypeID, CustomerTransaction_DayEndID, CustomerTransaction_MonthEndID, CustomerTransaction_ReferenceID, CustomerTransaction_Date, CustomerTransaction_Description, CustomerTransaction_Amount, CustomerTransaction_Reference, CustomerTransaction_PersonName, CustomerTransaction_Done, CustomerTransaction_Main, CustomerTransaction_Child, CustomerTransaction_Allocated ) ";
sql = sql + "SELECT " + rs.Fields("CustomerTransactionID").Value + ", " + rs.Fields("CustomerTransaction_CustomerID").Value + ", " + rs.Fields("CustomerTransaction_TransactionTypeID").Value + ", " + rs.Fields("CustomerTransaction_DayEndID").Value + ", " + rs.Fields("CustomerTransaction_MonthEndID").Value + ", " + rs.Fields("CustomerTransaction_ReferenceID").Value + ", #" + rs.Fields("CustomerTransaction_Date").Value + "#, '" + rs.Fields("CustomerTransaction_Description").Value + "', " + rs.Fields("CustomerTransaction_Amount").Value + ", '" + rs.Fields("CustomerTransaction_Reference").Value + "', '" + rs.Fields("CustomerTransaction_PersonName").Value + "', " + rs.Fields("CustomerTransaction_Done").Value + ", " + rs.Fields("CustomerTransaction_Main").Value + ", " + rs.Fields("CustomerTransaction_Child").Value + ", " + rs.Fields("CustomerTransaction_Allocated").Value + ";";
modRecordSet.cnnDB.Execute(sql);
}
//If rs("CustomerTransaction_Reference") <> "Month End" Then
// Set lvItem = lvTransaction.ListItems.Add(, "K" & rs("CustomerTransactionID") & "_" & databaseName & "_" & rs("CustomerTransaction_ReferenceID") & "_" & rs("CustomerTransaction_TransactionTypeID"), Format(rs("CustomerTransaction_Date"), "yyyy mmm dd hh:mm"))
// lvItem.SubItems(1) = rs("CustomerTransaction_Reference")
// lvItem.SubItems(2) = rs("TransactionType_Name")
// lvItem.SubItems(3) = FormatNumber(rs("debit"), 2)
// lvItem.SubItems(4) = FormatNumber(rs("credit"), 2)
//End If
rs.MoveNext();
}
//lvTransaction.Visible = True
//.........这里部分代码省略.........
示例15: getAddress
public string getAddress()
{
try
{
Position PoiX = new Position();
PoiX.X = Lat; PoiX.Y = Lon;
double tempLen = 1000000;
string tempTown = "";
ADODB.Recordset RST = new ADODB.Recordset();
string sqlSTR = "SELECT name,the_geom FROM mergedpoints WHERE the_geom && 'BOX3D(" +
(Lon - 0.5) + " " + (Lat - 0.5) + "," + (Lon + 0.5) + " " + (Lat + 0.5) +
") '::box3d AND distance( the_geom, GeometryFromText( 'POINT(" + Lon + " " + Lat +
")', -1 ) ) < 0.5";
string sqlSTROther = "SELECT name,the_geom FROM mergedpoints WHERE the_geom && 'BOX3D(" +
(Lon - 6) + " " + (Lat - 6) + "," + (Lon + 6) + " " + (Lat + 6) +
") '::box3d AND distance( the_geom, GeometryFromText( 'POINT(" + Lon + " " + Lat +
")', -1 ) ) < 7";
RST.Open(sqlSTR, this.odbcDatabaseConnection, ADODB.CursorTypeEnum.adOpenDynamic,
ADODB.LockTypeEnum.adLockBatchOptimistic, 0);
if (RST.EOF == true)
{
try { RST.Close(); }
catch { }
RST.Open(sqlSTROther, this.odbcDatabaseConnection, ADODB.CursorTypeEnum.adOpenDynamic,
ADODB.LockTypeEnum.adLockBatchOptimistic, 0);
}
if (RST.EOF == false)
{
RST.MoveFirst();
while (RST.EOF == false)
{
string Coord = RST.Fields["the_geom"].Value.ToString();
int Len = Coord.Length;
Coord = Right(Coord, (Len - 14));
Len = Coord.Length;
Coord = Mid(Coord, 0, (Len - 1));
char[] SepChar = { ' ' };
Array coordArray = Coord.Split(SepChar);
double xlon = Convert.ToDouble(coordArray.GetValue(0).ToString());
double xlat = Convert.ToDouble(coordArray.GetValue(1).ToString());
Position PoiY = new Position();
PoiY.X = xlat; PoiY.Y = xlon;
Calculations calc = new Calculations();
double xLen = calc.CalculateDistace(PoiX, PoiY);
//MessageBox.Show(xLen.ToString());
if (xLen < tempLen)
{
tempLen = xLen;
tempTown = RST.Fields["name"].Value.ToString();
}
//PoiY = null;
coordArray = null;
RST.MoveNext();
}
RST.Close();
RST = null;
}
if (tempLen != 1000000)
{
string retVal = Decimal.Round((decimal)tempLen, 3).ToString();
return retVal + "Km From " + tempTown;
}
else
{
return " ";
}
}
catch (System.Exception qw) { return " "; }
}