Esempio n. 1
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);
     }
 }
Esempio n. 2
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;
            }
        }
Esempio n. 3
0
        private void txtBinCode_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    Cursor.Current = Cursors.WaitCursor;

                    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();
                    }

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

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


                    filterArray.Add(filter);
                    filterArray.Add(filterPCS);
                    filterArray.Add(filterBaseQty);

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

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


                    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!");
                        }

                        else
                        {
                            txtLocation.Text    = qhbin[0].Location_Code;
                            txtItemNo.Text      = qhbin[0].Item_No;
                            txtQuantity.Text    = "0";//qhbin[0].Quantity_Base.ToString();
                            txtPostingDate.Text = DateTime.Now.ToShortDateString();


                            txtQuantity.Enabled    = true;
                            txtPostingDate.Enabled = true;
                            txtBinCode.Enabled     = false;

                            if ((qhbin[0].Location_Code.ToString() != "RT1") || (qhbin[0].Location_Code.ToString() != "LS1"))
                            {
                                txtItemNo.Enabled = true;
                            }
                        }

                        txtQuantity.SelectAll();
                        txtQuantity.Focus();
                    }
                    else
                    {
                        List <BinQH.BinQH_Filter> filterBinArr = new List <QHMobile.BinQH.BinQH_Filter>();

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

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

                        filterBinArr.Add(binfilter);

                        BinQH.BinQH[] bingetlist = binsev.ReadMultiple(filterBinArr.ToArray(), null, 3);

                        if (bingetlist.Length != 0)
                        {
                            txtLocation.Text    = bingetlist[0].Location_Code;
                            txtItemNo.Text      = "";
                            txtQuantity.Text    = "0";//qhbin[0].Quantity_Base.ToString();
                            txtPostingDate.Text = DateTime.Now.ToShortDateString();
                            txtItemNo.Enabled   = true;
                            txtQuantity.Enabled = true;
                            txtItemNo.Focus();
                        }
                        else
                        {
                            MessageBox.Show("Bin Not found!");
                            txtItemNo.Text = "";
                        }
                    }


                    Cursor.Current = Cursors.Default;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Esempio n. 4
0
        private void txtFromBin_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    Cursor.Current = Cursors.WaitCursor;
                    QHBinContent.QHBinContent_Service binserv = new QHMobile.QHBinContent.QHBinContent_Service();
                    binserv.Url         = WebServiceInstants.GetURL(ServiceType.QHBinContent);
                    binserv.Credentials = nc;

                    List <QHBinContent.QHBinContent_Filter> listarray = new List <QHMobile.QHBinContent.QHBinContent_Filter>();
                    QHBinContent.QHBinContent_Filter        filterqh  = new QHMobile.QHBinContent.QHBinContent_Filter();
                    filterqh.Field = QHMobile.QHBinContent.QHBinContent_Fields.Bin_Code;

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

                    listarray.Add(filterqh);

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

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



                    QHBinContent.QHBinContent[] qhbin = binserv.ReadMultiple(listarray.ToArray(), null, 0);


                    if (qhbin.Length != 0)
                    {
                        ItemQH.ItemQH_Service itemSev = new QHMobile.ItemQH.ItemQH_Service();
                        itemSev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                        itemSev.Credentials = nc;

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

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

                        BinQH.BinQH bincheck = binqhsev.Read(qhbin[0].Location_Code, txtFromBin.Text.Trim());

                        //if (bincheck.Block_Movement == QHMobile.BinQH.Block_Movement.All)
                        //{
                        //    MessageBox.Show("This bin is blocked!Please try again.");
                        //    txtFromBin.SelectAll();
                        //    txtFromBin.Focus();
                        //}
                        //else
                        //{
                        txtItemNo.Text       = qhbin[0].Item_No;
                        lblInfoLocation.Text = qhbin[0].Location_Code;
                        textBox1.Text        = (qhbin[0].Quantity - qhbin[0].PDA_Inv_Pick_Quantity).ToString();


                        txtFishDescription.Text = item.Description;

                        //Cursor.Current = Cursors.Default;

                        txtToBin.Focus();
                        //}
                    }
                    else
                    {
                        BinQH.BinQH_Service binqhsev = new QHMobile.BinQH.BinQH_Service();
                        binqhsev.Url         = WebServiceInstants.GetURL(ServiceType.BinQH);
                        binqhsev.Credentials = nc;

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

                        BinQH.BinQH_Filter binfitler = new QHMobile.BinQH.BinQH_Filter();
                        binfitler.Field    = QHMobile.BinQH.BinQH_Fields.Code;
                        binfitler.Criteria = txtFromBin.Text.Trim();


                        filterArray.Add(binfitler);

                        BinQH.BinQH[] bincheck = binqhsev.ReadMultiple(filterArray.ToArray(), null, 0);

                        if (bincheck.Length > 0)
                        {
                            lblInfoLocation.Text = bincheck[0].Location_Code;
                            txtItemNo.Focus();
                        }
                        else
                        {
                            MessageBox.Show("Bin Not Found!");
                            txtFromBin.Text = "";
                            txtFromBin.Focus();
                        }
                    }
                }

                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 5
