Пример #1
0
        private void txtItemNo_KeyDown_1(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Tab)
            {
                Cursor.Current = Cursors.WaitCursor;

                itemSev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                itemSev.Credentials = nc;

                ItemQH.ItemQH itemqh = itemSev.Read(txtItemNo.Text.Trim());

                if (itemqh == null)
                {
                    MessageBox.Show("Item not found!");
                    txtItemNo.SelectAll();
                    txtItemNo.Focus();
                }
                else
                {
                    txtLocation.Enabled = true;
                    txtQty.Text         = "";
                    txtQty.Enabled      = true;
                    txtRegDate.Enabled  = true;
                    txtQty.Focus();
                }

                Cursor.Current = Cursors.Default;
            }
        }
Пример #2
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;
            // }
        }
Пример #3
0
        private bool ItemValidating()
        {
            try
            {
                ItemQH.ItemQH_Service itemQHserv = new QHMobile.ItemQH.ItemQH_Service();
                itemQHserv.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                itemQHserv.Credentials = nc;

                ItemQH.ItemQH itemqh = itemQHserv.Read(txtItemNo.Text.Trim());

                if (itemqh != null)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                return(false);
                //MessageBox.Show(ex.Message);
            }
        }
Пример #4
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;
            }
        }
Пример #5
0
 private void MnuBlockBin_Click(object sender, EventArgs e)
 {
     try
     {
         Cursor.Current = Cursors.WaitCursor;
         BinQH.BinQH_Service binserv = new QHMobile.BinQH.BinQH_Service();
         binserv.Url         = WebServiceInstants.GetURL(ServiceType.BinQH);
         binserv.Credentials = nc;
         if (dt.Rows.Count > 0)
         {
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 BinQH.BinQH binupdate = binserv.Read(dt.Rows[i][1].ToString(), dt.Rows[i][0].ToString());
                 binupdate.Block_MovementSpecified = true;
                 if (dt.Rows[i][2].ToString().Trim() == "All")
                 {
                     binupdate.Block_Movement = BinQH.Block_Movement._blank_;
                 }
                 else
                 {
                     binupdate.Block_Movement = BinQH.Block_Movement.All;
                 }
                 binserv.Update(ref binupdate);
             }
             BindToGrid();
             MessageBox.Show("Update Successfully!");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #6
0
        private void BindtoList(string vendorname)
        {
            Cursor.Current = Cursors.WaitCursor;

            VendorListQH.VendorListQH_Service vdrSev = new QHMobile.VendorListQH.VendorListQH_Service();
            vdrSev.Url         = WebServiceInstants.GetURL(ServiceType.VendorListQH);
            vdrSev.Credentials = nc;

            List <VendorListQH.VendorListQH_Filter> vArray = new List <QHMobile.VendorListQH.VendorListQH_Filter>();

            VendorListQH.VendorListQH_Filter vfilter = new QHMobile.VendorListQH.VendorListQH_Filter();
            vfilter.Field    = QHMobile.VendorListQH.VendorListQH_Fields.Name;
            vfilter.Criteria = vendorname + "*";

            vArray.Add(vfilter);

            vendorArray = vdrSev.ReadMultiple(vArray.ToArray(), null, 0);

            for (var i = 0; i < vendorArray.Length; i++)
            {
                if (vendorArray[i].Name != null)
                {
                    lstVendorList.Items.Add(vendorArray[i].Name);
                }
            }

            Cursor.Current = Cursors.Default;

            //  MessageBox.Show("Parse Ok!");
        }
Пример #7
0
        public void BindLinesToPost()
        {
            Cursor.Current = Cursors.WaitCursor;

            ItemJournalDailyLossQH.ItemJournalDailyLossQH_Service itemSev = new QHMobile.ItemJournalDailyLossQH.ItemJournalDailyLossQH_Service();
            itemSev.Url         = WebServiceInstants.GetURL(ServiceType.ItemJournalDailyLossQH);
            itemSev.Credentials = nc;

            ItemJournalDailyLossQH.ItemJournalDailyLossQH[] itemArray = itemSev.ReadMultiple(BatchName, null, null, 0);


            ArrayList values = new ArrayList();

            for (int i = 0; i < itemArray.Length; i++)
            {
                if (!(values.Contains(itemArray[i].Staff_Dimension_Code)))
                {
                    if (itemArray[i].Staff_Dimension_Code != null)
                    {
                        values.Add(itemArray[i].Staff_Dimension_Code);
                    }
                }
            }

            for (int j = 0; j < values.Count; j++)
            {
                cboDailyLPost.Items.Add(values[j].ToString());
            }


            Cursor.Current = Cursors.Default;
        }
Пример #8
0
        private void menuItem2_Click(object sender, EventArgs e)
        {
            try
            {
                QHSalesReceivableSetup.QHSalesReceivableSetup_Service qhSaleSev = new QHMobile.QHSalesReceivableSetup.QHSalesReceivableSetup_Service();
                qhSaleSev.Url         = WebServiceInstants.GetURL(ServiceType.QHSalesReceivableSetup);
                qhSaleSev.Credentials = nc;

                QHSalesReceivableSetup.QHSalesReceivableSetup[] qhBatch = qhSaleSev.ReadMultiple(null, null, 0);

                if (qhBatch.Length == 0)
                {
                    MessageBox.Show("There is no batch name found!. Please go and check in NAV!");
                }
                else
                {
                    BatchName = qhBatch[0].Change_Size_Batch;
                    dtPost.Clear();
                    cboDailyLPost.Items.Clear();
                    MnuNewGRN.Enabled = true;
                    BindLinesToPost();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #9
0
        private void txtItemNo_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                if (e.KeyCode == Keys.Enter)
                {
                    ItemQH.ItemQH_Service itemSev = new QHMobile.ItemQH.ItemQH_Service();
                    itemSev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                    itemSev.Credentials = nc;
                    ItemQH.ItemQH item = itemSev.Read(txtItemNo.Text.Trim());

                    if (item == null)
                    {
                        MessageBox.Show("Invalid Item!");
                        txtItemNo.Text = "";
                        txtItemNo.Focus();
                    }
                    else
                    {
                        txtCategory.Text     = item.Item_Category_Code;
                        txtDescription.Text  = item.Description;
                        txtDescription2.Text = item.Description_2;
                        txtQty.Focus();
                    }
                }

                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }//end
Пример #10
0
        private void CheckPO()
        {
            WhseLineQH.WhseLineQH_Service whserv = new QHMobile.WhseLineQH.WhseLineQH_Service();
            whserv.Url         = WebServiceInstants.GetURL(ServiceType.WhseLineQH);
            whserv.Credentials = nc;

            List <WhseLineQH.WhseLineQH_Filter> filter = new List <QHMobile.WhseLineQH.WhseLineQH_Filter>();

            WhseLineQH.WhseLineQH_Filter filtersource = new QHMobile.WhseLineQH.WhseLineQH_Filter();
            filtersource.Field    = QHMobile.WhseLineQH.WhseLineQH_Fields.Source_No;
            filtersource.Criteria = txtTO.Text.Trim();

            filter.Add(filtersource);

            WhseLineQH.WhseLineQH[] linearray = whserv.ReadMultiple(filter.ToArray(), null, 0);

            if (linearray.Length < 1)
            {
                CreatePutAway();
            }
            else
            {
                UpdatePutAway(linearray);
            }
        }
Пример #11
0
        private void BindToGrid()
        {
            try
            {
                if (!String.IsNullOrEmpty(txtBinNo.Text.Trim()))
                {
                    dt = new DataTable("BlockBin");

                    dt.Columns.Add("BinCode");
                    dt.Columns.Add("LocationCode");
                    dt.Columns.Add("BlockMovement");

                    BinQH.BinQH_Service binserv = new QHMobile.BinQH.BinQH_Service();
                    binserv.Url         = WebServiceInstants.GetURL(ServiceType.BinQH);
                    binserv.Credentials = nc;

                    List <BinQH.BinQH_Filter> arrayBinFilter = new List <BinQH.BinQH_Filter>();

                    BinQH.BinQH_Filter FilterBin = new QHMobile.BinQH.BinQH_Filter();
                    FilterBin.Field    = QHMobile.BinQH.BinQH_Fields.Code;
                    FilterBin.Criteria = txtBinNo.Text.Trim();
                    arrayBinFilter.Add(FilterBin);

                    BinQH.BinQH[] BinList = binserv.ReadMultiple(arrayBinFilter.ToArray(), null, 0);
                    if (BinList.Length > 0)
                    {
                        dt.Clear();
                        lblCount.Text = "(" + BinList.Length.ToString() + ")";
                        for (int i = 0; i < BinList.Length; i++)
                        {
                            if (BinList[i].Location_Code != BinList[i].Code)
                            {
                                Object[] array = new Object[3];
                                array[0] = BinList[i].Code;
                                array[1] = BinList[i].Location_Code;
                                array[2] = BinList[i].Block_Movement.ToString();
                                dt.Rows.Add(array);
                            }
                        }
                        gdBins.DataSource = dt;
                        gdBins.TableStyles.Clear();
                        gdBins.TableStyles.Add(DataGridStyle(dt));
                        Cursor.Current = Cursors.Default;
                    }
                    else
                    {
                        NoBinFound();
                    }
                }
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message);
            }
        }
Пример #12
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;
        }
Пример #13
0
        private bool LocationValidating()
        {
            try
            {
                QHBinContent.QHBinContent_Service qhserv = new QHMobile.QHBinContent.QHBinContent_Service();
                qhserv.Url         = WebServiceInstants.GetURL(ServiceType.QHBinContent);
                qhserv.Credentials = nc;

                List <QHBinContent.QHBinContent_Filter> filterarray = new List <QHMobile.QHBinContent.QHBinContent_Filter>();

                QHBinContent.QHBinContent_Filter binfilter = new QHMobile.QHBinContent.QHBinContent_Filter();
                binfilter.Field    = QHMobile.QHBinContent.QHBinContent_Fields.Bin_Code;
                binfilter.Criteria = txtBinCode.Text.Trim();

                //QHBinContent.QHBinContent_Filter qtyfilter = new QHMobile.QHBinContent.QHBinContent_Filter();
                //qtyfilter.Field = QHMobile.QHBinContent.QHBinContent_Fields.Quantity_Base;
                //qtyfilter.Criteria = "<>0";

                QHBinContent.QHBinContent_Filter qtyfilter = new QHMobile.QHBinContent.QHBinContent_Filter();
                qtyfilter.Field    = QHMobile.QHBinContent.QHBinContent_Fields.Unit_of_Measure_Code;
                qtyfilter.Criteria = "<>''";

                QHBinContent.QHBinContent_Filter itemfilter = new QHMobile.QHBinContent.QHBinContent_Filter();
                itemfilter.Field    = QHMobile.QHBinContent.QHBinContent_Fields.Item_No;
                itemfilter.Criteria = txtItemNo.Text.Trim();

                filterarray.Add(binfilter);
                filterarray.Add(itemfilter);
                filterarray.Add(qtyfilter);

                QHBinContent.QHBinContent[] binqh = qhserv.ReadMultiple(filterarray.ToArray(), null, 5);


                //txtLocation.Text.Trim(), txtBinCode.Text.Trim()


                if (binqh.Length != 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message);
                return(false);
            }
        }
Пример #14
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!");
        }
Пример #15
0
        private bool ItemValidating()
        {
            ItemQH.ItemQH_Service itemQHserv = new QHMobile.ItemQH.ItemQH_Service();
            itemQHserv.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
            itemQHserv.Credentials = nc;

            ItemQH.ItemQH itemqh = itemQHserv.Read(txtItemNo.Text.Trim());

            if (itemqh != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #16
0
        private void btnEnter_Click(object sender, EventArgs e)
        {
            QH_Location.QH_Location_Service qhserv = new QHMobile.QH_Location.QH_Location_Service();
            qhserv.Url         = WebServiceInstants.GetURL(ServiceType.QH_Location);
            qhserv.Credentials = nc;

            QH_Location.QH_Location qhloc = qhserv.Read(textBox1.Text.Trim());

            if (qhloc != null)
            {
                // QHMobile.StockTake fGRN = new StockTake(staffdimension);
                //fGRN.ShowDialog();
            }
            else
            {
                MessageBox.Show("Location was not found. Please try again.");
            }
        }
Пример #17
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;
            }
        }
Пример #18
0
        private void BindToPost()
        {
            ItemJournalDailyLossQH.ItemJournalDailyLossQH_Service sev = new QHMobile.ItemJournalDailyLossQH.ItemJournalDailyLossQH_Service();
            sev.Credentials = nc;
            sev.Url         = WebServiceInstants.GetURL(ServiceType.ItemJournalDailyLossQH);
            ItemJournalDailyLossQH.ItemJournalDailyLossQH[] journal = sev.ReadMultiple("DEFAULT", null, null, 0);

            for (int i = 0; i < journal.Length; i++)
            {
                Object[] array = new Object[5];

                array[0] = journal[i].Item_No;
                array[1] = journal[i].Location_Code;
                array[2] = journal[i].Bin_Code;
                array[3] = journal[i].Entry_Type;
                array[4] = journal[i].Quantity;
                dtpost.Rows.Add(array);
            }
        }
Пример #19
0
        private void txtItemNo_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)

            {
                if (!string.IsNullOrEmpty(txtItemNo.Text.Trim()))
                {
                    ItemQH.ItemQH_Service itemsev = new QHMobile.ItemQH.ItemQH_Service();
                    itemsev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                    itemsev.Credentials = nc;

                    ItemQH.ItemQH itemdescription = itemsev.Read(txtItemNo.Text.Trim());
                    if (itemdescription != null)
                    {
                        txtDescription.Text = itemdescription.Description;
                    }
                }

                txtQuantity.SelectAll();
                txtQuantity.Focus();
            }
        }
