Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (cboPoList.SelectedItem.ToString().Equals(""))
            {
            }
            else
            {
                Cursor.Current = Cursors.WaitCursor;

                string potemp = "QHPO" + cboPoList.SelectedItem.ToString();

                string   s     = potemp;
                string[] words = s.Split('~');
                string   strLocationLocation;
                s = words[0];
                strLocationLocation = words[3].ToString();


                PurchaseQH.PurchaseQH_Service poserv = new QHMobile.PurchaseQH.PurchaseQH_Service();
                poserv.Url         = WebServiceInstants.GetURL(ServiceType.PurchaseQH);
                poserv.Credentials = nc;

                PurchaseQH.PurchaseQH poRecord = poserv.Read(s);


                //POAssignBin po = new POAssignBin(staffname, staffdimension, stafflevel, potemp,poRecord.Location_Code);
                POAssignBin po = new POAssignBin(staffname, staffdimension, stafflevel, potemp, strLocationLocation);

                po.Show();

                Cursor.Current = Cursors.Default;
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        private void CreatePutAway()
        {
            try
            {
                PutAlwaysQH.PutAlwaysQH_Service putSev = new QHMobile.PutAlwaysQH.PutAlwaysQH_Service();
                putSev.Url         = WebServiceInstants.GetURL(ServiceType.PutAlwaysQH);
                putSev.Credentials = nc;

                PurchaseQH.PurchaseQH_Service poservice = new QHMobile.PurchaseQH.PurchaseQH_Service();
                poservice.Url         = WebServiceInstants.GetURL(ServiceType.PurchaseQH);
                poservice.Credentials = nc;

                PutAlwaysQH.PutAlwaysQH putAwayCreate = new QHMobile.PutAlwaysQH.PutAlwaysQH();
                PurchaseQH.PurchaseQH   poRead        = poservice.Read(TONumber);

                putSev.Create(ref putAwayCreate);
                PutNumber = putAwayCreate.No;

                putAwayCreate.Source_Document = QHMobile.PutAlwaysQH.Source_Document.Purchase_Order;
                putAwayCreate.Location_Code   = "QH1";//poRead.Location_Code;
                putSev.Update(ref putAwayCreate);

                putAwayCreate.Source_No = txtTO.Text.Trim();
                putSev.Update(ref putAwayCreate);


                PutAlwaysLinesQH.PutAlwaysLinesQH_Service lineservice = new QHMobile.PutAlwaysLinesQH.PutAlwaysLinesQH_Service();
                lineservice.Url         = WebServiceInstants.GetURL(ServiceType.PutAlwaysLinesQH);
                lineservice.Credentials = nc;

                List <PutAlwaysLinesQH.PutAlwaysLinesQH_Filter> filterArray = new List <QHMobile.PutAlwaysLinesQH.PutAlwaysLinesQH_Filter>();

                PutAlwaysLinesQH.PutAlwaysLinesQH_Filter fitlerNumber = new PutAlwaysLinesQH.PutAlwaysLinesQH_Filter();
                fitlerNumber.Field    = PutAlwaysLinesQH.PutAlwaysLinesQH_Fields.No;
                fitlerNumber.Criteria = PutNumber;

                filterArray.Add(fitlerNumber);

                PutAlwaysLinesQH.PutAlwaysLinesQH[] GridPutAwayLines = lineservice.ReadMultiple(filterArray.ToArray(), null, 0);


                for (int k = 0; k < GridPutAwayLines.Length; k++)
                {
                    PutAlwaysLinesQH.PutAlwaysLinesQH toUpdate = new QHMobile.PutAlwaysLinesQH.PutAlwaysLinesQH();
                    toUpdate          = lineservice.Read(PutAlwaysLinesQH.Activity_Type.Invt_Put_away.ToString(), PutNumber, GridPutAwayLines[k].Line_No);
                    toUpdate.Bin_Code = null;
                    lineservice.Update(ref toUpdate);
                }

                PutAlwaysLinesQH.PutAlwaysLinesQH[] PutAwayRead = lineservice.ReadMultiple(filterArray.ToArray(), null, 0);

                for (int i = 0; i < PutAwayRead.Length; i++)
                {
                    QHMobile.POModule po = new POModule();

                    po.itemNo      = PutAwayRead[i].Item_No;
                    po.lineno      = PutAwayRead[i].Line_No;
                    po.description = PutAwayRead[i].Description;
                    po.location    = PutAwayRead[i].Location_Code;
                    po.quantity    = PutAwayRead[i].Quantity;

                    pomod.Add(po);
                }

                BindToGridLines(pomod);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 4
0
        private void btnGetPo_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (!string.IsNullOrEmpty(txtDate.Text.Trim()))
                {
                    cboPoList.Items.Clear();
                    WarehouseRequestQH.WarehouseRequestQH_Service requestSev = new QHMobile.WarehouseRequestQH.WarehouseRequestQH_Service();
                    requestSev.Url         = WebServiceInstants.GetURL(ServiceType.WarehouseRequestQH);
                    requestSev.Credentials = nc;

                    List <QHMobile.WarehouseRequestQH.WarehouseRequestQH_Filter> Whfilterarray = new List <QHMobile.WarehouseRequestQH.WarehouseRequestQH_Filter>();

                    WarehouseRequestQH.WarehouseRequestQH_Filter whF1 = new QHMobile.WarehouseRequestQH.WarehouseRequestQH_Filter();
                    whF1.Field    = QHMobile.WarehouseRequestQH.WarehouseRequestQH_Fields.Type;
                    whF1.Criteria = "Inbound";
                    Whfilterarray.Add(whF1);

                    WarehouseRequestQH.WarehouseRequestQH_Filter whF2 = new QHMobile.WarehouseRequestQH.WarehouseRequestQH_Filter();
                    whF2.Field    = QHMobile.WarehouseRequestQH.WarehouseRequestQH_Fields.Expected_Receipt_Date;
                    whF2.Criteria = txtDate.Text;
                    Whfilterarray.Add(whF2);

                    WarehouseRequestQH.WarehouseRequestQH_Filter whF3 = new QHMobile.WarehouseRequestQH.WarehouseRequestQH_Filter();
                    whF3.Field    = QHMobile.WarehouseRequestQH.WarehouseRequestQH_Fields.Completely_Handled;
                    whF3.Criteria = "false";
                    Whfilterarray.Add(whF3);

                    WarehouseRequestQH.WarehouseRequestQH_Filter whF4 = new QHMobile.WarehouseRequestQH.WarehouseRequestQH_Filter();
                    whF4.Field    = QHMobile.WarehouseRequestQH.WarehouseRequestQH_Fields.Source_Document;
                    whF4.Criteria = QHMobile.WarehouseRequestQH.Source_Document.Purchase_Order.ToString();
                    Whfilterarray.Add(whF4);

                    WarehouseRequestQH.WarehouseRequestQH[] comboRequest = requestSev.ReadMultiple(Whfilterarray.ToArray(), null, 0);
                    if (comboRequest.Length > 0)
                    {
                        for (int i = 0; i < comboRequest.Length; i++)
                        {
                            PurchaseQH.PurchaseQH_Service poserv = new QHMobile.PurchaseQH.PurchaseQH_Service();
                            poserv.Url         = WebServiceInstants.GetURL(ServiceType.PurchaseQH);
                            poserv.Credentials = nc;

                            PurchaseQH.PurchaseQH po = poserv.Read(comboRequest[i].Source_No.ToString());
                            string v = po.Buy_from_Vendor_Name.ToString();
                            v = v.Substring(0, 5);

                            string ponumber = comboRequest[i].Source_No.Substring(4);

                            cboPoList.Items.Add(ponumber + "~" + po.Buy_from_Vendor_No + "~" + v + "~" + comboRequest[i].Location_Code.ToString());
                        }
                        button1.Enabled   = true;
                        cboPoList.Enabled = true;
                        Cursor.Current    = Cursors.WaitCursor;
                    }
                    else
                    {
                        Cursor.Current = Cursors.WaitCursor;
                        MessageBox.Show("There is no PO.");
                    }
                }
                else
                {
                    Cursor.Current = Cursors.WaitCursor;
                    MessageBox.Show("Please Key in the Date");
                }
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.WaitCursor;
                MessageBox.Show(ex.Message);
            }


            Cursor.Current = Cursors.Default;
        }