public void Update(ref QHEmptyTank QHEmptyTank) { object[] results = this.Invoke("Update", new object[] { QHEmptyTank }); QHEmptyTank = ((QHEmptyTank)(results[0])); }
/// <remarks/> public void EndUpdate(System.IAsyncResult asyncResult, out QHEmptyTank QHEmptyTank) { object[] results = this.EndInvoke(asyncResult); QHEmptyTank = ((QHEmptyTank)(results[0])); }
/// <remarks/> public System.IAsyncResult BeginUpdate(QHEmptyTank QHEmptyTank, System.AsyncCallback callback, object asyncState) { return(this.BeginInvoke("Update", new object[] { QHEmptyTank }, callback, asyncState)); }
private void menuItem1_Click(object sender, EventArgs e) { if (GrdDailyLoss == null) { MessageBox.Show("There is no record to register!"); } else { Cursor.Current = Cursors.WaitCursor; try { decimal countotal = 0; bool flagtemp = false; string itemtemp; string locationtemp; string bincodetemp; ItemJournalDailyLossQH.ItemJournalDailyLossQH_Service dlservice = new QHMobile.ItemJournalDailyLossQH.ItemJournalDailyLossQH_Service(); dlservice.Url = WebServiceInstants.GetURL(ServiceType.ItemJournalDailyLossQH); dlservice.Credentials = nc; QHSalesReceivableSetup.QHSalesReceivableSetup_Service qhsalesev = new QHMobile.QHSalesReceivableSetup.QHSalesReceivableSetup_Service(); qhsalesev.Credentials = nc; qhsalesev.Url = WebServiceInstants.GetURL(ServiceType.QHSalesReceivableSetup); QHSalesReceivableSetup.QHSalesReceivableSetup[] qhsaleGet = qhsalesev.ReadMultiple(null, null, 0); for (int i = 0; i < dl_array.Count; i++) { ItemJournalDailyLossQH.ItemJournalDailyLossQH dl = new QHMobile.ItemJournalDailyLossQH.ItemJournalDailyLossQH(); dlservice.Create(qhsaleGet[0].Change_Size_Batch, ref dl); // Actual value should be DOA dl.Posting_Date = DateTime.Now; if (dl_array[i].entrytype.Equals("Positive Adjmt.")) { dl.Entry_Type = ItemJournalDailyLossQH.Entry_Type.Positive_Adjmt; } else if (dl_array[i].entrytype.Equals("Negative Adjmt.")) { dl.Entry_Type = ItemJournalDailyLossQH.Entry_Type.Negative_Adjmt; } dl.Entry_TypeSpecified = true; dl.Item_No = dl_array[i].itemno; dl.Quantity = Convert.ToInt32(dl_array[i].quantity); dl.Location_Code = dl_array[i].location; //dl.Posting_Date = dl_array[i].postdate; dl.Staff_Dimension_Code = staffdim; dl.Bin_Code = dl_array[i].bincode; dlservice.Update(qhsaleGet[0].Change_Size_Batch, ref dl); } //// to adjust //// ArrayList tnk = new ArrayList(); for (int i = 0; i < dl_array.Count; i++) { if ((dl_array[i].EmptyTank == true) && (dl_array[i].entrytype.Equals("Negative Adjmt."))) { if (i == 0) { tnk.Add(dl_array[i].bincode); } else { if (!tnk.Contains(dl_array[i].bincode)) { tnk.Add(dl_array[i].bincode); } } } } for (int j = 0; j < tnk.Count; j++) { countotal = 0; flagtemp = false; itemtemp = ""; locationtemp = ""; bincodetemp = ""; for (int k = 0; k < dl_array.Count; k++) { if ((dl_array[k].EmptyTank == true) && (dl_array[k].entrytype.Equals("Negative Adjmt."))) { if (tnk[j].ToString().Equals(dl_array[k].bincode)) { itemtemp = dl_array[k].itemno; countotal = countotal + Convert.ToDecimal(dl_array[k].quantity); locationtemp = dl_array[k].location; bincodetemp = dl_array[k].bincode; if (dl_array[k].EmptyTank == true) { flagtemp = true; } } } } //QHBinContent.QHBinContent_Service qhsev = new QHMobile.QHBinContent.QHBinContent_Service(); //qhsev.Credentials = nc; //qhsev.Url = WebServiceInstants.GetURL(ServiceType.QHBinContent); //List<QHBinContent.QHBinContent_Filter> filterArr = new List<QHMobile.QHBinContent.QHBinContent_Filter>(); //QHBinContent.QHBinContent_Filter binfilter = new QHMobile.QHBinContent.QHBinContent_Filter(); //binfilter.Field = QHMobile.QHBinContent.QHBinContent_Fields.Bin_Code; //binfilter.Criteria = bincodetemp; ////QHBinContent.QHBinContent_Filter Qtyfilter = new QHMobile.QHBinContent.QHBinContent_Filter(); ////Qtyfilter.Field = QHMobile.QHBinContent.QHBinContent_Fields.Quantity_Base; ////Qtyfilter.Criteria = "<>0"; //QHBinContent.QHBinContent_Filter itemFilter = new QHMobile.QHBinContent.QHBinContent_Filter(); //itemFilter.Field = QHMobile.QHBinContent.QHBinContent_Fields.Item_No; //itemFilter.Criteria = itemtemp; //filterArr.Add(binfilter); ////filterArr.Add(Qtyfilter); //filterArr.Add(itemFilter); //QHBinContent.QHBinContent[] qhbincon = qhsev.ReadMultiple(filterArr.ToArray(), null, 5); if (flagtemp == true) //qhbincon[0].Quantity_Base < countotal || { // qhfun.TankAdj_NAV(itemtemp, packworksheet, locationtemp, bincodetemp, countotal, flagtemp); //qhfun.TankAdj_NAV(itemtemp, packworksheet, locationtemp, bincodetemp, countotal); QHEmptyTank.QHEmptyTank_Service qhempty = new QHMobile.QHEmptyTank.QHEmptyTank_Service(); qhempty.Url = WebServiceInstants.GetURL(ServiceType.QHEmptyTank); qhempty.Credentials = nc; QHEmptyTank.QHEmptyTank qhcheck = qhempty.Read(bincodetemp); if (qhcheck == null) { QHEmptyTank.QHEmptyTank qhtnk = new QHMobile.QHEmptyTank.QHEmptyTank(); qhtnk.Bin_Code = bincodetemp; qhempty.Create(ref qhtnk); qhtnk.Batch_Name = qhsaleGet[0].Change_Size_Batch; qhtnk.Item_No = itemtemp; qhtnk.Location_Code = locationtemp; qhempty.Update(ref qhtnk); } } //else if (qhbincon[0].Quantity - qhbincon[0].PDA_Inv_Pick_Quantity < countotal) //{ // QH_Functions.QH_Functions qhfun = new QHMobile.QH_Functions.QH_Functions(); // qhfun.Url = WebServiceInstants.GetURL(ServiceType.QH_Functions); // qhfun.Credentials = nc; // decimal updatecount = countotal - (qhbincon[0].Quantity - qhbincon[0].PDA_Inv_Pick_Quantity); // qhfun.InsertIJLPositiveAdjustment(itemtemp, "", locationtemp, bincodetemp, updatecount); // //qhfun.TankAdj_NAV(itemtemp, "", locationtemp, bincodetemp, countotal, flagtemp); //} } //// to adjust //// CompactSQL comsql = new CompactSQL(); comsql.deleteRecord("ChangeSize"); MessageBox.Show("Submitted."); this.Close(); DailyLossTS dilts = new DailyLossTS(staffname, staffdim, stafflevel); dilts.Show(); } catch (Exception ex) { MessageBox.Show("Error:" + ex); } Cursor.Current = Cursors.Default; //DailyLossTS dts = new DailyLossTS(staffname, staffdim, stafflevel); } }
private void menuItem1_Click(object sender, EventArgs e) { if (GrdDailyLoss.DataSource == null) { MessageBox.Show("There is no record to register!"); } else { Cursor.Current = Cursors.WaitCursor; try { decimal countotal = 0; bool flagtemp = false; string itemtemp; string locationtemp; string bincodetemp; ItemJournalDailyLossQH.ItemJournalDailyLossQH_Service dlservice = new QHMobile.ItemJournalDailyLossQH.ItemJournalDailyLossQH_Service(); dlservice.Url = WebServiceInstants.GetURL(ServiceType.ItemJournalDailyLossQH); dlservice.Credentials = nc; for (int i = 0; i < array_daily.Count; i++) { if (array_daily[i].lineNum.Equals("") || array_daily[i].lineNum == 0) { ItemJournalDailyLossQH.ItemJournalDailyLossQH dl = new QHMobile.ItemJournalDailyLossQH.ItemJournalDailyLossQH(); dlservice.Create("DOA", ref dl); // Actual value should be DOA ItemJournalDailyLossQH.ItemJournalDailyLossQH dlupdate = new QHMobile.ItemJournalDailyLossQH.ItemJournalDailyLossQH(); dlupdate = dlservice.Read("DOA", dl.Line_No); //added by Hsu 23 april 2013// array_daily[i].lineNum = dl.Line_No; // added by Hsu 23 april 2013 // dlupdate.Posting_Date = Convert.ToDateTime(array_daily[i].postingDate); dlupdate.Posting_DateSpecified = true; dlupdate.Entry_Type = ItemJournalDailyLossQH.Entry_Type.Negative_Adjmt; dlupdate.Entry_TypeSpecified = true; dlupdate.Item_No = array_daily[i].itemno; st = DateTime.Now.ToString("ddMMyyyy"); dlupdate.Document_No = st; //dlservice.Update("DOA", ref dlupdate); dlupdate.Quantity = Convert.ToInt32(array_daily[i].quantity); dlupdate.Location_Code = array_daily[i].location; dlupdate.Staff_Dimension_Code = staffdim; dlupdate.Bin_Code = array_daily[i].bincode; dlservice.Update("DOA", ref dlupdate); //array_daily.RemoveAt(i); } CompactSQL comsql = new CompactSQL(); comsql.DeleteOneRecord(array_daily[i].sqlLineNum, "DailyLoss"); } //// to adjust //// ArrayList tnk = new ArrayList(); for (int i = 0; i < array_daily.Count; i++) { if (i == 0) { tnk.Add(array_daily[i].bincode); } else { if (!tnk.Contains(array_daily[i].bincode)) { tnk.Add(array_daily[i].bincode); } } } for (int j = 0; j < tnk.Count; j++) { countotal = 0; flagtemp = false; itemtemp = ""; locationtemp = ""; bincodetemp = ""; for (int k = 0; k < array_daily.Count; k++) { if (tnk[j].ToString().Equals(array_daily[k].bincode)) { itemtemp = array_daily[k].itemno; countotal = countotal + Convert.ToDecimal(array_daily[k].quantity); locationtemp = array_daily[k].location; bincodetemp = array_daily[k].bincode; if (array_daily[k].emptyTank == true) { flagtemp = true; } } } if (flagtemp == true) //qhbincon[0].Quantity_Base < countotal || { QHEmptyTank.QHEmptyTank_Service qhempty = new QHMobile.QHEmptyTank.QHEmptyTank_Service(); qhempty.Url = WebServiceInstants.GetURL(ServiceType.QHEmptyTank); qhempty.Credentials = nc; QHEmptyTank.QHEmptyTank qhcheck = qhempty.Read(bincodetemp); if (qhcheck == null) { QHEmptyTank.QHEmptyTank qhtnk = new QHMobile.QHEmptyTank.QHEmptyTank(); qhtnk.Bin_Code = bincodetemp; qhempty.Create(ref qhtnk); qhtnk.Batch_Name = "DOA"; qhtnk.Item_No = itemtemp; qhtnk.Location_Code = locationtemp; qhempty.Update(ref qhtnk); } } } //// to adjsut //// //CompactSQL comsql = new CompactSQL(); //comsql.deleteRecord("DailyLoss"); MessageBox.Show("Submitted."); Cursor.Current = Cursors.Default; GrdDailyLoss.DataSource = null; this.Close(); DailyLoss dlf = new DailyLoss(username, staffdim, userlevel); dlf.Show(); } catch (Exception ex) { MessageBox.Show("Error:" + ex); Cursor.Current = Cursors.Default; } } }
private void menuItem2_Click(object sender, EventArgs e) { if (GrdTO == null) { MessageBox.Show("There is no record to register!"); } else { Cursor.Current = Cursors.WaitCursor; try { ItemJournalQH.ItemJournalQH_Service journalService = new QHMobile.ItemJournalQH.ItemJournalQH_Service(); journalService.Url = WebServiceInstants.GetURL(ServiceType.ItemJournalQH); journalService.Credentials = nc; for (int i = 0; i < journalarray.Count; i++) { ItemJournalQH.ItemJournalQH journal = new QHMobile.ItemJournalQH.ItemJournalQH(); journalService.Create("DEFAULT", ref journal); journal.Document_Date = journalarray[i].postingDate; journal.Document_DateSpecified = true; journal.Posting_Date = journalarray[i].postingDate; journalService.Update("DEFAULT", ref journal); journal.Item_No = journalarray[i].ItemNo; journal.Location_Code = journalarray[i].location; journal.Bin_Code = journalarray[i].frombin; journal.New_Location_Code = journalarray[i].location; journal.New_Bin_Code = journalarray[i].tobin; journal.Quantity = journalarray[i].quantity; journal.Staff_Dimension_Code = journalarray[i].staffdimension; journalService.Update("DEFAULT", ref journal); } ArrayList tnk = new ArrayList(); for (int i = 0; i < journalarray.Count; i++) { if (i == 0) { tnk.Add(journalarray[i].frombin); } else { if (!tnk.Contains(journalarray[i].frombin)) { tnk.Add(journalarray[i].frombin); } } } decimal countotal = 0; bool flagtemp = false; string itemtemp; string locationtemp; string bincodetemp; for (int j = 0; j < tnk.Count; j++) { countotal = 0; flagtemp = false; itemtemp = ""; locationtemp = ""; bincodetemp = ""; for (int k = 0; k < journalarray.Count; k++) { if (tnk[j].ToString().Equals(journalarray[k].frombin)) { itemtemp = journalarray[k].ItemNo; countotal = countotal + Convert.ToDecimal(journalarray[k].quantity); locationtemp = journalarray[k].location; bincodetemp = journalarray[k].frombin; if (journalarray[k].emptyBin == true) { flagtemp = true; } } } if (flagtemp == true) //qhbincon[0].Quantity_Base < countotal || { QHEmptyTank.QHEmptyTank_Service qhempty = new QHMobile.QHEmptyTank.QHEmptyTank_Service(); qhempty.Url = WebServiceInstants.GetURL(ServiceType.QHEmptyTank); qhempty.Credentials = nc; QHEmptyTank.QHEmptyTank qhcheck = qhempty.Read(bincodetemp); if (qhcheck == null) { QHEmptyTank.QHEmptyTank qhtnk = new QHMobile.QHEmptyTank.QHEmptyTank(); qhtnk.Bin_Code = bincodetemp; qhempty.Create(ref qhtnk); qhtnk.Batch_Name = "IReclass"; qhtnk.Item_No = itemtemp; qhtnk.Location_Code = locationtemp; qhempty.Update(ref qhtnk); } } } CompactSQL comsql = new CompactSQL(); comsql.deleteRecord("ItemReclass"); MessageBox.Show("Submitted to Journal."); TransferOrder tro = new TransferOrder(staffname, staffdimension, stafflevel); tro.Show(); GrdTO.DataSource = null; Cursor.Current = Cursors.Default; } catch (Exception ex) { MessageBox.Show("Eorror:" + ex); } Cursor.Current = Cursors.Default; } }