Ejemplo n.º 1
0
        private void pictureBox5_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            if (!uslvelg.Equals("Super"))
            {
                MessageBox.Show("This function is used for supervisor only.");
            }
            else
            {
                DailyLPost dlp = new DailyLPost(usng, staffdimg, uslvelg);
                dlp.Show();
            }

            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 2
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;
        }