private void deleteCurrentRow() { bool isFound = false; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { ///thurein if ((dt.Rows[i][0].ToString() == GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 0].ToString()) && (dt.Rows[i][1].ToString() == GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 1].ToString()) && (dt.Rows[i][2].ToString() == GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 2].ToString()) && !isFound) { //subtract from summary table //CalculateSummaryTable(dg_stock[dg_stock.CurrentCell.RowNumber, 0].ToString(), dg_stock[dg_stock.CurrentCell.RowNumber, 1].ToString(), "-" + dg_stock[dg_stock.CurrentCell.RowNumber, 2].ToString(), dg_stock[dg_stock.CurrentCell.RowNumber, 3].ToString()); // DeleteToSummaryTable(GrdAddline[GrdAddline.CurrentCell.RowNumber, 0].ToString(), GrdAddline[GrdAddline.CurrentCell.RowNumber, 1].ToString(), "-" + GrdAddline[GrdAddline.CurrentCell.RowNumber, 2].ToString(), GrdAddline[GrdAddline.CurrentCell.RowNumber, 3].ToString()); //addToSummaryTable(dg_stock[dg_stock.CurrentCell.RowNumber, 0].ToString(), dg_stock[dg_stock.CurrentCell.RowNumber, 1].ToString(), "-" + dg_stock[dg_stock.CurrentCell.RowNumber, 2].ToString()); CompactSQL comsql = new CompactSQL(); comsql.deleteRecordLine("ChangeSize", Convert.ToInt32(GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 8].ToString().Trim())); dt.Rows.RemoveAt(i); dl_array.RemoveAt(i); isFound = true; } } } }
private void deleteCurrentRow() { bool isFound = false; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //if ((dt.Rows[i][0].ToString() == GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 0].ToString()) && // (dt.Rows[i][1].ToString() == GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 1].ToString()) && // (dt.Rows[i][2].ToString() == GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 2].ToString()) && // (dt.Rows[i][3].ToString() == GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 3].ToString()) && // (dt.Rows[i][5].ToString() == GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 4].ToString()) && // !isFound) if ((dt.Rows[i][6].ToString() == GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 6].ToString()) && !isFound) { CompactSQL comsql = new CompactSQL(); comsql.deleteRecordLine("DailyLoss", Convert.ToInt32(GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 6].ToString().Trim())); dt.Rows.RemoveAt(i); array_daily.RemoveAt(i); getdata = comsql.SelectRecord("DailyLoss"); GetSQLData(getdata); isFound = true; } } } }
private void deleteCurrentRow() { bool isFound = false; if (tableJournal.Rows.Count > 0) { for (int i = 0; i < tableJournal.Rows.Count; i++) { ///thurein if ((tableJournal.Rows[i][0].ToString() == GrdTO[GrdTO.CurrentCell.RowNumber, 0].ToString()) && (tableJournal.Rows[i][1].ToString() == GrdTO[GrdTO.CurrentCell.RowNumber, 1].ToString()) && (tableJournal.Rows[i][2].ToString() == GrdTO[GrdTO.CurrentCell.RowNumber, 2].ToString()) && !isFound) { //subtract from summary table //CalculateSummaryTable(dg_stock[dg_stock.CurrentCell.RowNumber, 0].ToString(), dg_stock[dg_stock.CurrentCell.RowNumber, 1].ToString(), "-" + dg_stock[dg_stock.CurrentCell.RowNumber, 2].ToString(), dg_stock[dg_stock.CurrentCell.RowNumber, 3].ToString()); // DeleteToSummaryTable(GrdAddline[GrdAddline.CurrentCell.RowNumber, 0].ToString(), GrdAddline[GrdAddline.CurrentCell.RowNumber, 1].ToString(), "-" + GrdAddline[GrdAddline.CurrentCell.RowNumber, 2].ToString(), GrdAddline[GrdAddline.CurrentCell.RowNumber, 3].ToString()); //addToSummaryTable(dg_stock[dg_stock.CurrentCell.RowNumber, 0].ToString(), dg_stock[dg_stock.CurrentCell.RowNumber, 1].ToString(), "-" + dg_stock[dg_stock.CurrentCell.RowNumber, 2].ToString()); CompactSQL comsql = new CompactSQL(); comsql.deleteRecordLine("ItemReclass", Convert.ToInt32(GrdTO[GrdTO.CurrentCell.RowNumber, 7].ToString().Trim())); tableJournal.Rows.RemoveAt(i); //string aaaaa = GrdTO[GrdTO.CurrentCell.RowNumber, 7].ToString(); journalarray.RemoveAt(i); isFound = true; } } } }
private void deleteCurrentRow() { bool isFound = false; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { if ((dt.Rows[i][0].ToString() == GrdPO[GrdPO.CurrentCell.RowNumber, 0].ToString()) && (dt.Rows[i][1].ToString() == GrdPO[GrdPO.CurrentCell.RowNumber, 1].ToString()) && (dt.Rows[i][2].ToString() == GrdPO[GrdPO.CurrentCell.RowNumber, 2].ToString()) && !isFound) { //int tt = Convert.ToInt32(GrdPO[GrdPO.CurrentCell.RowNumber, 4].ToString().Trim()); CompactSQL comsql = new CompactSQL(); comsql.deleteRecordLine("PurchaseOrder", Convert.ToInt32(GrdPO[GrdPO.CurrentCell.RowNumber, 4].ToString().Trim())); dt.Rows.RemoveAt(i); PoArray.RemoveAt(i); isFound = true; } } } }
private void deleteCurrentRow() { bool isFound = false; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { if ((dt.Rows[i][0].ToString() == dgGRNLine[dgGRNLine.CurrentCell.RowNumber, 0].ToString()) && (dt.Rows[i][1].ToString() == dgGRNLine[dgGRNLine.CurrentCell.RowNumber, 1].ToString()) && (dt.Rows[i][2].ToString() == dgGRNLine[dgGRNLine.CurrentCell.RowNumber, 2].ToString()) && !isFound) { CompactSQL comsql = new CompactSQL(); comsql.deleteRecordLine("StockTakeEntry", Convert.ToInt32(dgGRNLine[dgGRNLine.CurrentCell.RowNumber, 6].ToString().Trim())); dt.Rows.RemoveAt(i); stmod.RemoveAt(i); isFound = true; } } } }
private void MnuNewGRN_Click(object sender, EventArgs e) { try { if (dgGRNLine.DataSource == null) { MessageBox.Show("Please scan the item first!"); } else { Cursor.Current = Cursors.WaitCursor; try { qhStockTakeWS.StockTakeWS_Service qhserv = new QHMobile.qhStockTakeWS.StockTakeWS_Service(); qhserv.Url = WebServiceInstants.GetURL(ServiceType.StockTakeWS); qhserv.Credentials = nc; CurrencyManager cm = (CurrencyManager)this.BindingContext[dgGRNLine.DataSource]; DataView dv = (DataView)cm.List; qhStockTakeWS.StockTakeWS[] stock_list = new qhStockTakeWS.StockTakeWS[dv.Count]; QH_Functions.QH_Functions qhfun = new QHMobile.QH_Functions.QH_Functions(); qhfun.Url = WebServiceInstants.GetURL(ServiceType.QH_Functions); qhfun.Credentials = nc; for (int i = 0; i < dv.Count; i++) { qhStockTakeWS.StockTakeWS updatestock = new QHMobile.qhStockTakeWS.StockTakeWS(); updatestock.Stock_take_Code = "1"; updatestock.Item_No = stmod[i].ItemNo; updatestock.BinCode = stmod[i].binNo; updatestock.Stock_take_QuantitySpecified = true; updatestock.Stock_take_Quantity = stmod[i].qty; updatestock.Stock_take_DateSpecified = true; updatestock.Stock_take_Date = stmod[i].postDate; updatestock.Staff_Dimension_Code = staffdim; updatestock.Entry_DateSpecified = true; updatestock.Entry_Date = stmod[i].entryDate; updatestock.Registered_DateSpecified = true; updatestock.Registered_Date = stmod[i].entryDate; updatestock.Message = "Items not in Phys. Invty Jnl"; updatestock.Location_Code = stmod[i].loc; updatestock.Category = stmod[i].category; updatestock.Skip_Auto_NumberSpecified = false; updatestock.Skip_Auto_Number = false; qhserv.Create(ref updatestock); //deleteRecordLine CompactSQL comsql = new CompactSQL(); comsql.deleteRecordLine("StockTakeEntry", stmod[i].lineno); } //qhserv.CreateMultiple(ref stock_list); //CompactSQL comsql = new CompactSQL(); //comsql.deleteRecord("StockTakeEntry"); Cursor.Current = Cursors.Default; MessageBox.Show("Submitted!"); this.Close(); StockTake st = new StockTake(uname, staffdim, ulevel); st.Show(); } catch (Exception ex) { Cursor.Current = Cursors.Default; MessageBox.Show("Error" + ex); this.Close(); StockTake st = new StockTake(uname, staffdim, ulevel); st.Show(); } } }catch (Exception ex) { MessageBox.Show("Error" + ex); } }