0
        private bool GotoBinvalidation()
        {
            BinQH.BinQH_Service binServ = new QHMobile.BinQH.BinQH_Service();
            binServ.Url         = WebServiceInstants.GetURL(ServiceType.BinQH);
            binServ.Credentials = nc;

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

            List <QHBinContent.QHBinContent_Filter> ContentArray = new List <QHBinContent.QHBinContent_Filter>();

            QHBinContent.QHBinContent_Filter contentfilter = new QHMobile.QHBinContent.QHBinContent_Filter();
            if (!string.IsNullOrEmpty(lblInfoLocation.Text.ToString()))
            {
                contentfilter.Field    = QHMobile.QHBinContent.QHBinContent_Fields.Location_Code;
                contentfilter.Criteria = lblInfoLocation.Text.ToString();
            }
            else
            {
                contentfilter.Criteria = "QH1";
            }

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

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

            ContentArray.Add(contentfilter);
            ContentArray.Add(binfilter);
            ContentArray.Add(qtyfilter);


            BinQH.BinQH frombinqh;
            BinQH.BinQH tobinqh;
            if (!string.IsNullOrEmpty(lblInfoLocation.Text.ToString()))
            {
                //BinQH.BinQH
                frombinqh = binServ.Read(lblInfoLocation.Text.ToString(), txtFromBin.Text.Trim());
                //BinQH.BinQH
                tobinqh = binServ.Read(lblInfoLocation.Text.ToString(), txtToBin.Text.Trim());
            }
            else
            {
                //BinQH.BinQH
                frombinqh = binServ.Read("QH1", txtFromBin.Text.Trim());
                //BinQH.BinQH
                tobinqh = binServ.Read("QH1", txtToBin.Text.Trim());
            }


            QHBinContent.QHBinContent[] qhbincontent = contentSev.ReadMultiple(ContentArray.ToArray(), null, 0);
            if (!tobinqh.Empty)
            {
                if (qhbincontent.Length > 0)
                {
                    ItemQH.ItemQH_Service itemsev = new QHMobile.ItemQH.ItemQH_Service();
                    itemsev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                    itemsev.Credentials = nc;

                    ItemQH.ItemQH itemdescription = itemsev.Read(qhbincontent[0].Item_No.ToString());
                    fishdescription = itemdescription.Description;
                }

                if (frombinqh != null && tobinqh != null)
                {
                    if (qhbincontent.Length > 0)
                    {
                        int notoget = 0;

                        for (int i = 0; i < qhbincontent.Length; i++)
                        {
                            if (qhbincontent[i].Quantity - qhbincontent[i].PDA_Inv_Pick_Quantity > 0)
                            {
                                notoget = i;
                            }
                        }


                        if (notoget == 0)
                        {
                            return(true);
                        }
                        else if (tobinqh.Location_Code == "QH1" && tobinqh.Empty == false && (!qhbincontent[notoget].Item_No.Equals(txtItemNo.Text.Trim())))
                        {
                            //MessageBox.Show("Bin is not empty and different Item exit. Fish description: " + fishdescription);
                            //return true;
                            return(false);
                        }

                        else if (tobinqh.Location_Code == "QH1" && tobinqh.Empty == false && qhbincontent[notoget].Item_No.Equals(txtItemNo.Text.Trim()))
                        {
                            MessageBox.Show("Bin is not empty and Same Item. Fish description: " + fishdescription);
                            return(true);
                            //return false;
                        }
                        else
                        {
                            //return false;
                            return(true);
                        }
                    }
                    else
                    {
                        if (tobinqh.Empty == false)
                        {
                            MessageBox.Show("Bin is not empty");
                            return(false);
                        }
                        else
                        {
                            //return false;
                            return(true);
                        }
                    }
                }
                else
                {
                    if (frombinqh == null)
                    {
                        MessageBox.Show("Location is not found. Check your From location and From Bin.");
                    }
                    else
                    {
                        MessageBox.Show("Location is not found. Check your To location and To bin.");
                    }

                    return(false);
                }
            }    // IF Empty
            else
            {
                //if (tobinqh.Code == "QH1" && qhbincontent[0].Item_No.Equals(txtItemNo.Text.Trim()))
                //{
                //    MessageBox.Show("Bin is not empty and Same Item. Fish description: " + fishdescription);
                //    return true;
                //}
                //else
                //{

                //    return true;
                //}
                return(true);
            }
        }
