Ejemplo n.º 1
0
        private void MnuNewGRN_Click(object sender, EventArgs e)
        {
            //if (GrdDailyLoss == null)
            //{
            //    MessageBox.Show("There is no record to post!");
            //}
            //else
            //{

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                QH_Functions.QH_Functions qhfun = new QHMobile.QH_Functions.QH_Functions();
                qhfun.Url         = WebServiceInstants.GetURL(ServiceType.QH_Functions);
                qhfun.Credentials = nc;
                qhfun.PostItemJournalLine();

                MessageBox.Show("Journal Lines are posted.");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error" + ex);
            }

            Cursor.Current = Cursors.Default;
            // }
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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!");
        }
Ejemplo n.º 4
0
        private void menuItem3_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                QH_Functions.QH_Functions qhfun = new QHMobile.QH_Functions.QH_Functions();
                qhfun.Url         = WebServiceInstants.GetURL(ServiceType.QH_Functions);
                qhfun.Credentials = nc;
                qhfun.PostItemJournalLineNeg();

                MessageBox.Show("Journal Lines are posted sucessfully.");
                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error" + ex);
                Cursor.Current = Cursors.Default;
            }
        }
Ejemplo n.º 5
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.º 6
0
        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[stmod.Count];
                        qhStockTakeWS.StockTakeWS[] stock_list = new qhStockTakeWS.StockTakeWS[dv.Count];

                        //qhStockTakeWS.StockTakeWS[] stock_all = qhserv.ReadMultiple(null, null, 0);
                        //linecount = stock_all.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.Item_No = dgGRNLine[i, 0].ToString();


                            //  updatestock.Line_NoSpecified = true;

                            //linecount = qhfun.GetStockTakeLastLineNo();
                            // linecount = ++linecount;
                            //updatestock.Line_No = linecount;


                            updatestock.BinCode = stmod[i].binNo;
                            //updatestock.BinCode = dgGRNLine[i, 1].ToString();

                            updatestock.Stock_take_QuantitySpecified = true;
                            updatestock.Stock_take_Quantity          = stmod[i].qty;
                            //updatestock.Stock_take_Quantity = Convert.ToInt32(dgGRNLine[i, 2].ToString());
                            updatestock.Stock_take_DateSpecified = true;
                            updatestock.Stock_take_Date          = stmod[i].postDate;
                            //updatestock.Stock_take_Date = Convert.ToDateTime(dgGRNLine[i, 3].ToString());
                            updatestock.Staff_Dimension_Code = staffdim;
                            //updatestock.Staff_Dimension_Code = dgGRNLine[i, 4].ToString();
                            updatestock.Entry_DateSpecified = true;
                            updatestock.Entry_Date          = stmod[i].entryDate;
                            //updatestock.Entry_Date = Convert.ToDateTime(dgGRNLine[i, 5].ToString());
                            updatestock.Registered_DateSpecified = true;
                            updatestock.Registered_Date          = stmod[i].entryDate;
                            //updatestock.Registered_Date = Convert.ToDateTime(dgGRNLine[i, 5].ToString());


                            updatestock.Message = "Items not in Phys. Invty Jnl";
                            if (string.IsNullOrEmpty(txtLocation.Text.ToString()))
                            {
                                updatestock.Location_Code = "QH1";
                            }
                            else
                            {
                                updatestock.Location_Code = txtLocation.Text.ToString();
                            }

                            updatestock.Category = stmod[i].category;
                            //updatestock.Category = dgGRNLine[i, 6].ToString();

                            updatestock.Skip_Auto_NumberSpecified = false;
                            updatestock.Skip_Auto_Number          = false;
                            qhserv.Create(ref updatestock);
                            //stock_list[i] = updatestock;
                        }

                        //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);
                    }
                }
            }catch (Exception ex)
            {
                MessageBox.Show("Error" + ex);
            }
        }
Ejemplo n.º 7
0
        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);
            }
        }
Ejemplo n.º 8
0
        private void MeuItemLogin_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                QH_Functions.QH_Functions qhfun = new QHMobile.QH_Functions.QH_Functions();
                qhfun.Url         = WebServiceInstants.GetURL(ServiceType.QH_Functions);
                qhfun.Credentials = nc;
                if (!qhfun.CompareDate(System.DateTime.Today.Day.ToString(), System.DateTime.Today.Month.ToString(), System.DateTime.Today.Year.ToString()))
                {
                    MessageBox.Show("Plase check your PDA date!");
                    return;

                    Cursor.Current = Cursors.Default;
                }

                if (!txtUserID.Text.Equals("") && !txtPassword.Text.Equals(""))
                {
                    string tempuser     = txtUserID.Text;
                    string temppassword = txtPassword.Text;


                    UsersQH.UsersQH_Service serviceUser = new QHMobile.UsersQH.UsersQH_Service();
                    serviceUser.Url         = WebServiceInstants.GetURL(ServiceType.UsersQH);
                    serviceUser.Credentials = nc;

                    UsersQH.UsersQH user = serviceUser.Read(tempuser);

                    if (user != null)
                    {
                        if (temppassword.Equals(user.Password))
                        {
                            LoginInformation linfo = new LoginInformation();
                            linfo.loginpassword  = user.Password;
                            linfo.loginuser      = user.UserName;
                            linfo.staffdimension = user.Stuff_Dimension;
                            linfo.userlevel      = user.UserLevel.ToString();

                            Cursor.Current = Cursors.Default;
                            SaveToConfig();
                            frmMain msc = new frmMain(linfo.loginuser, linfo.loginpassword, linfo.staffdimension, linfo.userlevel);
                            msc.Show();
                            this.Hide();
                        }
                        else
                        {
                            MessageBox.Show("Password is wrong.");
                            Cursor.Current = Cursors.Default;
                        }
                    }
                    else
                    {
                        MessageBox.Show("User Not Found!");
                    }
                }
                else
                {
                    MessageBox.Show("Please enter User Name and password.");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 9
0
        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;
        }