private void mnuPostToNav_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; string strPDAName; strPDAName = GetPDANamefromConfig(); QHEmptyTank.QHEmptyTank_Service empSev = new QHMobile.QHEmptyTank.QHEmptyTank_Service(); empSev.Url = WebServiceInstants.GetURL(ServiceType.QHEmptyTank); empSev.Credentials = nc; List <QHEmptyTank.QHEmptyTank_Filter> empfilterArray = new List <QHMobile.QHEmptyTank.QHEmptyTank_Filter>(); if (grdLineToPost.DataSource != null) { QH_Functions.QH_Functions qhfun = new QHMobile.QH_Functions.QH_Functions(); qhfun.Url = WebServiceInstants.GetURL(ServiceType.QH_Functions); qhfun.Credentials = nc; qhfun.UpdateDepItemReclassicJournal("TRANSFER", "DEFAULT"); //qhfun.UpdateDepItemJournal("TRANSFER", "DEFAULT"); qhfun.PostItemJournalReClassic(); QHEmptyTank.QHEmptyTank_Filter batchfilter = new QHMobile.QHEmptyTank.QHEmptyTank_Filter(); batchfilter.Field = QHMobile.QHEmptyTank.QHEmptyTank_Fields.Batch_Name; batchfilter.Criteria = "IReclass"; empfilterArray.Add(batchfilter); QHEmptyTank.QHEmptyTank[] batchList = empSev.ReadMultiple(empfilterArray.ToArray(), null, 0); for (int i = 0; i < batchList.Length; i++) { bool templfag = true; qhfun.TankAdj_NAV(batchList[i].Item_No, "", batchList[i].Location_Code, batchList[i].Bin_Code, 0, templfag, staffdimension, strPDAName, "TransferOrder"); empSev.Delete(batchList[i].Key.ToString()); } grdLineToPost.DataSource = null; MessageBox.Show("Posted Successfully!"); // Post function for TO } else { MessageBox.Show("No line to post!"); } Cursor.Current = Cursors.Default; }
private void MnuNewGRN_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; try { int lineval; string strPDAName; strPDAName = GetPDANamefromConfig(); QH_Functions.QH_Functions qhfun = new QHMobile.QH_Functions.QH_Functions(); qhfun.Url = WebServiceInstants.GetURL(ServiceType.QH_Functions); qhfun.Credentials = nc; QHEmptyTank.QHEmptyTank_Service empSev = new QHMobile.QHEmptyTank.QHEmptyTank_Service(); empSev.Url = WebServiceInstants.GetURL(ServiceType.QHEmptyTank); empSev.Credentials = nc; List <QHEmptyTank.QHEmptyTank_Filter> empfilterArray = new List <QHMobile.QHEmptyTank.QHEmptyTank_Filter>(); if (BatchName.Equals("DOA")) { qhfun.UpdateDepItemJournal("ITEM", "DOA"); string str = qhfun.PostItemJournalLineNeg(); if (str != "") { MessageBox.Show("This Bin could not find." + str); return; } MessageBox.Show("Journal Lines are posted sucessfully."); dtPost.Clear(); QHEmptyTank.QHEmptyTank_Filter batchfilter = new QHMobile.QHEmptyTank.QHEmptyTank_Filter(); batchfilter.Field = QHMobile.QHEmptyTank.QHEmptyTank_Fields.Batch_Name; batchfilter.Criteria = "DOA"; empfilterArray.Add(batchfilter); QHEmptyTank.QHEmptyTank[] batchList = empSev.ReadMultiple(empfilterArray.ToArray(), null, 0); for (int i = 0; i < batchList.Length; i++) { bool templfag = true; if (!string.IsNullOrEmpty(batchList[i].Item_No) && !string.IsNullOrEmpty(batchList[i].Location_Code) && !string.IsNullOrEmpty(batchList[i].Bin_Code)) { qhfun.TankAdj_NAV(batchList[i].Item_No, "", batchList[i].Location_Code, batchList[i].Bin_Code, 0, templfag, Rstaffdimensio, strPDAName, "DailyLPost"); //qhfun.TankAdj_NAV("", "", "", batchList[i].Bin_Code, 0, templfag); // empSev.Delete(batchList[i].Bin_Code); /// Need to check empSev.Delete(batchList[i].Key.ToString()); } } //this.Close(); DailyLPost dlp = new DailyLPost(Rusername, Rstaffdimensio, Ruserlevel); dlp.Show(); Cursor.Current = Cursors.Default; } else { qhfun.UpdateDepItemJournal("ITEM", BatchName); lineval = qhfun.PostItemJournalLine_DEFAULT(); if (lineval == 0) { MessageBox.Show("Journal Lines are posted sucessfully."); dtPost.Clear(); QHEmptyTank.QHEmptyTank_Filter batchfilter = new QHMobile.QHEmptyTank.QHEmptyTank_Filter(); batchfilter.Field = QHMobile.QHEmptyTank.QHEmptyTank_Fields.Batch_Name; batchfilter.Criteria = BatchName; empfilterArray.Add(batchfilter); QHEmptyTank.QHEmptyTank[] batchList = empSev.ReadMultiple(empfilterArray.ToArray(), null, 0); for (int i = 0; i < batchList.Length; i++) { bool templfag = true; qhfun.TankAdj_NAV(batchList[i].Item_No, "", batchList[i].Location_Code, batchList[i].Bin_Code, 0, templfag, Rstaffdimensio, strPDAName, "DailyLPost"); //qhfun.TankAdj_NAV("", "", "", batchList[i].Bin_Code, 0, templfag); // empSev.Delete(batchList[i].Bin_Code); /// Need to check empSev.Delete(batchList[i].Key.ToString()); } //this.Close(); DailyLPost dlp = new DailyLPost(Rusername, Rstaffdimensio, Ruserlevel); dlp.Show(); Cursor.Current = Cursors.Default; } else { MessageBox.Show("Journal Lines are posted but throws error in some record. Line No" + lineval); } } } catch (Exception ex) { MessageBox.Show("Error" + ex); Cursor.Current = Cursors.Default; } Cursor.Current = Cursors.Default; }