Esempio n. 6
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (!string.IsNullOrEmpty(txtItemNo.Text.Trim()) && !string.IsNullOrEmpty(txtFromBin.Text.Trim()) && !string.IsNullOrEmpty(txtToBin.Text.Trim()))
                //if (!txtItemNo.Text.Equals("") && !txtFromBin.Text.Equals("") && !txtToBin.Text.Equals(""))
                {
                    ItemQH.ItemQH_Service iqhservice = new QHMobile.ItemQH.ItemQH_Service();
                    iqhservice.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                    iqhservice.Credentials = nc;
                    ItemQH.ItemQH iqh = iqhservice.Read(txtItemNo.Text.Trim());

                    if (iqh != null)
                    {
                        BinQH.BinQH_Service binServ = new QHMobile.BinQH.BinQH_Service();
                        binServ.Url         = WebServiceInstants.GetURL(ServiceType.BinQH);
                        binServ.Credentials = nc;

                        BinQH.BinQH tobinqh = binServ.Read(lblInfoLocation.Text.ToString(), txtToBin.Text.Trim());
                        if (tobinqh != null)
                        {
                            if (tobinqh.Block_Movement == QHMobile.BinQH.Block_Movement.All)
                            {
                                MessageBox.Show("To Bin is Blocked");
                                txtToBin.SelectAll();
                                txtToBin.Focus();
                            }
                            else
                            {
                                bool flag = GotoBinvalidation();

                                if (flag == true)
                                {
                                    InsertLines();

                                    CompactSQL comsql = new CompactSQL();         //test3

                                    getdata = comsql.SelectRecord("ItemReclass"); //test3
                                    GetSQLData(getdata);                          //test3

                                    //BindTOGrid();
                                    Cursor.Current = Cursors.Default;

                                    txtFromBin.Text         = "";
                                    txtToBin.Text           = "";
                                    textBox1.Text           = "";
                                    txtItemNo.Text          = "";
                                    txtFishDescription.Text = "";
                                    lblInfoLocation.Text    = "";
                                    chkEmpty.Checked        = false;
                                    txtFromBin.Focus();
                                }
                                else
                                {
                                    MessageBox.Show("You are not allowed to put into the bin with different item!Fish Description: " + fishdescription);
                                    txtToBin.SelectAll();
                                    txtToBin.Focus();
                                }
                            }
                        }
                        // }
//////here
                    }
                    else
                    {
                        MessageBox.Show("Invalid Item No!");
                    }
                }
                else
                {
                    MessageBox.Show("All field are required to enter.");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            Cursor.Current = Cursors.Default;
        }