Пример #20
0
        private void BindPostLines()
        {
            ItemJournalQH.ItemJournalQH_Service sev = new QHMobile.ItemJournalQH.ItemJournalQH_Service();
            sev.Url         = WebServiceInstants.GetURL(ServiceType.ItemJournalQH);
            sev.Credentials = nc;

            ItemJournalQH.ItemJournalQH[] journal = sev.ReadMultiple("DEFAULT", null, null, 0);

            for (int i = 0; i < journal.Length; i++)
            {
                Object[] array = new Object[6];
                array[0] = journal[i].Item_No;
                array[1] = journal[i].Location_Code;
                array[2] = journal[i].New_Location_Code;
                array[3] = journal[i].Bin_Code;
                array[4] = journal[i].New_Bin_Code;
                array[5] = journal[i].Quantity;

                PostJournal.Rows.Add(array);
            }

            grdLineToPost.DataSource = PostJournal;
        }
Пример #21
0
        private void BindListControl()
        {
            ItemQH.ItemQH_Service itemSev = new QHMobile.ItemQH.ItemQH_Service();
            itemSev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
            itemSev.Credentials = nc;

            List <ItemQH.ItemQH_Filter> filterArray = new List <QHMobile.ItemQH.ItemQH_Filter>();

            ItemQH.ItemQH_Filter filter = new QHMobile.ItemQH.ItemQH_Filter();
            filter.Field    = QHMobile.ItemQH.ItemQH_Fields.No;
            filter.Criteria = tocheckItemName + "*";

            filterArray.Add(filter);

            ItemQH.ItemQH[] itemArray = itemSev.ReadMultiple(filterArray.ToArray(), null, 0);

            for (int i = 0; i < itemArray.Length; i++)
            {
                lstItem.Items.Add(itemArray[i].No + "~" + itemArray[i].Description);
            }

            //MessageBox.Show("Please choose one item from the list and click OK!");
        }
