本文整理汇总了C#中ADODB.Recordset.moveNext方法的典型用法代码示例。如果您正苦于以下问题:C# ADODB.Recordset.moveNext方法的具体用法?C# ADODB.Recordset.moveNext怎么用?C# ADODB.Recordset.moveNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ADODB.Recordset
的用法示例。
在下文中一共展示了ADODB.Recordset.moveNext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getMWNo
public int getMWNo()
{
int functionReturnValue = 0;
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
rsMWare = modRecordSet.getRS(ref "SELECT WarehouseID, Warehouse_Name From Warehouse WHERE (WarehouseID > 1) ORDER BY WarehouseID");
if (rsMWare.RecordCount == 1) {
functionReturnValue = rsMWare.Fields("WarehouseID").Value;
goto jumpOut;
}
cmbMWNo.Items.Clear();
while (!(rsMWare.EOF)) {
cmbMWNo.Items.Add(new LBI(rsMWare.Fields("Warehouse_Name").Value, rsMWare.Fields("WarehouseID").Value));
rsMWare.moveNext();
}
cmbMWNo.SelectedIndex = 0;
txtWNO.Text = Convert.ToString(cmbMWNo.SelectedIndex);
loadLanguage();
this.ShowDialog();
functionReturnValue = lMWNo;
jumpOut:
return functionReturnValue;
}
示例2: cmdShowHistory_Click
private void cmdShowHistory_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();
// ERROR: Not supported in C#: OnErrorStatement
if (cmdShowHistory.Text == "&Show Full History") {
cmdShowHistory.Text = "&Show Current Month";
} else {
cmdShowHistory.Text = "&Show Full History";
cmdsearch_Click(cmdSearch, new System.EventArgs());
return;
}
if (gLoading)
return;
gLoading = true;
Cursor = System.Windows.Forms.Cursors.WaitCursor;
System.Windows.Forms.Application.DoEvents();
y = cmbMonth.Items.Count - 1;
lvTransaction.Items.Clear();
lblcount.Text = "0 of 0";
lvTransaction.Visible = false;
string lPosString = null;
System.Windows.Forms.ListViewItem lvItem = null;
//(cmbMonth.ListCount - 1)
for (i = 0; i <= y; i++) {
lMonth = Convert.ToInt32(cmbMonth.Items[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 + ")) ORDER BY CustomerTransaction.CustomerTransactionID DESC;";
Debug.Print(sql);
rs.Open(sql, cn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, ADODB.CommandTypeEnum.adCmdText);
x = 0;
//lvTransaction.Visible = False
while (!(rs.EOF)) {
x = x + 1;
if (gLoading) {
} else {
break; // TODO: might not be correct. Was : Exit Do
}
lblcount.Text = x + " of " + rs.RecordCount;
System.Windows.Forms.Application.DoEvents();
if (rs.Fields("CustomerTransaction_Reference").Value != "Month End") {
lvItem = lvTransaction.Items.Add("K" + rs.Fields("CustomerTransactionID").Value + "_" + databaseName + "_" + rs.Fields("CustomerTransaction_ReferenceID").Value + "_" + rs.Fields("CustomerTransaction_TransactionTypeID").Value, Strings.Format(rs.Fields("CustomerTransaction_Date").Value, "yyyy mmm dd hh:mm"), "");
if (lvItem.SubItems.Count > 1) {
lvItem.SubItems[1].Text = rs.Fields("CustomerTransaction_Reference").Value;
} else {
lvItem.SubItems.Insert(1, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("CustomerTransaction_Reference").Value));
}
if (lvItem.SubItems.Count > 2) {
lvItem.SubItems[2].Text = rs.Fields("TransactionType_Name").Value;
} else {
lvItem.SubItems.Insert(2, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("TransactionType_Name").Value));
}
if (lvItem.SubItems.Count > 3) {
lvItem.SubItems[3].Text = Strings.FormatNumber(rs.Fields("debit").Value, 4);
} else {
lvItem.SubItems.Insert(3, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("debit").Value, 4)));
}
if (lvItem.SubItems.Count > 4) {
lvItem.SubItems[4].Text = Strings.FormatNumber(rs.Fields("credit").Value, 4);
} else {
lvItem.SubItems.Insert(4, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("credit").Value, 4)));
}
}
rs.moveNext();
}
//lvTransaction.Visible = True
rs.Close();
nextMonth:
}
lvTransaction.Visible = true;
//.........这里部分代码省略.........
示例3: cmdsearch_Click_AllocByID
//.........这里部分代码省略.........
}
}
} else if (rs.Fields("TransactionType_Name").Value == "Invoice") {
//If IIf(IsNull(rs("debit")), 0, rs("debit")) = rs("CustomerTransaction_Allocated") Then
//Else
lvItem = lvTransAlloc.Items.Add("K" + rs.Fields("CustomerTransactionAllocID").Value + "_" + databaseName + "_" + rs.Fields("CustomerTransaction_ReferenceID").Value + "_" + rs.Fields("CustomerTransaction_TransactionTypeID").Value, Strings.Format(rs.Fields("CustomerTransaction_Date").Value, "yyyy mmm dd hh:mm"), "");
if (lvItem.SubItems.Count > 1) {
lvItem.SubItems[1].Text = rs.Fields("CustomerTransaction_Reference").Value;
} else {
lvItem.SubItems.Insert(1, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("CustomerTransaction_Reference").Value));
}
if (lvItem.SubItems.Count > 2) {
lvItem.SubItems[2].Text = rs.Fields("TransactionType_Name").Value;
} else {
lvItem.SubItems.Insert(2, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("TransactionType_Name").Value));
}
if (lvItem.SubItems.Count > 3) {
lvItem.SubItems[3].Text = Strings.FormatNumber(rs.Fields("debit").Value, 4);
} else {
lvItem.SubItems.Insert(3, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("debit").Value, 4)));
}
if (lvItem.SubItems.Count > 4) {
lvItem.SubItems[4].Text = Strings.FormatNumber(rs.Fields("credit").Value, 4);
} else {
lvItem.SubItems.Insert(4, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("credit").Value, 4)));
}
if (lvItem.SubItems.Count > 5) {
lvItem.SubItems[5].Text = Strings.FormatNumber(rs.Fields("CustomerTransactionAlloc_Amount").Value, 4);
} else {
lvItem.SubItems.Insert(5, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("CustomerTransactionAlloc_Amount").Value, 4)));
}
//End If
} else if (rs.Fields("TransactionType_Name").Value == "Interest") {
//If IIf(IsNull(rs("debit")), 0, rs("debit")) = rs("CustomerTransaction_Allocated") Then
//Else
lvItem = lvTransAlloc.Items.Add("K" + rs.Fields("CustomerTransactionAllocID").Value + "_" + databaseName + "_" + rs.Fields("CustomerTransaction_ReferenceID").Value + "_" + rs.Fields("CustomerTransaction_TransactionTypeID").Value, Strings.Format(rs.Fields("CustomerTransaction_Date").Value, "yyyy mmm dd hh:mm"), "");
if (lvItem.SubItems.Count > 1) {
lvItem.SubItems[1].Text = rs.Fields("CustomerTransaction_Reference").Value;
} else {
lvItem.SubItems.Insert(1, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("CustomerTransaction_Reference").Value));
}
if (lvItem.SubItems.Count > 2) {
lvItem.SubItems[2].Text = rs.Fields("TransactionType_Name").Value;
} else {
lvItem.SubItems.Insert(2, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("TransactionType_Name").Value));
}
if (lvItem.SubItems.Count > 3) {
lvItem.SubItems[3].Text = Strings.FormatNumber(rs.Fields("debit").Value, 4);
} else {
lvItem.SubItems.Insert(3, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("debit").Value, 4)));
}
if (lvItem.SubItems.Count > 4) {
lvItem.SubItems[4].Text = Strings.FormatNumber(rs.Fields("credit").Value, 4);
} else {
lvItem.SubItems.Insert(4, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("credit").Value, 4)));
}
if (lvItem.SubItems.Count > 5) {
lvItem.SubItems[5].Text = Strings.FormatNumber(rs.Fields("CustomerTransactionAlloc_Amount").Value, 4);
} else {
lvItem.SubItems.Insert(5, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("CustomerTransactionAlloc_Amount").Value, 4)));
}
//End If
} else if (rs.Fields("TransactionType_Name").Value == "Debit Journal") {
//If IIf(IsNull(rs("debit")), 0, rs("debit")) = rs("CustomerTransaction_Allocated") Then
//Else
lvItem = lvTransAlloc.Items.Add("K" + rs.Fields("CustomerTransactionAllocID").Value + "_" + databaseName + "_" + rs.Fields("CustomerTransaction_ReferenceID").Value + "_" + rs.Fields("CustomerTransaction_TransactionTypeID").Value, Strings.Format(rs.Fields("CustomerTransaction_Date").Value, "yyyy mmm dd hh:mm"), "");
if (lvItem.SubItems.Count > 1) {
lvItem.SubItems[1].Text = rs.Fields("CustomerTransaction_Reference").Value;
} else {
lvItem.SubItems.Insert(1, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("CustomerTransaction_Reference").Value));
}
if (lvItem.SubItems.Count > 2) {
lvItem.SubItems[2].Text = rs.Fields("TransactionType_Name").Value;
} else {
lvItem.SubItems.Insert(2, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("TransactionType_Name").Value));
}
if (lvItem.SubItems.Count > 3) {
lvItem.SubItems[3].Text = Strings.FormatNumber(rs.Fields("debit").Value, 4);
} else {
lvItem.SubItems.Insert(3, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("debit").Value, 4)));
}
if (lvItem.SubItems.Count > 4) {
lvItem.SubItems[4].Text = Strings.FormatNumber(rs.Fields("credit").Value, 4);
} else {
lvItem.SubItems.Insert(4, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("credit").Value, 4)));
}
if (lvItem.SubItems.Count > 5) {
lvItem.SubItems[5].Text = Strings.FormatNumber(rs.Fields("CustomerTransactionAlloc_Amount").Value, 4);
} else {
lvItem.SubItems.Insert(5, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("CustomerTransactionAlloc_Amount").Value, 4)));
}
//End If
}
rs.moveNext();
}
lvTransAlloc.Visible = true;
lvTransAlloc.Refresh();
Cursor = System.Windows.Forms.Cursors.Default;
gLoading = false;
}
示例4: CalcIntPeriod
public object CalcIntPeriod()
{
// ERROR: Not supported in C#: OnErrorStatement
double IntFromPeriod = 0;
double HoldTheSum = 0;
string TSum = null;
string CDateN = null;
string HoldVer = null;
string CmsBOx = null;
ADODB.Recordset rs = default(ADODB.Recordset);
rs = modRecordSet.getRS(ref "select * from Company");
modApplication.IntPeriod = rs.Fields("Company_IntPeriod").Value;
modApplication.Intpercen = rs.Fields("Company_IntPercent").Value;
if (!string.IsNullOrEmpty(modApplication.IntPeriod) & modApplication.Intpercen != 0) {
if (Interaction.MsgBox("This will calculate interest Percentage of " + "'" + modApplication.Intpercen + "%' " + " from " + "'" + modApplication.IntPeriod + "'" + " on your Overdue accounts are you sure you want to continue", MsgBoxStyle.YesNo, "4Pos Interest Calculation") == MsgBoxResult.Yes) {
//If vbYes Then
CDateN = Strings.Format(DateAndTime.Today);
adoPrimaryRS = modRecordSet.getRS(ref "select * from Customer");
if (modApplication.IntPeriod == "Current") {
adoPrimaryRS.MoveFirst();
while (!(adoPrimaryRS.EOF)) {
HoldTheSum = (adoPrimaryRS.Fields("Customer_Current").Value + adoPrimaryRS.Fields("Customer_30Days").Value + adoPrimaryRS.Fields("Customer_60Days").Value + adoPrimaryRS.Fields("Customer_90Days").Value + adoPrimaryRS.Fields("Customer_120Days").Value + adoPrimaryRS.Fields("Customer_150Days").Value);
if (HoldTheSum > 0) {
//Calculate interest
IntFromPeriod = (HoldTheSum * modApplication.Intpercen / 100) / 12;
TSum = Convert.ToString(IntFromPeriod + HoldTheSum);
//cnnDB.Execute "INSERT INTO Interest (CustomerID,Perc,Period,CDate,Description,Debit,Credit,SumIntBal)VALUES ('" & adoPrimaryRS("CustomerID") & "','" & Intpercen & "%" & "','" & IntPeriod & "','" & CDateN & "',' Interest ','" & IntFromPeriod & "','" & 0 & " ','" & TSum & "')"
System.Windows.Forms.Application.DoEvents();
cmdProcess_Click(ref adoPrimaryRS.Fields("CustomerID"), ref IntFromPeriod);
System.Windows.Forms.Application.DoEvents();
}
adoPrimaryRS.moveNext();
}
} else if (modApplication.IntPeriod == "30 Days") {
adoPrimaryRS.MoveFirst();
while (!(adoPrimaryRS.EOF)) {
HoldTheSum = adoPrimaryRS.Fields("Customer_30Days").Value + adoPrimaryRS.Fields("Customer_60Days").Value + adoPrimaryRS.Fields("Customer_90Days").Value + adoPrimaryRS.Fields("Customer_120Days").Value + adoPrimaryRS.Fields("Customer_150Days").Value;
if (HoldTheSum > 0) {
//Calculate interest
IntFromPeriod = (HoldTheSum * modApplication.Intpercen / 100) / 12;
TSum = Convert.ToString(IntFromPeriod + HoldTheSum);
//cnnDB.Execute "INSERT INTO Interest (CustomerID,Perc,Period,CDate,Description,Debit,Credit,SumIntBal)VALUES ('" & adoPrimaryRS("CustomerID") & "','" & Intpercen & "%" & "','" & IntPeriod & "','" & CDateN & "',' Interest ','" & IntFromPeriod & "','" & 0 & " ','" & TSum & "')"
System.Windows.Forms.Application.DoEvents();
cmdProcess_Click(ref adoPrimaryRS.Fields("CustomerID"), ref IntFromPeriod);
System.Windows.Forms.Application.DoEvents();
}
adoPrimaryRS.moveNext();
}
} else if (modApplication.IntPeriod == "60 Days") {
adoPrimaryRS.MoveFirst();
while (!(adoPrimaryRS.EOF)) {
HoldTheSum = adoPrimaryRS.Fields("Customer_60Days").Value + adoPrimaryRS.Fields("Customer_90Days").Value + adoPrimaryRS.Fields("Customer_120Days").Value + adoPrimaryRS.Fields("Customer_150Days").Value;
if (HoldTheSum > 0) {
//Calculate interest
IntFromPeriod = (HoldTheSum * modApplication.Intpercen / 100) / 12;
TSum = Convert.ToString(IntFromPeriod + HoldTheSum);
//cnnDB.Execute "INSERT INTO Interest (CustomerID,Perc,Period,CDate,Description,Debit,Credit,SumIntBal)VALUES ('" & adoPrimaryRS("CustomerID") & "','" & Intpercen & "%" & "','" & IntPeriod & "','" & CDateN & "',' Interest ','" & IntFromPeriod & "','" & 0 & " ','" & TSum & "')"
System.Windows.Forms.Application.DoEvents();
cmdProcess_Click(ref adoPrimaryRS.Fields("CustomerID"), ref IntFromPeriod);
System.Windows.Forms.Application.DoEvents();
}
adoPrimaryRS.moveNext();
}
} else if (modApplication.IntPeriod == "90 Days") {
adoPrimaryRS.MoveFirst();
while (!(adoPrimaryRS.EOF)) {
HoldTheSum = adoPrimaryRS.Fields("Customer_90Days").Value + adoPrimaryRS.Fields("Customer_120Days").Value + adoPrimaryRS.Fields("Customer_150Days").Value;
if (HoldTheSum > 0) {
//Calculate interest
IntFromPeriod = (HoldTheSum * modApplication.Intpercen / 100) / 12;
TSum = Convert.ToString(IntFromPeriod + HoldTheSum);
//cnnDB.Execute "INSERT INTO Interest (CustomerID,Perc,Period,CDate,Description,Debit,Credit,SumIntBal)VALUES ('" & adoPrimaryRS("CustomerID") & "','" & Intpercen & "%" & "','" & IntPeriod & "','" & CDateN & "',' Interest ','" & IntFromPeriod & "','" & 0 & " ','" & TSum & "')"
//.........这里部分代码省略.........
示例5: cmdShow_Click
private void cmdShow_Click(System.Object eventSender, System.EventArgs eventArgs)
{
int x = 0;
// ERROR: Not supported in C#: OnErrorStatement
ADODB.Recordset rs = default(ADODB.Recordset);
ADODB.Recordset rs1 = default(ADODB.Recordset);
ADODB.Recordset rs2 = default(ADODB.Recordset);
ADODB.Recordset rsB = default(ADODB.Recordset);
ADODB.Recordset rsDcheck = default(ADODB.Recordset);
decimal HMyPrice = default(decimal);
string MyMarkup = null;
decimal HMyPrice1 = default(decimal);
double MyCounterF = 0;
double MyCounterL = 0;
string Delimiter = null;
ADODB.Recordset rsk = default(ADODB.Recordset);
rs = new ADODB.Recordset();
rs1 = new ADODB.Recordset();
rs2 = new ADODB.Recordset();
rsB = new ADODB.Recordset();
rsDcheck = new ADODB.Recordset();
rsk = new ADODB.Recordset();
Delimiter = " ";
//create table name
modApplication.Te_Names = "NewPricechanges";
//In case the table was not dropped then drop it
rs = modRecordSet.getRS(ref "DROP TABLE " + modApplication.Te_Names + "");
modApplication.MyFTypess = "PriceChangesID_DayEndStockItemLnk Number,PriceChanges_StockItemName Text(50),OldPrice Currency,NewPrice Currency,SellingPrice Currency,Markup Number";
//create table NewPriceChanges
modRecordSet.cnnDB.Execute("CREATE TABLE " + modApplication.Te_Names + " (" + modApplication.MyFTypess + ")");
rs1 = modRecordSet.getRS(ref "SELECT DayEnd.DayEndID, DayEnd.DayEnd_Date, DayEndStockItemLnk.DayEndStockItemLnk_StockItemID, aStockItem1.StockItem_Name, DayEndStockItemLnk.DayEndStockItemLnk_ListCost, aStockItem1.StockItemID FROM Report INNER JOIN (DayEnd INNER JOIN (DayEndStockItemLnk INNER JOIN aStockItem1 ON DayEndStockItemLnk.DayEndStockItemLnk_StockItemID = aStockItem1.StockItemID) ON DayEnd.DayEndID = DayEndStockItemLnk.DayEndStockItemLnk_DayEndID) ON Report.Report_DayEndEndID = DayEnd.DayEndID ORDER BY aStockItem1.StockItemID;");
if (rs1.RecordCount) {
while (!(rs1.EOF)) {
rs2 = modRecordSet.getRS(ref "SELECT DayEnd.DayEndID, DayEnd.DayEnd_Date, DayEndStockItemLnk.DayEndStockItemLnk_StockItemID, aStockItem1.StockItem_Name, DayEndStockItemLnk.DayEndStockItemLnk_ListCost, aStockItem1.StockItemID FROM Report INNER JOIN (DayEnd INNER JOIN (DayEndStockItemLnk INNER JOIN aStockItem1 ON DayEndStockItemLnk.DayEndStockItemLnk_StockItemID = aStockItem1.StockItemID) ON DayEnd.DayEndID = DayEndStockItemLnk.DayEndStockItemLnk_DayEndID) ON Report.Report_DayEndStartID = DayEnd.DayEndID WHERE (((aStockItem1.StockItemID)=" + rs1.Fields("DayEndStockItemLnk_StockItemID").Value + "));");
if (rs2.RecordCount) {
if (rs1.Fields("DayEndStockItemLnk_ListCost").Value != rs2.Fields("DayEndStockItemLnk_ListCost").Value) {
MyMarkup = Convert.ToString(0);
//MyMarkup = (rs2("DayEndStockItemLnk_ListCost") / rsB("CatalogueChannelLnk_Price") * 100)
//MyMarkup = 100 - MyMarkup
//insert into Newpricechanges
modRecordSet.cnnDB.Execute("INSERT INTO " + modApplication.Te_Names + "(PriceChangesID_DayEndStockItemLnk,PriceChanges_StockItemName,OldPrice,NewPrice,SellingPrice,Markup)VALUES(" + rs1.Fields("DayEndStockItemLnk_StockItemID").Value + ",'" + rs1.Fields("StockItem_Name").Value + "', " + rs1.Fields("DayEndStockItemLnk_ListCost").Value + ", " + rs2.Fields("DayEndStockItemLnk_ListCost").Value + "," + rs1.Fields("DayEndStockItemLnk_ListCost").Value + "," + MyMarkup + ")");
//delete duplicates
//Set rsk = getRS("DELETE * FROM " & Te_Names & " WHERE (NewPricechanges.PriceChangesID_DayEndStockItemLnk =" & rs2("DayEndStockItemLnk_StockItemID") & " and NewPricechanges.OldPrice = " & rs2("DayEndStockItemLnk_ListCost") & " and NewPricechanges.NewPrice = " & rs2("DayEndStockItemLnk_ListCost") & ")")
}
}
rs1.moveNext();
}
} else {
Interaction.MsgBox("There was No Price Changes of Items between " + this.txtstartdate.Text + " And " + this.txtenddate.Text, MsgBoxStyle.Information, "4POS");
}
//validation for start date
if (string.IsNullOrEmpty(this.txtstartdate.Text)) {
Interaction.MsgBox("Please Select/enter the Start Date", MsgBoxStyle.ApplicationModal + MsgBoxStyle.OkCancel, "4POS");
this.txtstartdate.Focus();
return;
//validation for end date
} else if (string.IsNullOrEmpty(this.txtenddate.Text)) {
Interaction.MsgBox("Please Select/enter the End Date", MsgBoxStyle.ApplicationModal + MsgBoxStyle.OkCancel, "4POS");
this.txtenddate.Focus();
return;
}
//create table name
modApplication.Te_Names = "NewPricechanges";
//In case the table was not dropped then drop it
rs = modRecordSet.getRS(ref "DROP TABLE " + modApplication.Te_Names + "");
modApplication.MyFTypess = "PriceChangesID_DayEndStockItemLnk Number,PriceChanges_StockItemName Text(50),OldPrice Currency,NewPrice Currency,SellingPrice Currency,Markup Number";
//create table NewPriceChanges
modRecordSet.cnnDB.Execute("CREATE TABLE " + modApplication.Te_Names + " (" + modApplication.MyFTypess + ")");
//selecting from the start date
rs = modRecordSet.getRS(ref "SELECT * FROM DayEnd WHERE Datevalue(DayEnd_Date)=#" + this.txtstartdate.Text + "#");
//selecting from the end date
rs1 = modRecordSet.getRS(ref "SELECT * FROM DayEnd WHERE Datevalue(DayEnd_Date) = #" + this.txtenddate.Text + "#");
this.cmdshow.Enabled = false;
this.cmdcancel.Enabled = false;
//assigning the start date and the end date to the below variables
MyCounterF = rs.Fields("DayEndID").Value;
MyCounterL = rs1.Fields("DayEndID").Value;
//loop/round from the first date until the last date selected
for (x = MyCounterF; x <= MyCounterL; x++) {
rs2 = modRecordSet.getRS(ref "SELECT * FROM DayEndStockItemLnk WHERE DayEndStockItemLnk_StockItemID=" + MyCounterF + "");
rsB = modRecordSet.getRS(ref "SELECT * FROM CatalogueChannelLnk WHERE CatalogueChannelLnk_StockItemID=" + MyCounterF + "");
rs = modRecordSet.getRS(ref "SELECT * FROM StockItem WHERE StockItemID=" + rs2.Fields("DayEndStockItemLnk_StockItemID").Value + "");
rs2.MoveFirst();
//formating the price
HMyPrice1 = rs2.Fields("DayEndStockItemLnk_ListCost").Value;
HMyPrice1 = Convert.ToDecimal(Strings.Format(HMyPrice1, "R# ,###.##"));
//formating the price
HMyPrice = rs2.Fields("DayEndStockItemLnk_ListCost").Value;
HMyPrice = Convert.ToDecimal(Strings.Format(HMyPrice, "R# ,###.##"));
rs2.Fields("DayEndStockItemLnk_ListCost").Value = Strings.Format(rs2.Fields("DayEndStockItemLnk_ListCost").Value, "R # ,###.##");
//.........这里部分代码省略.........
示例6: doSearch
private void doSearch()
{
string sql = null;
string lString = null;
System.Windows.Forms.ListViewItem listItem = null;
lString = Strings.Trim(txtSearch.Text);
lString = Strings.Replace(lString, " ", " ");
lString = Strings.Replace(lString, " ", " ");
lString = Strings.Replace(lString, " ", " ");
lString = Strings.Replace(lString, " ", " ");
lString = Strings.Replace(lString, " ", " ");
lString = Strings.Replace(lString, " ", " ");
if (string.IsNullOrEmpty(lString)) {
} else {
lString = " AND (StockItem.StockItem_Name LIKE '%" + Strings.Replace(lString, " ", "%' AND StockItem.StockItem_Name LIKE '%") + "%')";
}
lString = " WHERE StockBreak.StockBreak_Disabled=0 AND WarehouseStockItemLnk.WarehouseStockItemLnk_WarehouseID=2 AND WarehouseStockItemLnk_1.WarehouseStockItemLnk_WarehouseID=2 " + lString;
gRS = modRecordSet.getRS(ref "SELECT StockBreak.StockBreak_Quantity, StockBreak.StockBreak_ParentID, StockItem.StockItem_Name, WarehouseStockItemLnk.WarehouseStockItemLnk_Quantity, StockBreak.StockBreak_ChildID, StockItemChild.StockItem_Name AS StockItemChild_Name, WarehouseStockItemLnk_1.WarehouseStockItemLnk_Quantity AS WarehouseStockItemLnkChild_Quantity FROM WarehouseStockItemLnk AS WarehouseStockItemLnk_1 INNER JOIN (WarehouseStockItemLnk INNER JOIN ((StockBreak INNER JOIN StockItem ON StockBreak.StockBreak_ParentID = StockItem.StockItemID) INNER JOIN StockItem AS StockItemChild ON StockBreak.StockBreak_ChildID = StockItemChild.StockItemID) ON WarehouseStockItemLnk.WarehouseStockItemLnk_StockItemID = StockItem.StockItemID) ON WarehouseStockItemLnk_1.WarehouseStockItemLnk_StockItemID = StockItemChild.StockItemID " + lString + " ORDER BY StockItem.StockItem_Name");
lvStock.Items.Clear();
while (!(gRS.EOF)) {
listItem = lvStock.Items.Add(gRS.Fields("StockBreak_ParentID").Value + "_" + gRS.Fields("StockBreak_ChildID").Value, gRS.Fields("StockItem_Name").Value, "");
if (listItem.SubItems.Count > 0) {
listItem.SubItems[0].Text = gRS.Fields("WarehouseStockItemLnk_Quantity").Value;
} else {
listItem.SubItems.Insert(0, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, gRS.Fields("WarehouseStockItemLnk_Quantity").Value));
}
if (listItem.SubItems.Count > 1) {
listItem.SubItems[1].Text = gRS.Fields("StockItemChild_Name").Value;
} else {
listItem.SubItems.Insert(1, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, gRS.Fields("StockItemChild_Name").Value));
}
if (listItem.SubItems.Count > 2) {
listItem.SubItems[2].Text = gRS.Fields("WarehouseStockItemLnkChild_Quantity").Value;
} else {
listItem.SubItems.Insert(2, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, gRS.Fields("WarehouseStockItemLnkChild_Quantity").Value));
}
if (listItem.SubItems.Count > 3) {
listItem.SubItems[3].Text = gRS.Fields("StockBreak_Quantity").Value;
} else {
listItem.SubItems.Insert(3, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, gRS.Fields("StockBreak_Quantity").Value));
}
gRS.moveNext();
}
if (lvStock.FocusedItem == null) {
this.lblData.Text = "";
picMove.Visible = false;
} else {
//UPGRADE_ISSUE: MSComctlLib.ListView event lvStock.ItemClick was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="ABD9AF39-7E24-4AFF-AD8D-3675C1AA3054"'
lvStock_ItemClick(lvStock.FocusedItem);
picMove.Visible = true;
}
}
示例7: cmdNew_Click
private void cmdNew_Click(System.Object eventSender, System.EventArgs eventArgs)
{
ADODB.Recordset rs = default(ADODB.Recordset);
ADODB.Recordset rsBClabel = default(ADODB.Recordset);
ADODB.Recordset rst = default(ADODB.Recordset);
short TheLastIDIncr = 0;
short BCLabelIDIncr = 0;
ADODB.Recordset rsNewName = default(ADODB.Recordset);
ADODB.Recordset rsForName = default(ADODB.Recordset);
string InpType = null;
short x = 0;
rs = new ADODB.Recordset();
rsBClabel = new ADODB.Recordset();
rst = new ADODB.Recordset();
rsNewName = new ADODB.Recordset();
rsForName = new ADODB.Recordset();
//Set rs = getRS("SELECT Max(BClabel_LabelID) as TheMaxLabelID FROM BClabel")
//***** If BClabel and BClabelItem tables are empty then insert all data from LabelItem
//If IsNull(rs("TheMaxLabelID")) Then
// IntDesign1 = 2
// DataList1_DblClick
// Exit Sub
//End If
rs = modRecordSet.getRS(ref "SELECT Max(LabelID) as TheMaxLabelID FROM Label;");
if (Information.IsDBNull(rs.Fields("TheMaxLabelID").Value)) {
modApplication.IntDesign1 = 2;
DataList1_DblClick(DataList1, new System.EventArgs());
return;
}
TheLastIDIncr = rs.Fields("TheMaxLabelID").Value + 1;
//LabelID
rst = modRecordSet.getRS(ref "SELECT Max(BClabelID) as TheMaxBClabelID FROM BClabel");
if (Information.IsDBNull(rst.Fields("TheMaxBClabelID").Value)) {
BCLabelIDIncr = 1;
} else {
BCLabelIDIncr = rst.Fields("TheMaxBClabelID").Value + 1;
//BCLabelID
}
if (option1[1].Checked == true) {
InpType = Convert.ToString(1);
} else if (option1[2].Checked == true) {
InpType = Convert.ToString(2);
} else {
InpType = Interaction.InputBox("Please enter 1 for New Shelf Talker Design OR 2 for New Barcode Design.");
if (!Information.IsNumeric(InpType)) {
//MsgBox "Please enter 1 for New Shelf Talker Design OR 2 for New Barcode Design.", vbInformation, App.title
return;
} else if (Convert.ToDouble(InpType) == 1) {
modApplication.TheType = 1;
} else if (Convert.ToDouble(InpType) == 2) {
modApplication.TheType = 2;
} else {
Interaction.MsgBox("Please enter 1 for New Shelf Talker Design OR 2 for New Barcode Design.", MsgBoxStyle.Information, _4PosBackOffice.NET.My.MyProject.Application.Info.Title);
return;
}
}
//****
//New Label Name
//****
x = x + 1;
modApplication.NewLabelName = "New Label" + x;
rsNewName = modRecordSet.getRS(ref "SELECT * FROM Label WHERE Label_Name='" + modApplication.NewLabelName + "'");
rsForName = modRecordSet.getRS(ref "SELECT * FROM Label");
if (rsNewName.RecordCount > 0) {
//*******
//Do until New Name not found
//*******
while (!(rsForName.EOF)) {
//****
//If New Label Name not found then add 1 to last Label No
//****
if (rsNewName.RecordCount > 0) {
x = x + 1;
modApplication.NewLabelName = "New Label" + x;
rsNewName = modRecordSet.getRS(ref "SELECT * FROM Label WHERE Label_Name='" + modApplication.NewLabelName + "'");
} else if (rsNewName.RecordCount < 1) {
modApplication.NewLabelName = modApplication.NewLabelName;
break; // TODO: might not be correct. Was : Exit Do
}
rsForName.moveNext();
}
} else {
}
x = 0;
//*****
//Inserting New Label
//*****
rsBClabel = modRecordSet.getRS(ref "INSERT INTO BClabel(BClabelID,BClabel_Name,BClabel_Type,BClabel_Disabled,BClabel_Height,BClabel_LabelID)VALUES(" + BCLabelIDIncr + " ,'Stock','Stock','" + 0 + "',15," + TheLastIDIncr + ")");
//.........这里部分代码省略.........
示例8: doSearch
private void doSearch()
{
ADODB.Recordset rk = default(ADODB.Recordset);
BindingSource bind = new BindingSource();
gRS = modRecordSet.getRS(ref "SELECT Float.Float_Unit, Float.Float_Pack, Float.Float_Name, Float.Float_Type,Float.Float_Disabled From [float] WHERE Float.Float_Type = True AND Float_Disabled = False ORDER BY Float.Float_Unit, Float.Float_Type;");
//Display the list of Titles in the DataCombo
DataList1.DataSource = gRS;
DataList1.listField = "Float_Name";
//Bind the DataCombo to the ADO Recordset
bind.DataSource = gRS;
DataList1.DataBindings.Add(bind.DataSource);
DataList1.boundColumn = "Float_Unit";
Label2.Text = "";
while (gRS.EOF == false) {
rk = modRecordSet.getRS(ref "SELECT keyboard.keyboard_Name,keyboard.keyboard_Description, keyboard.keyboard_Show,keyboard.keyboardID FROM tblPresetTender INNER JOIN keyboard ON tblPresetTender.tblKey = keyboard.KeyboardID WHERE tblPresetTender.tblValue = " + gRS.Fields("Float_Unit").Value + ";");
if (rk.RecordCount) {
Label2.Text = Label2.Text + gRS.Fields("Float_Name").Value + " :";
}
gRS.moveNext();
}
}
示例9: doSearch
private void doSearch()
{
short x = 0;
string sql = null;
string lString = null;
lString = Strings.Trim(txtSearch.Text);
lString = Strings.Replace(lString, " ", " ");
lString = Strings.Replace(lString, " ", " ");
lString = Strings.Replace(lString, " ", " ");
lString = Strings.Replace(lString, " ", " ");
lString = Strings.Replace(lString, " ", " ");
lString = Strings.Replace(lString, " ", " ");
if (string.IsNullOrEmpty(lString)) {
} else {
lString = "WHERE (StockGRoup_Name LIKE '%" + Strings.Replace(lString, " ", "%' AND StockGRoup_Name LIKE '%") + "%')";
}
if (gAll) {
} else {
if (string.IsNullOrEmpty(lString)) {
lString = " WHERE StockGroup_Disabled = 0 ";
} else {
lString = lString + " AND StockGroup_Disabled = 0 ";
}
}
gRS = modRecordSet.getRS(ref "SELECT DISTINCT StockGRoupID, StockGRoup_Name FROM StockGRoup " + lString + " ORDER BY StockGRoup_Name");
//Display the list of Titles in the DataCombo
DataList1.DataSource = gRS;
//Set lstFilter.DataSource = gRS
DataList1.listField = "StockGRoup_Name";
//Bind the DataCombo to the ADO Recordset
//UPGRADE_ISSUE: VBControlExtender property DataList1.DataSource is not supported at runtime. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="74E732F3-CAD8-417B-8BC9-C205714BB4A7"'
DataList1.DataSource = gRS;
DataList1.boundColumn = "StockGRoupID";
int m = 0;
lstFilter.Items.Clear();
for (x = 0; x <= (gRS.RecordCount - 1); x++) {
//If InStr(UCase(gArray(x, 1)), UCase(Me.txtSearch.Text)) Then
lstFilter.Items.Add(gRS.Fields("StockGRoup_Name").Value);
//gArray(x, 1)
m = lstFilter.Items.Add(new SetItemData(lstFilter.SelectedIndex, gRS.Fields("StockGRoupID").Value));
lstFilter.SetItemChecked(m, 0);
gRS.moveNext();
//End If
}
}
示例10: ExportToCSV
public void ExportToCSV(bool PrintHeader = true)
{
string ExportFilePath = null;
ADODB.Recordset rs = default(ADODB.Recordset);
int i = 0;
int TotalRecords = 0;
bool ErrorOccured = false;
short NumberOfFields = 0;
const string quote = "\"";
//Faster then Chr$(34)
string sql = null;
Scripting.FileSystemObject fso = new Scripting.FileSystemObject();
cmdStart.Enabled = false;
cmdExit.Enabled = false;
txtPassword.Enabled = false;
string ptbl = null;
string t_day = null;
string t_Mon = null;
if (Strings.Len(Strings.Trim(Conversion.Str(DateAndTime.Day(DateAndTime.Today)))) == 1)
t_day = "0" + Strings.Trim(Convert.ToString(DateAndTime.Day(DateAndTime.Today)));
else
t_day = Convert.ToString(DateAndTime.Day(DateAndTime.Today));
if (Strings.Len(Strings.Trim(Conversion.Str(DateAndTime.Month(DateAndTime.Today)))) == 1)
t_Mon = "0" + Strings.Trim(Convert.ToString(DateAndTime.Month(DateAndTime.Today)));
else
t_Mon = Conversion.Str(DateAndTime.Month(DateAndTime.Today));
ExportFilePath = modRecordSet.serverPath + "4POSDebtor" + Strings.Trim(Convert.ToString(DateAndTime.Year(DateAndTime.Today))) + Strings.Trim(t_Mon) + Strings.Trim(t_day);
if (fso.FileExists(ExportFilePath + ".csv"))
fso.DeleteFile((ExportFilePath + ".csv"));
rs = modRecordSet.getRS(ref "SELECT CustomerID, Customer_InvoiceName, Customer_DepartmentName, Customer_FirstName, Customer_Surname, Customer_PhysicalAddress, Customer_PostalAddress, Customer_Telephone, Customer_Current as CurrentBalance,Customer_30Days as 30Days, Customer_60Days as 60days, Customer_90Days as 90Days, Customer_120Days as 120Days,Customer_150Days as 150Days FROM Customer");
prgBar.Maximum = rs.RecordCount;
if (rs.RecordCount > 0) {
FileSystem.FileOpen(1, ExportFilePath + ".csv", OpenMode.Output);
var _with2 = modRecordSet.getRS(ref ref "SELECT CustomerID, Customer_InvoiceName, Customer_DepartmentName, Customer_FirstName, Customer_Surname, Customer_PhysicalAddress, Customer_PostalAddress, Customer_Telephone, Customer_Current as CurrentBalance,Customer_30Days as 30Days, Customer_60Days as 60days, Customer_90Days as 90Days, Customer_120Days as 120Days,Customer_150Days as 150Days FROM Customer");
rs.MoveFirst();
NumberOfFields = rs.Fields.Count - 1;
if (PrintHeader) {
//Now add the field names
for (i = 0; i <= NumberOfFields - 1; i++) {
FileSystem.Print(1, rs.Fields(i).name + ",");
//similar to the ones below
}
FileSystem.PrintLine(1, rs.Fields(NumberOfFields).name);
}
while (!rs.EOF) {
prgBar.Value = prgBar.Value + 1;
// ERROR: Not supported in C#: OnErrorStatement
TotalRecords = TotalRecords + 1;
//If there is an emty field,
for (i = 0; i <= NumberOfFields; i++) {
//add a , to indicate it is
if ((Information.IsDBNull(rs.Fields(i).Value))) {
FileSystem.Print(1, ",");
//empty
} else {
if (i == NumberOfFields) {
FileSystem.Print(1, quote + Strings.Trim(Convert.ToString(rs.Fields(i).Value)) + quote);
} else {
FileSystem.Print(1, quote + Strings.Trim(Convert.ToString(rs.Fields(i).Value)) + quote + ",");
}
}
//Putting data under "" will not
}
//confuse the reader of the file
DoEventsEx();
//between Dhaka, Bangladesh as two
FileSystem.PrintLine(1);
//fields or as one field.
rs.moveNext();
}
FileSystem.FileClose(1);
Interaction.MsgBox("Customer details were successfully exported to : " + FilePath + "" + "4POSProd" + Strings.Trim(Convert.ToString(DateAndTime.Year(DateAndTime.Today))) + Strings.Trim(t_Mon) + Strings.Trim(t_day) + ".csv", MsgBoxStyle.OkOnly, "Customers");
// DoEvents
// DoEvents
// MsgBox "Now Zeroising...", vbOKOnly, "Customers"
// cmdStart.Enabled = False
// cmdExit.Enabled = False
// Set rsZ = getRS("SELECT CustomerID FROM Customer")
// Do While Not rsZ.EOF
// DoEvents
// cmdProcess_Click (rsZ("CustomerID"))
// DoEvents
// rsZ.moveNext
// Loop
//.........这里部分代码省略.........
示例11: Update_Handheld
public void Update_Handheld()
{
int lQuantity = 0;
adoPrimaryRS = modRecordSet.getRS(ref "SELECT StockItem.StockItem_Name, " + modApplication.stTableName + ".Quantity, StockItem.StockItem_Quantity," + modApplication.stTableName + ".HandHeldID, StockTake.StockTake_Quantity, StockTake.StockTake_StockItemID FROM ((" + modApplication.stTableName + " INNER JOIN StockItem ON " + modApplication.stTableName + ".HandHeldID = StockItem.StockItemID) INNER JOIN StockGroup ON StockItem.StockItem_StockGroupID = StockGroup.StockGroupID) INNER JOIN (StockTake INNER JOIN Warehouse ON StockTake.StockTake_WarehouseID = Warehouse.WarehouseID) ON StockItem.StockItemID = StockTake.StockTake_StockItemID Where (((StockGroup.StockGroupID) < " + gID + ") And ((Warehouse.WarehouseID) = 2) And ((StockItem.StockItem_Disabled) = False) And ((StockItem.StockItem_Discontinued) = False)) ORDER BY StockItem.StockItem_Name");
//Set adoPrimaryRS = getRS("SELECT StockItem.StockItem_Name," & stTableName & ".Quantity,StockTake.StockTake_Quantity, StockTake.StockTake_StockItemID,StockItem.StockItem_Quantity,StockTake.StockTake_WarehouseID," & stTableName & ".HandHeldID FROM " & _
//' "(StockTake INNER JOIN StockItem ON StockTake.StockTake_StockItemID = StockItem.StockItemID) INNER JOIN " & stTableName & " ON StockItem.StockItemID = " & stTableName & ".HandHeldID WHERE StockTake.StockTake_WarehouseID = 2 AND StockItem.StockItem_Disabled=False AND StockItem.StockItem_Discontinued=False ORDER BY StockItem.StockItem_Name;")
if (adoPrimaryRS.RecordCount > 0) {
while (adoPrimaryRS.EOF == false) {
lQuantity = adoPrimaryRS.Fields("Quantity").Value;
modRecordSet.cnnDB.Execute("UPDATE StockTake SET StockTake.StockTake_Quantity = " + lQuantity + " WHERE (((StockTake.StockTake_StockItemID)=" + adoPrimaryRS.Fields("StockTake_StockItemID").Value + ") AND ((StockTake.StockTake_WarehouseID)=2));");
modRecordSet.cnnDB.Execute("UPDATE WarehouseStockItemLnk INNER JOIN StockTake ON (StockTake.StockTake_WarehouseID = WarehouseStockItemLnk.WarehouseStockItemLnk_WarehouseID) AND (WarehouseStockItemLnk.WarehouseStockItemLnk_StockItemID = StockTake.StockTake_StockItemID) SET WarehouseStockItemLnk.WarehouseStockItemLnk_Quantity = " + lQuantity + " WHERE (((StockTake.StockTake_StockItemID)=" + adoPrimaryRS.Fields("StockTake_StockItemID").Value + ") AND ((StockTake.StockTake_WarehouseID)=2));");
modRecordSet.cnnDB.Execute("UPDATE DayEndStockItemLnk INNER JOIN Company ON DayEndStockItemLnk.DayEndStockItemLnk_DayEndID = Company.Company_DayEndID SET DayEndStockItemLnk.DayEndStockItemLnk_QuantityShrink = [DayEndStockItemLnk]![DayEndStockItemLnk_QuantityShrink]-(" + lQuantity + ") WHERE (((DayEndStockItemLnk.DayEndStockItemLnk_StockItemID)=" + adoPrimaryRS.Fields("StockTake_StockItemID").Value + "));");
adoPrimaryRS.moveNext();
}
}
doDiskFlush();
}
示例12: frmBarcodeStockitem_Load
private void frmBarcodeStockitem_Load(System.Object eventSender, System.EventArgs eventArgs)
{
int x = 0;
string lOrder = null;
string sql = null;
string stSring = null;
ADODB.Recordset rsPrinter_B = new ADODB.Recordset();
Scripting.FileSystemObject fso = new Scripting.FileSystemObject();
TextBox tb = new TextBox();
txtSearch.AddRange(new TextBox[] {
_txtSearch_0,
_txtSearch_1,
_txtSearch_2,
_txtSearch_3,
_txtSearch_4
});
foreach (TextBox tb_loopVariable in txtSearch) {
tb = tb_loopVariable;
tb.TextChanged += txtSearch_TextChanged;
tb.Enter += txtSearch_Enter;
tb.KeyDown += txtSearch_KeyDown;
tb.KeyPress += txtSearch_KeyPress;
tb.Leave += txtSearch_Leave;
}
modBResolutions.ResizeForm(ref this, ref sizeConvertors.pixelToTwips(this.Width, true), ref sizeConvertors.pixelToTwips(this.Height, false), ref 0);
// ERROR: Not supported in C#: OnErrorStatement
//Doing shelf from file
if (modApplication.grvPrin) {
//rsPrinter_B.Close
rsPrinter_B.Open(modRecordSet.serverPath + "ShelfBarcode.dat");
//rsPrinter_B.filter = ""
//If frmBarcode._optBarcode_2.value = True Then rsPrinter_B.filter = "StockItem_SBarcode ='barcode'"
//If frmBarcode._optBarcode_1.value = True Then rsPrinter_B.filter = "StockItem_SBarcode ='shelf'"
if (My.MyProject.Forms.frmBarcode._optBarcode_2.Checked == true)
rsPrinter_B.filter = "StockItem_SBarcode = true";
if (My.MyProject.Forms.frmBarcode._optBarcode_1.Checked == true)
rsPrinter_B.filter = "StockItem_SShelf =true";
//If grvPrinType = 1 Then rsPrinter_B.filter = "StockItem_SBarcode ='shelf'"
modRecordSet.cnnDB.Execute("DELETE * FROM barcodePersonLnk");
while (!(rsPrinter_B.EOF)) {
//If its a shelf talker.....
if (My.MyProject.Forms.frmBarcode._optBarcode_1.Checked == true) {
sql = "INSERT INTO barcodePersonLnk ( barcodePersonLnk_PersonID, barcodePersonLnk_StockItemID, barcodePersonLnk_Shrink,barcodePersonLnk_PrintQTY ) ";
sql = sql + "SELECT theJoin.Person, theJoin.Catalogue_StockItemID, theJoin.Catalogue_Quantity , theJoin.PrinQTY FROM (SELECT Catalogue.Catalogue_StockItemID, Catalogue.Catalogue_Quantity, " + modRecordSet.gPersonID + " AS Person, 1 AS PrinQTY FROM Catalogue WHERE Catalogue.Catalogue_Quantity = 1 AND Catalogue_StockItemID = " + rsPrinter_B.Fields("GRVItem_StockItemID").Value + ") AS theJoin";
} else {
sql = "INSERT INTO barcodePersonLnk ( barcodePersonLnk_PersonID, barcodePersonLnk_StockItemID, barcodePersonLnk_Shrink,barcodePersonLnk_PrintQTY ) ";
sql = sql + "SELECT theJoin.Person, theJoin.Catalogue_StockItemID, theJoin.Catalogue_Quantity , theJoin.PrinQTY FROM (SELECT Catalogue.Catalogue_StockItemID, Catalogue.Catalogue_Quantity, " + modRecordSet.gPersonID + " AS Person, " + rsPrinter_B.Fields("GRVItem_Quantity").Value + " AS PrinQTY FROM Catalogue WHERE Catalogue.Catalogue_Quantity = 1 AND Catalogue_StockItemID = " + rsPrinter_B.Fields("GRVItem_StockItemID").Value + ") AS theJoin";
}
#if DEBUG
Debug.Print(sql);
#endif
modRecordSet.cnnDB.Execute(sql);
rsPrinter_B.moveNext();
}
} else {
modRecordSet.cnnDB.Execute("DELETE * FROM barcodePersonLnk");
sql = "INSERT INTO barcodePersonLnk ( barcodePersonLnk_PersonID, barcodePersonLnk_StockItemID, barcodePersonLnk_Shrink ) ";
sql = sql + "SELECT theJoin.Person, theJoin.Catalogue_StockItemID, theJoin.Catalogue_Quantity ";
sql = sql + "FROM (SELECT Catalogue.Catalogue_StockItemID, Catalogue.Catalogue_Quantity, " + modRecordSet.gPersonID + " AS Person FROM Catalogue) AS theJoin LEFT JOIN barcodePersonLnk ON (theJoin.Person = barcodePersonLnk.barcodePersonLnk_PersonID) AND (theJoin.Catalogue_Quantity = barcodePersonLnk.barcodePersonLnk_Shrink) AND (theJoin.Catalogue_StockItemID = barcodePersonLnk.barcodePersonLnk_StockItemID) WHERE (((barcodePersonLnk.barcodePersonLnk_PersonID) Is Null));";
modRecordSet.cnnDB.Execute(sql);
}
int lLeft = 0;
var _with3 = gridEdit;
_with3.Col = 7;
_with3.RowCount = 0;
System.Windows.Forms.Application.DoEvents();
_with3.RowCount = 2;
_with3.FixedRows = 1;
_with3.FixedCols = 0;
_with3.row = 0;
_with3.Col = 0;
_with3.CellFontBold = true;
_with3.Text = "Barcode";
_with3.set_ColWidth(0, 1400);
_with3.CellAlignment = 7;
_with3.Col = 1;
_with3.CellFontBold = true;
_with3.Text = "ID";
_with3.set_ColWidth(1, 800);
_with3.CellAlignment = 4;
_with3.Col = 2;
_with3.CellFontBold = true;
_with3.Text = "Stock Name";
_with3.set_ColWidth(2, 2000);
_with3.CellAlignment = 1;
_with3.Col = 3;
_with3.CellFontBold = true;
_with3.Text = "Supplier";
_with3.set_ColWidth(3, 2000);
_with3.CellAlignment = 1;
//.........这里部分代码省略.........
示例13: loadCompanies
private void loadCompanies()
{
ADODB.Recordset rs = new ADODB.Recordset();
System.Windows.Forms.ListViewItem lListitem = null;
rs.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
if (openConnection()) {
}
rs.Open("SELECT locationCompany.locationCompanyID, location.location_Name, locationCompany.locationCompany_Name, locationCompany.locationCompany_Path FROM location INNER JOIN locationCompany ON location.locationID = locationCompany.locationCompany_LocationID ORDER BY location.location_Name, locationCompany.locationCompany_Name;", cnnDBmaster, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic);
this.lvLocation.Items.Clear();
if (rs.RecordCount) {
while (!(rs.EOF)) {
lListitem = lvLocation.Items.Add("k" + rs.Fields("locationCompanyID").Value, rs.Fields("locationCompany_Name").Value, 2);
//UPGRADE_WARNING: Lower bound of collection lListitem has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
if (lListitem.SubItems.Count > 1) {
lListitem.SubItems[1].Text = rs.Fields("location_Name").Value + "";
} else {
lListitem.SubItems.Insert(1, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("location_Name").Value + ""));
}
if (lListitem.SubItems.Count > 2) {
lListitem.SubItems[2].Text = rs.Fields("locationCompany_Path").Value + "";
} else {
lListitem.SubItems.Insert(2, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("locationCompany_Path").Value + ""));
}
if (Strings.LCase(rs.Fields("locationCompany_Path").Value + "") == Strings.LCase(modRecordSet.serverPath + "pricing.mdb")) {
lListitem.Selected = true;
//lvLocation_DblClick
}
rs.moveNext();
}
}
}
示例14: cmdTransfer_Click
private void cmdTransfer_Click(System.Object eventSender, System.EventArgs eventArgs)
{
ADODB.Recordset rsID = default(ADODB.Recordset);
ADODB.Recordset rs = default(ADODB.Recordset);
short x = 0;
ADODB.Connection cn = default(ADODB.Connection);
ADODB.Recordset rsChk = default(ADODB.Recordset);
string errPosition = null;
int gID = 0;
decimal lQuantity = default(decimal);
// ERROR: Not supported in C#: OnErrorStatement
errPosition = "Start";
if (lvStockT.Items.Count > 0) {
errPosition = "1";
//cnnDB.Execute "INSERT INTO StockGroup (StockGroup_Name) VALUES ('HandheldWHTransfer')"
modApplication.stTableName = "HandheldWHTransfer";
//Set rj = getRS("SELECT StockGroup.StockGroupID, StockGroup.StockGroup_Name From StockGroup WHERE StockGroup.StockGroup_Name = 'HandheldWHTransfer';")
//gID = rj("StockGroupID")
errPosition = "2";
//'Multi Warehouse change
//cnnDB.Execute "UPDATE Company SET Company.Company_StockTakeDate = now();"
//cnnDB.Execute "DELETE FROM StockTake WHERE (StockTake_WarehouseID > 0)"
//cnnDB.Execute "INSERT INTO StockTake ( StockTake_StockItemID, StockTake_WarehouseID, StockTake_Quantity, StockTake_Adjustment ) SELECT WarehouseStockItemLnk.WarehouseStockItemLnk_StockItemID, WarehouseStockItemLnk.WarehouseStockItemLnk_WarehouseID, 0 AS quantity, 0 AS adjustment FROM WarehouseStockItemLnk;"
//cnnDB.Execute "UPDATE StockTake INNER JOIN WarehouseStockItemLnk ON (StockTake.StockTake_StockItemID = WarehouseStockItemLnk.WarehouseStockItemLnk_StockItemID) AND (StockTake.StockTake_WarehouseID = WarehouseStockItemLnk.WarehouseStockItemLnk_WarehouseID) SET StockTake.StockTake_Quantity = [WarehouseStockItemLnk]![WarehouseStockItemLnk_Quantity] WHERE (((WarehouseStockItemLnk.WarehouseStockItemLnk_WarehouseID)>0));"
//'Multi Warehouse change
//cnnDB.Execute "DELETE FROM StockTakeDeposit"
//cnnDB.Execute "INSERT INTO StockTakeDeposit ( StockTakeDeposit_WarehouseID, StockTakeDeposit_DepositID, StockTakeDeposit_DepositTypeID, StockTakeDeposit_Quantity, StockTakeDeposit_Adjustment ) SELECT WarehouseDepositItemLnk.WarehouseDepositItemLnk_WarehouseID, WarehouseDepositItemLnk.WarehouseDepositItemLnk_DepositID, WarehouseDepositItemLnk.WarehouseDepositItemLnk_DepositTypeID, WarehouseDepositItemLnk.WarehouseDepositItemLnk_Quantity, WarehouseDepositItemLnk.WarehouseDepositItemLnk_Quantity FROM WarehouseDepositItemLnk INNER JOIN DISPLAY_Deposits ON (DISPLAY_Deposits.type = WarehouseDepositItemLnk.WarehouseDepositItemLnk_DepositTypeID) AND (WarehouseDepositItemLnk.WarehouseDepositItemLnk_DepositID = DISPLAY_Deposits.DepositID) AND (WarehouseDepositItemLnk.WarehouseDepositItemLnk_WarehouseID = DISPLAY_Deposits.WarehouseID);"
//'Multi Warehouse change
//'snap shot
errPosition = "3";
//Warehouse From
adoPrimaryRS = modRecordSet.getRS(ref "SELECT * FROM " + modApplication.stTableName + " Where ((HandheldWHTransfer.WHouseID)=" + lWHA + ")");
//Set adoPrimaryRS = getRS("SELECT StockItem.StockItem_Name, " & stTableName & ".Quantity, StockItem.StockItem_Quantity," & stTableName & ".HandHeldID, StockTake.StockTake_Quantity, StockTake.StockTake_StockItemID FROM ((" & stTableName & " INNER JOIN StockItem ON " & stTableName & ".HandHeldID = StockItem.StockItemID) INNER JOIN StockGroup ON StockItem.StockItem_StockGroupID = StockGroup.StockGroupID) INNER JOIN (StockTake INNER JOIN Warehouse ON StockTake.StockTake_WarehouseID = Warehouse.WarehouseID) ON StockItem.StockItemID = StockTake.StockTake_StockItemID Where (((StockGroup.StockGroupID) < " & gID & ") And ((Warehouse.WarehouseID) = " & lWHA & ") AND ((HandheldWHTransfer.WHouseID)=" & lWHA & ")) ORDER BY StockItem.StockItem_Name")
if (adoPrimaryRS.RecordCount > 0) {
while (adoPrimaryRS.EOF == false) {
lQuantity = adoPrimaryRS.Fields("Quantity").Value;
//cnnDB.Execute "UPDATE StockTake SET StockTake.StockTake_Quantity = " & lQuantity & " WHERE (((StockTake.StockTake_StockItemID)=" & adoPrimaryRS("StockTake_StockItemID") & ") AND ((StockTake.StockTake_WarehouseID)=" & lWHA & "));"
//cnnDB.Execute "UPDATE WarehouseStockItemLnk INNER JOIN StockTake ON (StockTake.StockTake_WarehouseID = WarehouseStockItemLnk.WarehouseStockItemLnk_WarehouseID) AND (WarehouseStockItemLnk.WarehouseStockItemLnk_StockItemID = StockTake.StockTake_StockItemID) SET WarehouseStockItemLnk.WarehouseStockItemLnk_Quantity = [WarehouseStockItemLnk]![WarehouseStockItemLnk_Quantity]+(" & lQuantity & ") WHERE (((StockTake.StockTake_StockItemID)=" & adoPrimaryRS("StockTake_StockItemID") & ") AND ((StockTake.StockTake_WarehouseID)=" & lWHA & "));"
//cnnDB.Execute "UPDATE DayEndStockItemLnk INNER JOIN Company ON DayEndStockItemLnk.DayEndStockItemLnk_DayEndID = Company.Company_DayEndID SET DayEndStockItemLnk.DayEndStockItemLnk_QuantityShrink = [DayEndStockItemLnk]![DayEndStockItemLnk_QuantityShrink]-(" & lQuantity & ") WHERE (((DayEndStockItemLnk.DayEndStockItemLnk_StockItemID)=" & adoPrimaryRS("StockTake_StockItemID") & ") AND ((DayEndStockItemLnk.DayEndStockItemLnk_Warehouse)=" & lWHA & "));"
modRecordSet.cnnDB.Execute("UPDATE WarehouseStockItemLnk INNER JOIN " + modApplication.stTableName + " ON (" + modApplication.stTableName + ".WHouseID = WarehouseStockItemLnk.WarehouseStockItemLnk_WarehouseID) AND (WarehouseStockItemLnk.WarehouseStockItemLnk_StockItemID = " + modApplication.stTableName + ".HandHeldID) SET WarehouseStockItemLnk.WarehouseStockItemLnk_Quantity = [WarehouseStockItemLnk]![WarehouseStockItemLnk_Quantity]+(" + lQuantity + ") WHERE (((" + modApplication.stTableName + ".HandHeldID)=" + adoPrimaryRS.Fields("HandHeldID").Value + ") AND ((" + modApplication.stTableName + ".WHouseID)=" + lWHA + "));");
modRecordSet.cnnDB.Execute("UPDATE DayEndStockItemLnk INNER JOIN Company ON DayEndStockItemLnk.DayEndStockItemLnk_DayEndID = Company.Company_DayEndID SET DayEndStockItemLnk.DayEndStockItemLnk_QuantityTransafer = [DayEndStockItemLnk]![DayEndStockItemLnk_QuantityTransafer]+(" + lQuantity + ") WHERE (((DayEndStockItemLnk.DayEndStockItemLnk_StockItemID)=" + adoPrimaryRS.Fields("HandHeldID").Value + ") AND ((DayEndStockItemLnk.DayEndStockItemLnk_Warehouse)=" + lWHA + "));");
adoPrimaryRS.moveNext();
}
}
//Warehouse To
adoPrimaryRS = modRecordSet.getRS(ref "SELECT * FROM " + modApplication.stTableName + " Where ((HandheldWHTransfer.WHouseID)=" + lWHB + ")");
//Set adoPrimaryRS = getRS("SELECT StockItem.StockItem_Name, " & stTableName & ".Quantity, StockItem.StockItem_Quantity," & stTableName & ".HandHeldID, StockTake.StockTake_Quantity, StockTake.StockTake_StockItemID FROM ((" & stTableName & " INNER JOIN StockItem ON " & stTableName & ".HandHeldID = StockItem.StockItemID) INNER JOIN StockGroup ON StockItem.StockItem_StockGroupID = StockGroup.StockGroupID) INNER JOIN (StockTake INNER JOIN Warehouse ON StockTake.StockTake_WarehouseID = Warehouse.WarehouseID) ON StockItem.StockItemID = StockTake.StockTake_StockItemID Where (((StockGroup.StockGroupID) < " & gID & ") And ((Warehouse.WarehouseID) = " & lWHA & ") AND ((HandheldWHTransfer.WHouseID)=" & lWHB & ")) ORDER BY StockItem.StockItem_Name")
if (adoPrimaryRS.RecordCount > 0) {
while (adoPrimaryRS.EOF == false) {
lQuantity = adoPrimaryRS.Fields("Quantity").Value;
//cnnDB.Execute "UPDATE StockTake SET StockTake.StockTake_Quantity = " & lQuantity & " WHERE (((StockTake.StockTake_StockItemID)=" & adoPrimaryRS("StockTake_StockItemID") & ") AND ((StockTake.StockTake_WarehouseID)=" & lWHB & "));"
//cnnDB.Execute "UPDATE WarehouseStockItemLnk INNER JOIN StockTake ON (StockTake.StockTake_WarehouseID = WarehouseStockItemLnk.WarehouseStockItemLnk_WarehouseID) AND (WarehouseStockItemLnk.WarehouseStockItemLnk_StockItemID = StockTake.StockTake_StockItemID) SET WarehouseStockItemLnk.WarehouseStockItemLnk_Quantity = [WarehouseStockItemLnk]![WarehouseStockItemLnk_Quantity]+(" & lQuantity & ") WHERE (((StockTake.StockTake_StockItemID)=" & adoPrimaryRS("StockTake_StockItemID") & ") AND ((StockTake.StockTake_WarehouseID)=" & lWHB & "));"
//cnnDB.Execute "UPDATE DayEndStockItemLnk INNER JOIN Company ON DayEndStockItemLnk.DayEndStockItemLnk_DayEndID = Company.Company_DayEndID SET DayEndStockItemLnk.DayEndStockItemLnk_QuantityShrink = [DayEndStockItemLnk]![DayEndStockItemLnk_QuantityShrink]-(" & lQuantity & ") WHERE (((DayEndStockItemLnk.DayEndStockItemLnk_StockItemID)=" & adoPrimaryRS("StockTake_StockItemID") & ") AND ((DayEndStockItemLnk.DayEndStockItemLnk_Warehouse)=" & lWHB & "));"
modRecordSet.cnnDB.Execute("INSERT INTO StockTransferWH ( StockTransferWH_Date, StockTransferWH_DayEndID, StockTransferWH_PersonID, StockTransferWH_WHFrom, StockTransferWH_WHTo, StockTransferWH_StockItemID, StockTransferWH_Qty ) SELECT Now() AS [date], Company.Company_DayEndID, " + My.MyProject.Forms.frmMenu.lblUser.Tag + ", " + lWHA + ", " + lWHB + ", " + adoPrimaryRS.Fields("HandHeldID").Value + ", " + adoPrimaryRS.Fields("Quantity").Value + " FROM Company;");
modRecordSet.cnnDB.Execute("UPDATE WarehouseStockItemLnk INNER JOIN " + modApplication.stTableName + " ON (" + modApplication.stTableName + ".WHouseID = WarehouseStockItemLnk.WarehouseStockItemLnk_WarehouseID) AND (WarehouseStockItemLnk.WarehouseStockItemLnk_StockItemID = " + modApplication.stTableName + ".HandHeldID) SET WarehouseStockItemLnk.WarehouseStockItemLnk_Quantity = [WarehouseStockItemLnk]![WarehouseStockItemLnk_Quantity]+(" + lQuantity + ") WHERE (((" + modApplication.stTableName + ".HandHeldID)=" + adoPrimaryRS.Fields("HandHeldID").Value + ") AND ((" + modApplication.stTableName + ".WHouseID)=" + lWHB + "));");
modRecordSet.cnnDB.Execute("UPDATE DayEndStockItemLnk INNER JOIN Company ON DayEndStockItemLnk.DayEndStockItemLnk_DayEndID = Company.Company_DayEndID SET DayEndStockItemLnk.DayEndStockItemLnk_QuantityTransafer = [DayEndStockItemLnk]![DayEndStockItemLnk_QuantityTransafer]+(" + lQuantity + ") WHERE (((DayEndStockItemLnk.DayEndStockItemLnk_StockItemID)=" + adoPrimaryRS.Fields("HandHeldID").Value + ") AND ((DayEndStockItemLnk.DayEndStockItemLnk_Warehouse)=" + lWHB + "));");
adoPrimaryRS.moveNext();
}
}
errPosition = "4";
report_WHTransfer();
modRecordSet.cnnDB.Execute("DROP TABLE HandheldWHTransfer");
//cnnDB.Execute "DELETE * FROM StockGroup WHERE StockGroup_Name ='HandheldWHTransfer'"
Interaction.MsgBox("Stock Transfer process has been completed.", MsgBoxStyle.Information + MsgBoxStyle.OkOnly + MsgBoxStyle.DefaultButton2, "Completed");
this.Close();
} else {
}
return;
ErrTransfer:
Interaction.MsgBox("Error at position no. " + errPosition + " Err Number " + Err().Number + " " + Err().Description);
// ERROR: Not supported in C#: ResumeStatement
}
示例15: cmdsearch_Click_Alloc
//.........这里部分代码省略.........
}
}
} else if (rs.Fields("TransactionType_Name").Value == "Invoice") {
if ((Information.IsDBNull(rs.Fields("debit").Value) ? 0 : rs.Fields("debit").Value) == rs.Fields("CustomerTransaction_Allocated").Value & (Information.IsDBNull(rs.Fields("credit").Value) ? 0 : rs.Fields("credit").Value) == 0) {
//Else
lvItemAlloc = lvTransAlloc.Items.Add("K" + rs.Fields("CustomerTransactionID").Value + "_" + databaseName + "_" + rs.Fields("CustomerTransaction_ReferenceID").Value + "_" + rs.Fields("CustomerTransaction_TransactionTypeID").Value, Strings.Format(rs.Fields("CustomerTransaction_Date").Value, "yyyy mmm dd hh:mm"), "");
if (lvItemAlloc.SubItems.Count > 1) {
lvItemAlloc.SubItems[1].Text = rs.Fields("CustomerTransaction_Reference").Value;
} else {
lvItemAlloc.SubItems.Insert(1, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("CustomerTransaction_Reference").Value));
}
if (lvItemAlloc.SubItems.Count > 2) {
lvItemAlloc.SubItems[2].Text = rs.Fields("TransactionType_Name").Value;
} else {
lvItemAlloc.SubItems.Insert(2, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("TransactionType_Name").Value));
}
if (lvItemAlloc.SubItems.Count > 3) {
lvItemAlloc.SubItems[3].Text = Strings.FormatNumber(rs.Fields("debit").Value, 4);
} else {
lvItemAlloc.SubItems.Insert(3, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("debit").Value, 4)));
}
if (lvItemAlloc.SubItems.Count > 4) {
lvItemAlloc.SubItems[4].Text = Strings.FormatNumber(rs.Fields("credit").Value, 4);
} else {
lvItemAlloc.SubItems.Insert(4, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("credit").Value, 4)));
}
if (lvItemAlloc.SubItems.Count > 5) {
lvItemAlloc.SubItems[5].Text = Strings.FormatNumber(rs.Fields("CustomerTransaction_Allocated").Value, 4);
} else {
lvItemAlloc.SubItems.Insert(5, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("CustomerTransaction_Allocated").Value, 4)));
}
}
} else if (rs.Fields("TransactionType_Name").Value == "Interest") {
if ((Information.IsDBNull(rs.Fields("debit").Value) ? 0 : rs.Fields("debit").Value) == rs.Fields("CustomerTransaction_Allocated").Value & (Information.IsDBNull(rs.Fields("credit").Value) ? 0 : rs.Fields("credit").Value) == 0) {
//Else
lvItemAlloc = lvTransAlloc.Items.Add("K" + rs.Fields("CustomerTransactionID").Value + "_" + databaseName + "_" + rs.Fields("CustomerTransaction_ReferenceID").Value + "_" + rs.Fields("CustomerTransaction_TransactionTypeID").Value, Strings.Format(rs.Fields("CustomerTransaction_Date").Value, "yyyy mmm dd hh:mm"), "");
if (lvItemAlloc.SubItems.Count > 1) {
lvItemAlloc.SubItems[1].Text = rs.Fields("CustomerTransaction_Reference").Value;
} else {
lvItemAlloc.SubItems.Insert(1, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("CustomerTransaction_Reference").Value));
}
if (lvItemAlloc.SubItems.Count > 2) {
lvItemAlloc.SubItems[2].Text = rs.Fields("TransactionType_Name").Value;
} else {
lvItemAlloc.SubItems.Insert(2, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("TransactionType_Name").Value));
}
if (lvItemAlloc.SubItems.Count > 3) {
lvItemAlloc.SubItems[3].Text = Strings.FormatNumber(rs.Fields("debit").Value, 4);
} else {
lvItemAlloc.SubItems.Insert(3, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("debit").Value, 4)));
}
if (lvItemAlloc.SubItems.Count > 4) {
lvItemAlloc.SubItems[4].Text = Strings.FormatNumber(rs.Fields("credit").Value, 4);
} else {
lvItemAlloc.SubItems.Insert(4, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("credit").Value, 4)));
}
if (lvItemAlloc.SubItems.Count > 5) {
lvItemAlloc.SubItems[5].Text = Strings.FormatNumber(rs.Fields("CustomerTransaction_Allocated").Value, 4);
} else {
lvItemAlloc.SubItems.Insert(5, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("CustomerTransaction_Allocated").Value, 4)));
}
}
} else if (rs.Fields("TransactionType_Name").Value == "Debit Journal") {
if ((Information.IsDBNull(rs.Fields("debit").Value) ? 0 : rs.Fields("debit").Value) == rs.Fields("CustomerTransaction_Allocated").Value) {
//Else
lvItemAlloc = lvTransAlloc.Items.Add("K" + rs.Fields("CustomerTransactionID").Value + "_" + databaseName + "_" + rs.Fields("CustomerTransaction_ReferenceID").Value + "_" + rs.Fields("CustomerTransaction_TransactionTypeID").Value, Strings.Format(rs.Fields("CustomerTransaction_Date").Value, "yyyy mmm dd hh:mm"), "");
if (lvItemAlloc.SubItems.Count > 1) {
lvItemAlloc.SubItems[1].Text = rs.Fields("CustomerTransaction_Reference").Value;
} else {
lvItemAlloc.SubItems.Insert(1, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("CustomerTransaction_Reference").Value));
}
if (lvItemAlloc.SubItems.Count > 2) {
lvItemAlloc.SubItems[2].Text = rs.Fields("TransactionType_Name").Value;
} else {
lvItemAlloc.SubItems.Insert(2, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("TransactionType_Name").Value));
}
if (lvItemAlloc.SubItems.Count > 3) {
lvItemAlloc.SubItems[3].Text = Strings.FormatNumber(rs.Fields("debit").Value, 4);
} else {
lvItemAlloc.SubItems.Insert(3, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("debit").Value, 4)));
}
if (lvItemAlloc.SubItems.Count > 4) {
lvItemAlloc.SubItems[4].Text = Strings.FormatNumber(rs.Fields("credit").Value, 4);
} else {
lvItemAlloc.SubItems.Insert(4, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("credit").Value, 4)));
}
if (lvItemAlloc.SubItems.Count > 5) {
lvItemAlloc.SubItems[5].Text = Strings.FormatNumber(rs.Fields("CustomerTransaction_Allocated").Value, 4);
} else {
lvItemAlloc.SubItems.Insert(5, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("CustomerTransaction_Allocated").Value, 4)));
}
}
}
rs.moveNext();
}
lvTransAlloc.Visible = true;
//lvTransAlloc.Refresh
Cursor = System.Windows.Forms.Cursors.Default;
gLoading = false;
}