private void mnuPostToNav_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; QH_Functions.QH_Functions qhfun = new QHMobile.QH_Functions.QH_Functions(); qhfun.Credentials = nc; qhfun.Url = WebServiceInstants.GetURL(ServiceType.QH_Functions); qhfun.ReleasePO(PO); Cursor.Current = Cursors.Default; MessageBox.Show("Released!"); }
private void mnuRegisterToNav_Click(object sender, EventArgs e) { try { if (GrdPO.DataSource != null) { Cursor.Current = Cursors.WaitCursor; PurchaseQH.PurchaseQH_Service purSev = new QHMobile.PurchaseQH.PurchaseQH_Service(); purSev.Credentials = nc; purSev.Url = WebServiceInstants.GetURL(ServiceType.PurchaseQH); PurchaseQH.PurchaseQH phcreate = new QHMobile.PurchaseQH.PurchaseQH(); purSev.Create(ref phcreate); PO = phcreate.No; PurchaseQH.PurchaseQH phupdate = purSev.Read(phcreate.No); phupdate.Buy_from_Vendor_No = txtVendorNo.Text.Trim(); phupdate.Buy_from_Vendor_Name = txtVendorName.Text.Trim(); phupdate.Order_Date = DateTime.Now; purSev.Update(ref phupdate); phupdate.PurchLines = new QHMobile.PurchaseQH.Purchase_Order_Line[PoArray.Count]; for (int i = 0; i < PoArray.Count; i++) { phupdate.PurchLines[i] = new QHMobile.PurchaseQH.Purchase_Order_Line(); } purSev.Update(ref phupdate); for (int j = 0; j < phupdate.PurchLines.Length; j++) { phupdate.PurchLines[j].Type = QHMobile.PurchaseQH.Type.Item; phupdate.PurchLines[j].No = PoArray[j].itemno; phupdate.PurchLines[j].Location_Code = PoArray[j].location; phupdate.PurchLines[j].Quantity = Convert.ToInt32(PoArray[j].quantity); phupdate.PurchLines[j].Bin_Code = ""; } purSev.Update(ref phupdate); lblPO.Text = "PO:" + phupdate.No; if (!String.IsNullOrEmpty(phupdate.No)) { QH_Functions.QH_Functions qhfun = new QHMobile.QH_Functions.QH_Functions(); qhfun.Credentials = nc; qhfun.Url = WebServiceInstants.GetURL(ServiceType.QH_Functions); //qhfun.ReleasePO(PO); qhfun.ReleasePO(phupdate.No.Trim()); MessageBox.Show("Purchase Order is created succesfully!" + phupdate.No); CompactSQL comsql = new CompactSQL(); comsql.deleteRecord("PurchaseOrder"); PurChaseOrder po = new PurChaseOrder(vuser, vstaffdimension, vstafflevel); po.Show(); } Cursor.Current = Cursors.Default; } else { MessageBox.Show("There is no line to post!"); } } catch (Exception ex) { MessageBox.Show("Error:" + ex); } }