Пример #22
0
        private void txtSearch_KeyDown(object sender, KeyEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Tab)
                {
                    if (!string.IsNullOrEmpty(txtSearch.Text.ToString()))
                    {
                        VendorListQH.VendorListQH_Service vdrSev = new QHMobile.VendorListQH.VendorListQH_Service();
                        vdrSev.Url         = WebServiceInstants.GetURL(ServiceType.VendorListQH);
                        vdrSev.Credentials = nc;
                        VendorListQH.VendorListQH oVendor = new QHMobile.VendorListQH.VendorListQH();

                        oVendor = vdrSev.Read(txtSearch.Text.ToString());
                        if (oVendor != null)
                        {
                            txtVendorNo.Text   = oVendor.No.ToString();
                            txtVendorName.Text = oVendor.Name.ToString();
                        }
                        else
                        {
                            txtSearch.Text     = "";
                            txtVendorNo.Text   = "";
                            txtVendorName.Text = "";

                            txtSearch.Focus();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
            Cursor.Current = Cursors.Default;
        }
Пример #23
0
        private void txtBinCode_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    Cursor.Current = Cursors.WaitCursor;

                    ItemQH.ItemQH_Service itemSev = new QHMobile.ItemQH.ItemQH_Service();
                    itemSev.Credentials = nc;
                    itemSev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);

                    QHBinContent.QHBinContent_Service qhbinServ = new QHMobile.QHBinContent.QHBinContent_Service();
                    qhbinServ.Url         = WebServiceInstants.GetURL(ServiceType.QHBinContent);
                    qhbinServ.Credentials = nc;

                    List <QHBinContent.QHBinContent_Filter> filterArray = new List <QHMobile.QHBinContent.QHBinContent_Filter>();
                    QHBinContent.QHBinContent_Filter        filter      = new QHMobile.QHBinContent.QHBinContent_Filter();
                    filter.Field = QHMobile.QHBinContent.QHBinContent_Fields.Bin_Code;

                    if (string.IsNullOrEmpty(txtBinCode.Text.Trim()))
                    {
                        filter.Criteria = "''";
                    }
                    else
                    {
                        filter.Criteria = txtBinCode.Text.Trim();
                    }


                    filterArray.Add(filter);

                    QHBinContent.QHBinContent_Filter filterBaseQty = new QHMobile.QHBinContent.QHBinContent_Filter();
                    filterBaseQty.Field    = QHMobile.QHBinContent.QHBinContent_Fields.Quantity;
                    filterBaseQty.Criteria = ">0";
                    filterArray.Add(filterBaseQty);

                    QHBinContent.QHBinContent_Filter filterPCS = new QHMobile.QHBinContent.QHBinContent_Filter();
                    filterPCS.Field    = QHMobile.QHBinContent.QHBinContent_Fields.Unit_of_Measure_Code;
                    filterPCS.Criteria = "<>''";
                    filterArray.Add(filterPCS);


                    //QHBinContent.QHBinContent_Filter filter2 = new QHMobile.QHBinContent.QHBinContent_Filter();
                    //filter2.Field = QHMobile.QHBinContent.QHBinContent_Fields.Quantity;
                    //filter2.Criteria = ">0";
                    //filterArray.Add(filter2);


                    QHBinContent.QHBinContent[] qhbin = qhbinServ.ReadMultiple(filterArray.ToArray(), null, 0);

                    //MessageBox.Show(qhbin.Length.ToString());
                    //ItemQH.ItemQH findItem = itemSev.Read(qhbin[0].Item_No.ToString());

                    BinQH.BinQH_Service binsev = new QHMobile.BinQH.BinQH_Service();
                    binsev.Credentials = nc;
                    binsev.Url         = WebServiceInstants.GetURL(ServiceType.BinQH);


                    if (qhbin.Length != 0)
                    {
                        BinQH.BinQH binbl = binsev.Read(qhbin[0].Location_Code, txtBinCode.Text.Trim());

                        if (binbl.Block_Movement == QHMobile.BinQH.Block_Movement.All)
                        {
                            MessageBox.Show("This bin is blocked.Hence please try again!");
                            txtBinCode.SelectAll();
                            txtBinCode.Focus();
                        }
                        else
                        {
                            ItemQH.ItemQH findItem = itemSev.Read(qhbin[0].Item_No.ToString());

                            txtLocation.Text = qhbin[0].Location_Code;
                            //txtBinCode.Text = qhbin[0].Bin_Code;
                            txtItemNo.Text      = qhbin[0].Item_No;
                            txtQuantity.Text    = "0"; //qhbin[0].Quantity_Base.ToString();
                            cboEntryType.Text   = cboEntryType.Items[1].ToString();
                            txtPostingDate.Text = DateTime.Today.ToShortDateString();
                            txtDescription.Text = findItem.Description;
                            chkEmpty.Enabled    = true;
                        }
                    }
                    else
                    {
                        BinQH.BinQH_Service binservice = new QHMobile.BinQH.BinQH_Service();
                        binservice.Url         = WebServiceInstants.GetURL(ServiceType.BinQH);
                        binservice.Credentials = nc;

                        List <BinQH.BinQH_Filter> filterArr = new List <QHMobile.BinQH.BinQH_Filter>();

                        BinQH.BinQH_Filter bincodefilter = new QHMobile.BinQH.BinQH_Filter();
                        bincodefilter.Field = QHMobile.BinQH.BinQH_Fields.Code;

                        if (string.IsNullOrEmpty(txtBinCode.Text.Trim()))
                        {
                            bincodefilter.Criteria = "''";
                        }
                        else
                        {
                            bincodefilter.Criteria = txtBinCode.Text.Trim();
                        }

                        filterArr.Add(bincodefilter);


                        BinQH.BinQH[] binqhget = binservice.ReadMultiple(filterArr.ToArray(), null, 3);

                        if (binqhget.Length != 0)
                        {
                            if (binqhget[0].Block_Movement == QHMobile.BinQH.Block_Movement.All)
                            {
                                MessageBox.Show("The bin is blocked!");
                            }
                            else
                            {
                                txtLocation.Text = binqhget[0].Location_Code;
                                //txtBinCode.Text = qhbin[0].Bin_Code;
                                txtItemNo.Text      = "";
                                txtQuantity.Text    = "0"; //qhbin[0].Quantity_Base.ToString();
                                cboEntryType.Text   = cboEntryType.Items[1].ToString();
                                txtPostingDate.Text = DateTime.Today.ToShortDateString();
                                txtDescription.Text = "";
                                chkEmpty.Enabled    = true;
                                txtItemNo.Focus();
                            }
                        }
                        else
                        {
                            MessageBox.Show("Invalid Bin!");
                            txtBinCode.SelectAll();
                            txtBinCode.Focus();
                        }
                    }


                    Cursor.Current = Cursors.Default;

                    txtQuantity.SelectAll();
                    txtQuantity.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Cursor.Current = Cursors.Default;
            }
        }
Пример #24
0
        private void txtBin_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    try
                    {
                        globalsvr.Url         = WebServiceInstants.GetURL(ServiceType.QHBinContent);
                        globalsvr.Credentials = nc;
                        Cursor.Current        = Cursors.WaitCursor;

                        List <QHBinContent.QHBinContent_Filter> filterarray = new List <QHMobile.QHBinContent.QHBinContent_Filter>();

                        QHBinContent.QHBinContent_Filter filterBin = new QHMobile.QHBinContent.QHBinContent_Filter();
                        filterBin.Field    = QHMobile.QHBinContent.QHBinContent_Fields.Bin_Code;
                        filterBin.Criteria = txtBin.Text.Trim();

                        filterarray.Add(filterBin);

                        BinQH.BinQH_Service binsev = new QHMobile.BinQH.BinQH_Service();
                        binsev.Url         = WebServiceInstants.GetURL(ServiceType.BinQH);
                        binsev.Credentials = nc;

                        List <BinQH.BinQH_Filter> binfitlerArray = new List <QHMobile.BinQH.BinQH_Filter>();

                        BinQH.BinQH_Filter bincodefilter = new QHMobile.BinQH.BinQH_Filter();
                        bincodefilter.Field    = QHMobile.BinQH.BinQH_Fields.Code;
                        bincodefilter.Criteria = txtBin.Text.Trim();

                        binfitlerArray.Add(bincodefilter);

                        BinQH.BinQH[] binget = binsev.ReadMultiple(binfitlerArray.ToArray(), null, 0);


                        QHBinContent.QHBinContent[] bintemp = globalsvr.ReadMultiple(filterarray.ToArray(), null, 0);


                        if (bintemp.Length == 0 && binget.Length == 0)
                        {
                            Cursor.Current = Cursors.Default;
                            MessageBox.Show("Not found!");
                            txtBin.SelectAll();
                            txtBin.Focus();
                        }
                        else
                        {
                            if (binget[0].Block_Movement == QHMobile.BinQH.Block_Movement.All)
                            {
                                MessageBox.Show("You are not allowed to scan blocked bin! Please try again!");
                                txtBin.Text = "";
                                txtBin.Focus();
                            }
                            else
                            {
                                if (bintemp.Length == 0)
                                {
                                    Cursor.Current = Cursors.Default;

                                    if (menuValue.Equals("1") || menuValue.Equals("0") || menuValue == null)
                                    {
                                        txtQty.Text = "0";    //bintemp[0].Quantity_Base.ToString();

                                        txtQty.Enabled   = true;
                                        textBox1.Enabled = true;
                                        txtBin.Enabled   = false;

                                        lblStaffInfo.Text = "Staff Name: " + staffdim;
                                        textBox1.Text     = DateTime.Today.ToShortDateString();

                                        txtQty.SelectAll();
                                        txtItemNo.Focus();
                                    }
                                    else if (menuValue.Equals("2"))
                                    {
                                        txtCategory.Enabled = true;

                                        txtItemNo.Enabled = true;
                                        txtItemNo.Focus();

                                        txtQty.Enabled   = true;
                                        textBox1.Enabled = true;
                                        txtBin.Enabled   = false;


                                        lblStaffInfo.Text = "Staff Name: " + staffdim;
                                        textBox1.Text     = DateTime.Today.ToShortDateString();
                                    }
                                }
                                else
                                {
                                    Cursor.Current = Cursors.Default;

                                    ItemQH.ItemQH item;

                                    ItemQH.ItemQH_Service itemSev = new QHMobile.ItemQH.ItemQH_Service();
                                    itemSev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                                    itemSev.Credentials = nc;

                                    item = itemSev.Read(bintemp[0].Item_No);


                                    if (menuValue.Equals("1") || menuValue.Equals("0") || menuValue == null)
                                    {
                                        txtQty.Text = "0";    //bintemp[0].Quantity_Base.ToString();

                                        txtCategory.Text = item.Item_Category_Code;

                                        txtQty.Enabled   = true;
                                        textBox1.Enabled = true;
                                        txtBin.Enabled   = false;
                                        txtItemNo.Text   = item.No;

                                        lblStaffInfo.Text    = "Staff Name: " + staffdim;
                                        textBox1.Text        = DateTime.Today.ToShortDateString();
                                        txtDescription.Text  = item.Description;
                                        txtDescription2.Text = item.Description_2;

                                        txtQty.SelectAll();
                                        txtQty.Focus();
                                    }
                                    else if (menuValue.Equals("2"))
                                    {
                                        txtCategory.Enabled = true;
                                        //txtItemNo.Text = item.No;
                                        txtItemNo.Enabled = true;
                                        txtItemNo.Focus();

                                        txtQty.Enabled   = true;
                                        textBox1.Enabled = true;
                                        txtBin.Enabled   = false;


                                        lblStaffInfo.Text = "Staff Name: " + staffdim;
                                        textBox1.Text     = DateTime.Today.ToShortDateString();
                                    }
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message.ToString());
                    }
                }
            }catch (Exception ex)
            {
                MessageBox.Show("Error" + ex);
            }

            Cursor.Current = Cursors.Default;
        }
Пример #25
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);
            }
        }
Пример #26
0
        private void menuItem1_Click(object sender, EventArgs e)
        {
            if (GrdDailyLoss == null)
            {
                MessageBox.Show("There is no record to register!");
            }
            else
            {
                Cursor.Current = Cursors.WaitCursor;

                try
                {
                    decimal countotal = 0;
                    bool    flagtemp  = false;
                    string  itemtemp;
                    string  locationtemp;
                    string  bincodetemp;

                    ItemJournalDailyLossQH.ItemJournalDailyLossQH_Service dlservice = new QHMobile.ItemJournalDailyLossQH.ItemJournalDailyLossQH_Service();
                    dlservice.Url         = WebServiceInstants.GetURL(ServiceType.ItemJournalDailyLossQH);
                    dlservice.Credentials = nc;

                    QHSalesReceivableSetup.QHSalesReceivableSetup_Service qhsalesev = new QHMobile.QHSalesReceivableSetup.QHSalesReceivableSetup_Service();
                    qhsalesev.Credentials = nc;
                    qhsalesev.Url         = WebServiceInstants.GetURL(ServiceType.QHSalesReceivableSetup);

                    QHSalesReceivableSetup.QHSalesReceivableSetup[] qhsaleGet = qhsalesev.ReadMultiple(null, null, 0);


                    for (int i = 0; i < dl_array.Count; i++)
                    {
                        ItemJournalDailyLossQH.ItemJournalDailyLossQH dl = new QHMobile.ItemJournalDailyLossQH.ItemJournalDailyLossQH();

                        dlservice.Create(qhsaleGet[0].Change_Size_Batch, ref dl); // Actual value should be DOA

                        dl.Posting_Date = DateTime.Now;

                        if (dl_array[i].entrytype.Equals("Positive Adjmt."))
                        {
                            dl.Entry_Type = ItemJournalDailyLossQH.Entry_Type.Positive_Adjmt;
                        }
                        else if (dl_array[i].entrytype.Equals("Negative Adjmt."))
                        {
                            dl.Entry_Type = ItemJournalDailyLossQH.Entry_Type.Negative_Adjmt;
                        }

                        dl.Entry_TypeSpecified = true;

                        dl.Item_No       = dl_array[i].itemno;
                        dl.Quantity      = Convert.ToInt32(dl_array[i].quantity);
                        dl.Location_Code = dl_array[i].location;
                        //dl.Posting_Date = dl_array[i].postdate;
                        dl.Staff_Dimension_Code = staffdim;
                        dl.Bin_Code             = dl_array[i].bincode;

                        dlservice.Update(qhsaleGet[0].Change_Size_Batch, ref dl);
                    }
                    //// to adjust ////

                    ArrayList tnk = new ArrayList();
                    for (int i = 0; i < dl_array.Count; i++)
                    {
                        if ((dl_array[i].EmptyTank == true) && (dl_array[i].entrytype.Equals("Negative Adjmt.")))
                        {
                            if (i == 0)
                            {
                                tnk.Add(dl_array[i].bincode);
                            }
                            else
                            {
                                if (!tnk.Contains(dl_array[i].bincode))
                                {
                                    tnk.Add(dl_array[i].bincode);
                                }
                            }
                        }
                    }

                    for (int j = 0; j < tnk.Count; j++)
                    {
                        countotal    = 0;
                        flagtemp     = false;
                        itemtemp     = "";
                        locationtemp = "";
                        bincodetemp  = "";

                        for (int k = 0; k < dl_array.Count; k++)
                        {
                            if ((dl_array[k].EmptyTank == true) && (dl_array[k].entrytype.Equals("Negative Adjmt.")))
                            {
                                if (tnk[j].ToString().Equals(dl_array[k].bincode))
                                {
                                    itemtemp     = dl_array[k].itemno;
                                    countotal    = countotal + Convert.ToDecimal(dl_array[k].quantity);
                                    locationtemp = dl_array[k].location;
                                    bincodetemp  = dl_array[k].bincode;

                                    if (dl_array[k].EmptyTank == true)
                                    {
                                        flagtemp = true;
                                    }
                                }
                            }
                        }

                        //QHBinContent.QHBinContent_Service qhsev = new QHMobile.QHBinContent.QHBinContent_Service();
                        //qhsev.Credentials = nc;
                        //qhsev.Url = WebServiceInstants.GetURL(ServiceType.QHBinContent);

                        //List<QHBinContent.QHBinContent_Filter> filterArr = new List<QHMobile.QHBinContent.QHBinContent_Filter>();

                        //QHBinContent.QHBinContent_Filter binfilter = new QHMobile.QHBinContent.QHBinContent_Filter();
                        //binfilter.Field = QHMobile.QHBinContent.QHBinContent_Fields.Bin_Code;
                        //binfilter.Criteria = bincodetemp;

                        ////QHBinContent.QHBinContent_Filter Qtyfilter = new QHMobile.QHBinContent.QHBinContent_Filter();
                        ////Qtyfilter.Field = QHMobile.QHBinContent.QHBinContent_Fields.Quantity_Base;
                        ////Qtyfilter.Criteria = "<>0";

                        //QHBinContent.QHBinContent_Filter itemFilter = new QHMobile.QHBinContent.QHBinContent_Filter();
                        //itemFilter.Field = QHMobile.QHBinContent.QHBinContent_Fields.Item_No;
                        //itemFilter.Criteria = itemtemp;

                        //filterArr.Add(binfilter);
                        ////filterArr.Add(Qtyfilter);
                        //filterArr.Add(itemFilter);

                        //QHBinContent.QHBinContent[] qhbincon = qhsev.ReadMultiple(filterArr.ToArray(), null, 5);

                        if (flagtemp == true) //qhbincon[0].Quantity_Base < countotal ||
                        {
                            //  qhfun.TankAdj_NAV(itemtemp, packworksheet, locationtemp, bincodetemp, countotal, flagtemp);
                            //qhfun.TankAdj_NAV(itemtemp, packworksheet, locationtemp, bincodetemp, countotal);

                            QHEmptyTank.QHEmptyTank_Service qhempty = new QHMobile.QHEmptyTank.QHEmptyTank_Service();
                            qhempty.Url         = WebServiceInstants.GetURL(ServiceType.QHEmptyTank);
                            qhempty.Credentials = nc;

                            QHEmptyTank.QHEmptyTank qhcheck = qhempty.Read(bincodetemp);
                            if (qhcheck == null)
                            {
                                QHEmptyTank.QHEmptyTank qhtnk = new QHMobile.QHEmptyTank.QHEmptyTank();
                                qhtnk.Bin_Code = bincodetemp;
                                qhempty.Create(ref qhtnk);


                                qhtnk.Batch_Name    = qhsaleGet[0].Change_Size_Batch;
                                qhtnk.Item_No       = itemtemp;
                                qhtnk.Location_Code = locationtemp;
                                qhempty.Update(ref qhtnk);
                            }
                        }
                        //else if (qhbincon[0].Quantity - qhbincon[0].PDA_Inv_Pick_Quantity < countotal)
                        //{
                        //    QH_Functions.QH_Functions qhfun = new QHMobile.QH_Functions.QH_Functions();
                        //    qhfun.Url = WebServiceInstants.GetURL(ServiceType.QH_Functions);
                        //    qhfun.Credentials = nc;
                        //    decimal updatecount = countotal - (qhbincon[0].Quantity - qhbincon[0].PDA_Inv_Pick_Quantity);
                        //    qhfun.InsertIJLPositiveAdjustment(itemtemp, "", locationtemp, bincodetemp, updatecount);
                        //    //qhfun.TankAdj_NAV(itemtemp, "", locationtemp, bincodetemp, countotal, flagtemp);
                        //}
                    }

                    //// to adjust ////
                    CompactSQL comsql = new CompactSQL();
                    comsql.deleteRecord("ChangeSize");

                    MessageBox.Show("Submitted.");


                    this.Close();
                    DailyLossTS dilts = new DailyLossTS(staffname, staffdim, stafflevel);
                    dilts.Show();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error:" + ex);
                }
                Cursor.Current = Cursors.Default;

                //DailyLossTS dts = new DailyLossTS(staffname, staffdim, stafflevel);
            }
        }
Пример #27
0
        private void btnAdd_Click_1(object sender, EventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                Object[]            array    = new Object[4];
                PurchaseOrderModule pomodule = new PurchaseOrderModule();

                array[0] = txtItemNo.Text.Trim();
                //SQL to save
                Object[] arraySQL = new Object[7];
                pomodule.itemno = txtItemNo.Text.Trim();
                arraySQL[0]     = txtVendorNo.Text.Trim();
                arraySQL[1]     = txtVendorName.Text.Trim();
                arraySQL[2]     = txtRegDate.Text.Trim();
                arraySQL[3]     = txtLocation.Text.Trim();
                arraySQL[4]     = txtItemNo.Text.Trim();
                arraySQL[6]     = Convert.ToInt32(txtQty.Text.Trim());


                if (!String.IsNullOrEmpty(txtItemNo.Text.Trim()))
                {
                    ItemQH.ItemQH_Service itemsev = new QHMobile.ItemQH.ItemQH_Service();
                    itemsev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                    itemsev.Credentials = nc;

                    ItemQH.ItemQH itemdescription = itemsev.Read(txtItemNo.Text.Trim());
                    string        strItemDescription;
                    strItemDescription       = itemdescription.Description;
                    pomodule.itemDescription = strItemDescription;
                    array[1]    = strItemDescription;
                    arraySQL[5] = strItemDescription;
                }
                else
                {
                    arraySQL[5] = "";
                    pomodule.itemDescription = "";
                    array[1] = "";
                }


                array[2]          = txtLocation.Text.Trim();
                pomodule.location = txtLocation.Text.Trim();
                array[3]          = txtQty.Text.Trim();
                pomodule.quantity = txtQty.Text.Trim();


                PoArray.Add(pomodule);
                dt.Rows.Add(array);

                CompactSQL comsql = new CompactSQL();
                comsql.InsertRecord("PurchaseOrder", arraySQL);

                /*
                 *  GrdPO.DataSource = dt;
                 *
                 *
                 *  txtItemNo.Text = "";
                 *  txtItemNo.Focus();
                 *  txtLocation.Enabled = false;
                 *  txtRegDate.Enabled = false;
                 *  txtQty.Enabled = false;
                 */

                //dffd

                getdata = comsql.SelectRecord("PurchaseOrder");
                GetSQLData(getdata, false);

                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error:" + ex);
                Cursor.Current = Cursors.Default;
            }
        }
Пример #28
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);
            }
        }
Пример #29
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (cboEntryType.SelectedText.Equals("Positive Adjmt.") && chkEmpty.Checked == true)
                {
                    MessageBox.Show("PDA: You cannot now allow to empty the bin in positive state.");
                }
                else
                {
                    if (count == 0)
                    {
                        if (!string.IsNullOrEmpty(txtItemNo.Text.Trim()) && !string.IsNullOrEmpty(txtBinCode.Text.Trim()) && !string.IsNullOrEmpty(txtLocation.Text.Trim()) && !string.IsNullOrEmpty(txtQuantity.Text.Trim()) && !txtQuantity.Text.Trim().Equals("0"))
                        //if (!txtItemNo.Text.Equals("") && !txtBinCode.Text.Equals("") && !txtLocation.Text.Equals("") && !txtQuantity.Text.Equals(""))
                        {
                            bool isNum = IsItNumber(txtQuantity.Text.Trim());

                            if (isNum)
                            {
                                bool flagLocation = LocationValidating();

                                bool flagItem = ItemValidating();

                                if (flagLocation == true && flagItem == true)
                                {
                                    DailyLossFormTS insert = new DailyLossFormTS();
                                    Object[]        array  = new Object[9];

                                    insert.itemno         = txtItemNo.Text.Trim();
                                    array[0]              = txtItemNo.Text.Trim();
                                    insert.entrytype      = cboEntryType.Text.Trim();
                                    array[1]              = txtDescription.Text.Trim();
                                    insert.description    = txtDescription.Text.Trim();
                                    array[2]              = cboEntryType.Text.Trim();
                                    insert.location       = txtLocation.Text.Trim();
                                    array[3]              = txtLocation.Text.Trim();
                                    insert.bincode        = txtBinCode.Text.Trim();
                                    array[4]              = txtBinCode.Text.Trim();
                                    insert.quantity       = txtQuantity.Text.Trim();
                                    array[5]              = txtQuantity.Text.Trim();
                                    insert.staffdimension = staffdim;
                                    array[6]              = staffdim;
                                    insert.postdate       = txtPostingDate.Text.Trim();
                                    array[7]              = Convert.ToDateTime(txtPostingDate.Text.Trim());
                                    if (chkEmpty.Checked)
                                    {
                                        array[8] = true;
                                    }
                                    else
                                    {
                                        array[8] = false;
                                    }
                                    dl_array.Add(insert);
                                    dt.Rows.Add(array);
                                    lblCount.Text = dt.Rows.Count.ToString();

                                    //tempthu
                                    CompactSQL comsql = new CompactSQL();
                                    comsql.InsertRecord("ChangeSize", array);

                                    getdata = comsql.SelectRecord("ChangeSize"); //test3
                                    GetSQLData(getdata);                         //test3
                                    CallBindGrid();
                                    //tempthu
                                    //CompactSQL comsql = new CompactSQL();
                                    //comsql.InsertRecord("ChangeSize", array);
                                }
                                else
                                {
                                    if (flagLocation == false)
                                    {
                                        BinQH.BinQH_Service binservice = new QHMobile.BinQH.BinQH_Service();
                                        binservice.Url         = WebServiceInstants.GetURL(ServiceType.BinQH);
                                        binservice.Credentials = nc;

                                        List <BinQH.BinQH_Filter> filterArr = new List <QHMobile.BinQH.BinQH_Filter>();

                                        BinQH.BinQH_Filter bincodefilter = new QHMobile.BinQH.BinQH_Filter();
                                        bincodefilter.Field    = QHMobile.BinQH.BinQH_Fields.Code;
                                        bincodefilter.Criteria = txtBinCode.Text.Trim();

                                        filterArr.Add(bincodefilter);


                                        BinQH.BinQH[] binqhget = binservice.ReadMultiple(filterArr.ToArray(), null, 3);

                                        if (binqhget.Length == 0)
                                        {
                                            MessageBox.Show("Location and Bin is not found.");
                                            txtItemNo.SelectAll();
                                            txtItemNo.Focus();
                                        }
                                        else
                                        {
                                            DailyLossFormTS insert = new DailyLossFormTS();
                                            Object[]        array  = new Object[9];

                                            insert.itemno         = txtItemNo.Text.Trim();
                                            array[0]              = txtItemNo.Text.Trim();
                                            insert.entrytype      = cboEntryType.Text.Trim();
                                            array[1]              = txtDescription.Text.Trim();
                                            insert.description    = txtDescription.Text.Trim();
                                            array[2]              = cboEntryType.Text.Trim();
                                            insert.location       = txtLocation.Text.Trim();
                                            array[3]              = txtLocation.Text.Trim();
                                            insert.bincode        = txtBinCode.Text.Trim();
                                            array[4]              = txtBinCode.Text.Trim();
                                            insert.quantity       = txtQuantity.Text.Trim();
                                            array[5]              = txtQuantity.Text.Trim();
                                            insert.staffdimension = staffdim;
                                            array[6]              = staffdim;
                                            insert.postdate       = txtPostingDate.Text.Trim();
                                            array[7]              = Convert.ToDateTime(txtPostingDate.Text.Trim());
                                            if (chkEmpty.Checked)
                                            {
                                                array[8] = true;
                                            }
                                            else
                                            {
                                                array[8] = false;
                                            }
                                            dl_array.Add(insert);
                                            dt.Rows.Add(array);
                                            lblCount.Text = dt.Rows.Count.ToString();

                                            //tempthu
                                            CompactSQL comsql = new CompactSQL();
                                            comsql.InsertRecord("ChangeSize", array);

                                            getdata = comsql.SelectRecord("ChangeSize"); //test3
                                            GetSQLData(getdata);                         //test3
                                            CallBindGrid();
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            MessageBox.Show("All fields are required to enter.");
                        }

                        count = count + 1;
                        txtItemNo.SelectAll();
                        txtItemNo.Focus();
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(txtItemNo.Text.Trim()) && !string.IsNullOrEmpty(txtBinCode.Text.Trim()) && !string.IsNullOrEmpty(txtLocation.Text.Trim()) && !string.IsNullOrEmpty(txtQuantity.Text.Trim()) && !txtQuantity.Text.Trim().Equals("0"))
                        {
                            bool isNum = IsItNumber(txtQuantity.Text.Trim());

                            if (isNum)
                            {
                                // bool flagLocation = LocationValidating();

                                bool flagItem = ItemValidating();

                                if (flagItem == true)
                                {
                                    count = 0;

                                    DailyLossFormTS insert = new DailyLossFormTS();
                                    Object[]        array  = new Object[9];

                                    insert.itemno         = txtItemNo.Text.Trim();
                                    array[0]              = txtItemNo.Text.Trim();
                                    insert.entrytype      = cboEntryType.Text.Trim();
                                    array[1]              = txtDescription.Text.Trim();
                                    insert.description    = txtDescription.Text.Trim();
                                    array[2]              = cboEntryType.Text.Trim();
                                    insert.location       = txtLocation.Text.Trim();
                                    array[3]              = txtLocation.Text.Trim();
                                    insert.bincode        = txtBinCode.Text.Trim();
                                    array[4]              = txtBinCode.Text.Trim();
                                    insert.quantity       = txtQuantity.Text.Trim();
                                    array[5]              = txtQuantity.Text.Trim();
                                    insert.staffdimension = staffdim;
                                    array[6]              = staffdim;
                                    insert.postdate       = txtPostingDate.Text.Trim();
                                    array[7]              = Convert.ToDateTime(txtPostingDate.Text.Trim());
                                    if (chkEmpty.Checked)
                                    {
                                        array[8] = true;
                                    }
                                    else
                                    {
                                        array[8] = false;
                                    }

                                    dl_array.Add(insert);
                                    dt.Rows.Add(array);
                                    lblCount.Text = dt.Rows.Count.ToString();
                                    CallBindGrid();

                                    //CompactSQL comsql = new CompactSQL();
                                    //comsql.InsertRecord("ChangeSize", array);

                                    //tempthu
                                    CompactSQL comsql = new CompactSQL();
                                    comsql.InsertRecord("ChangeSize", array);

                                    getdata = comsql.SelectRecord("ChangeSize"); //test3
                                    GetSQLData(getdata);                         //test3
                                    CallBindGrid();
                                    //tempthu
                                }
                                else
                                {
                                    if (flagItem == false)
                                    {
                                        MessageBox.Show("Item is not found.");
                                        txtItemNo.Focus();
                                    }
                                }
                            }
                        }
                        else
                        {
                            MessageBox.Show("All fields are required to enter.");
                        }
                    }

                    if (count == 1)
                    {
                        // txtBinCode.Enabled = false;
                        //txtItemNo.Enabled = true;
                        txtLocation.Enabled = false;
                        cboEntryType.Text   = cboEntryType.Items[0].ToString();
                    }
                    else
                    {
                        txtBinCode.Enabled  = true;
                        txtBinCode.Text     = "";
                        txtItemNo.Enabled   = true;
                        txtItemNo.Text      = "";
                        txtLocation.Enabled = true;
                        txtLocation.Text    = "";
                        txtQuantity.Text    = "";
                        txtBinCode.Focus();
                        cboEntryType.Text = cboEntryType.Items[1].ToString();
                    }
                    Cursor.Current = Cursors.Default;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Cursor.Current = Cursors.Default;
            }
        }
Пример #30
0
        private void GetSQLData(SqlCeDataReader getdata, bool bShow)
        {
            //tableJournal.Clear();
            //journalarray.Clear();
            //while (getdata.Read())
            //{

            //}
            //BindTOGrid();

            try
            {
                PoArray.Clear();
                dt.Clear();
                while (getdata.Read())
                {
                    Object[]            array    = new Object[5];
                    PurchaseOrderModule pomodule = new PurchaseOrderModule();
                    array[0]        = getdata["ItemNo"].ToString();
                    pomodule.itemno = getdata["ItemNo"].ToString();
                    if (!String.IsNullOrEmpty(getdata["ItemNo"].ToString()))
                    {
                        ItemQH.ItemQH_Service itemsev = new QHMobile.ItemQH.ItemQH_Service();
                        itemsev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                        itemsev.Credentials = nc;

                        ItemQH.ItemQH itemdescription = itemsev.Read(getdata["ItemNo"].ToString());
                        string        strItemDescription;
                        strItemDescription       = itemdescription.Description;
                        pomodule.itemDescription = strItemDescription;
                        array[1] = strItemDescription;
                    }
                    else
                    {
                        pomodule.itemDescription = "";
                        array[1] = "";
                    }


                    array[2]          = getdata["Loc"].ToString();
                    pomodule.location = getdata["Loc"].ToString();
                    array[3]          = Convert.ToInt32(getdata["Quantity"]);
                    pomodule.quantity = getdata["Quantity"].ToString();
                    array[4]          = Convert.ToInt32(getdata["LineNo"]);
                    PoArray.Add(pomodule);
                    dt.Rows.Add(array);


                    if (bShow)
                    {
                        txtVendorNo.Text   = getdata["VendorNo"].ToString().Trim();
                        txtVendorName.Text = getdata["VendorName"].ToString().Trim();
                    }
                }

                GrdPO.DataSource = dt;

                txtItemNo.Text = "";
                txtItemNo.Focus();
                txtLocation.Enabled = false;
                txtRegDate.Enabled  = false;
                txtQty.Enabled      = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error:" + ex);
            }
        }