Пример #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 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);
            }
        }
Пример #3
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
Пример #4
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);
            }
        }
Пример #5
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();
            }
        }
Пример #6
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;
            }
        }
Пример #7
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);
            }
        }
Пример #8
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;
            }
        }
Пример #9
0
        private void BindtoGrid()
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                if (menuValue == "0") //0= Find Empty Bin
                {
                    dt = new DataTable("EmptyBin");
                    dt.Columns.Add("BinCode");
                    dt.Columns.Add("LocationCode");
                    //dt.Columns.Add("ZoneCode");
                    // dt.Columns.Add("Vendor");
                    //List<BinQH.BinQH> Lbin = new List<QHMobile.BinQH.BinQH>();

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

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

                    //BinQH.BinQH_Filter binFilter = new QHMobile.BinQH.BinQH_Filter();
                    //if (!String.IsNullOrEmpty(txtBinNo.Text.Trim()))
                    //{
                    //    binFilter.Field = QHMobile.BinQH.BinQH_Fields.Code;
                    //    binFilter.Criteria = txtBinNo.Text.Trim();
                    //    binFilterArray.Add(binFilter);
                    //}

                    BinQH.BinQH_Filter EmptyFilter = new QHMobile.BinQH.BinQH_Filter();
                    EmptyFilter.Field    = QHMobile.BinQH.BinQH_Fields.Empty;
                    EmptyFilter.Criteria = "1";
                    binFilterArray.Add(EmptyFilter);
                    BinQH.BinQH[] BinList = binserv.ReadMultiple(binFilterArray.ToArray(), null, 0);
                    dt.Clear();
                    if (BinList.Length > 0)
                    {
                        for (int i = 0; i < BinList.Length; i++)
                        {
                            Object[] array = new Object[2];
                            array[0] = BinList[i].Code;
                            array[1] = BinList[i].Location_Code;
                            //array[2] = BinList[i].Zone_Code;

                            dt.Rows.Add(array);
                        }
                        lblCount.Text     = "(" + BinList.Length.ToString() + ")";
                        gdBins.DataSource = dt;
                        gdBins.TableStyles.Clear();
                        gdBins.TableStyles.Add(DataGridStyle(dt));
                    }
                    else
                    {
                        NoEmptyBinFound();
                    }
                    Cursor.Current = Cursors.Default;
                }//End Empty Bin
                if (menuValue == "1") //1= Find Bin Content
                {
                    dt = new DataTable("BinContent");
                    dt.Columns.Add("LocationCode");
                    dt.Columns.Add("BinCode");
                    dt.Columns.Add("ItemNo");
                    dt.Columns.Add("Description");
                    dt.Columns.Add("Description2");
                    dt.Columns.Add("Quantity");
                    dt.Columns.Add("VendorNo");
                    dt.Columns.Add("Receipt Date");
                    dt.Columns.Add("CustomerNo");

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

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

                    QHBinContent.QHBinContent_Filter filBin = new QHMobile.QHBinContent.QHBinContent_Filter();

                    if (!String.IsNullOrEmpty(txtBinNo.Text.Trim()))
                    {
                        //binFilter.Field = QHMobile.BinQH.BinQH_Fields.Code;
                        //binFilter.Criteria = txtBinNo.Text.Trim();
                        //binFilterArray.Add(binFilter);
                        filBin.Field    = QHMobile.QHBinContent.QHBinContent_Fields.Bin_Code;
                        filBin.Criteria = txtBinNo.Text.Trim();
                        filterarray.Add(filBin);
                    }

                    QHBinContent.QHBinContent[] qhBinContent;
                    if (!String.IsNullOrEmpty(txtBinNo.Text.Trim()))
                    {
                        QHBinContent.QHBinContent_Filter filterQty = new QHMobile.QHBinContent.QHBinContent_Filter();
                        filterQty.Field    = QHMobile.QHBinContent.QHBinContent_Fields.Quantity;
                        filterQty.Criteria = "<>0";
                        filterarray.Add(filterQty);


                        QHBinContent.QHBinContent_Filter filtVendorName = new QHMobile.QHBinContent.QHBinContent_Filter();
                        filtVendorName.Field    = QHMobile.QHBinContent.QHBinContent_Fields.VendorNo;
                        filtVendorName.Criteria = "<>''";
                        //filterarray.Add(filtVendorName);

                        qhBinContent = qhBinContSev.ReadMultiple(filterarray.ToArray(), null, 0);
                        //}
                        //else
                        //{
                        //    //qhBinContent = qhBinContSev.ReadMultiple(filterarray.ToArray(), null, 10);
                        //    qhBinContent = null;//thurein
                        //}
                        dt.Clear();
                        if (qhBinContent.Length > 0)
                        {
                            dt.Clear();
                            for (int i = 0; i < qhBinContent.Length; i++)
                            {
                                //if (!String.IsNullOrEmpty(qhBinContent[i].VendorNo))
                                //{
                                Object[] array = new Object[9];
                                array[0] = qhBinContent[i].Location_Code;
                                array[1] = qhBinContent[i].Bin_Code;
                                array[2] = qhBinContent[i].Item_No;
                                if (!String.IsNullOrEmpty(qhBinContent[i].Item_No.Trim()))
                                {
                                    ItemQH.ItemQH_Service itemsev = new QHMobile.ItemQH.ItemQH_Service();
                                    itemsev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                                    itemsev.Credentials = nc;

                                    ItemQH.ItemQH itemdescription = itemsev.Read(qhBinContent[i].Item_No.ToString());
                                    array[3] = itemdescription.Description;
                                    array[4] = itemdescription.Description_2;
                                }
                                else
                                {
                                    array[3] = "";
                                    array[4] = "";
                                }
                                array[5] = qhBinContent[i].Quantity - qhBinContent[i].PDA_Inv_Pick_Quantity;
                                array[6] = qhBinContent[i].VendorNo;
                                array[7] = qhBinContent[i].ReceiptDate;
                                array[8] = qhBinContent[i].CustNo;
                                dt.Rows.Add(array);
                                //}
                            }

                            lblCount.Text     = "(" + qhBinContent.Length.ToString() + ")";
                            gdBins.DataSource = dt;
                            gdBins.TableStyles.Clear();
                            gdBins.TableStyles.Add(DataGridStyleBinContent(dt));
                        }
                        else
                        {
                            NoBinContentFound();
                        }
                    }
                    Cursor.Current = Cursors.Default;
                }//END Bin Content
                if (menuValue == "2") //1= Find Bin Content by Item
                {
                    dt = new DataTable("BinContent");
                    dt.Columns.Add("LocationCode");
                    dt.Columns.Add("BinCode");
                    dt.Columns.Add("ItemNo");
                    dt.Columns.Add("Description");
                    dt.Columns.Add("Description2");
                    dt.Columns.Add("Quantity");
                    dt.Columns.Add("VendorNo");
                    dt.Columns.Add("Receipt Date");
                    dt.Columns.Add("CustomerNo");

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

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

                    QHBinContent.QHBinContent_Filter filItem = new QHMobile.QHBinContent.QHBinContent_Filter();

                    if (!String.IsNullOrEmpty(txtBinNo.Text.Trim()))
                    {
                        filItem.Field    = QHMobile.QHBinContent.QHBinContent_Fields.Item_No;
                        filItem.Criteria = txtBinNo.Text.Trim();
                        filterarray.Add(filItem);
                    }

                    QHBinContent.QHBinContent[] qhBinContent;
                    if (!String.IsNullOrEmpty(txtBinNo.Text.Trim()))
                    {
                        QHBinContent.QHBinContent_Filter filterQty = new QHMobile.QHBinContent.QHBinContent_Filter();
                        filterQty.Field    = QHMobile.QHBinContent.QHBinContent_Fields.Quantity;
                        filterQty.Criteria = "<>0";
                        filterarray.Add(filterQty);

                        //QHBinContent.QHBinContent_Filter filtVendorName = new QHMobile.QHBinContent.QHBinContent_Filter();
                        //filtVendorName.Field = QHMobile.QHBinContent.QHBinContent_Fields.VendorNo;
                        //filtVendorName.Criteria = "<>''";
                        //filterarray.Add(filtVendorName);

                        qhBinContent = qhBinContSev.ReadMultiple(filterarray.ToArray(), null, 0);

                        //else
                        //{
                        //    //qhBinContent = qhBinContSev.ReadMultiple(filterarray.ToArray(), null, 10);
                        //    qhBinContent = null;//thurein
                        //}
                        dt.Clear();
                        if (qhBinContent.Length > 0)
                        {
                            dt.Clear();
                            for (int i = 0; i < qhBinContent.Length; i++)
                            {
                                //if (!String.IsNullOrEmpty(qhBinContent[i].VendorNo))
                                //{

                                Object[] array = new Object[9];
                                array[0] = qhBinContent[i].Location_Code;
                                array[1] = qhBinContent[i].Bin_Code;
                                array[2] = qhBinContent[i].Item_No;
                                if (!String.IsNullOrEmpty(qhBinContent[i].Item_No.Trim()))
                                {
                                    ItemQH.ItemQH_Service itemsev = new QHMobile.ItemQH.ItemQH_Service();
                                    itemsev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                                    itemsev.Credentials = nc;

                                    ItemQH.ItemQH itemdescription = itemsev.Read(qhBinContent[i].Item_No.ToString());
                                    array[3] = itemdescription.Description;
                                    array[4] = itemdescription.Description_2;
                                }
                                else
                                {
                                    array[3] = "";
                                    array[4] = "";
                                }
                                array[5] = qhBinContent[i].Quantity - qhBinContent[i].PDA_Inv_Pick_Quantity;
                                array[6] = qhBinContent[i].VendorNo;
                                array[7] = qhBinContent[i].ReceiptDate;
                                array[8] = qhBinContent[i].CustNo;
                                dt.Rows.Add(array);
                                // }
                            }

                            lblCount.Text     = "(" + qhBinContent.Length.ToString() + ")";
                            gdBins.DataSource = dt;
                            gdBins.TableStyles.Clear();
                            gdBins.TableStyles.Add(DataGridStyleBinContent(dt));
                        }
                        else
                        {
                            NoBinContentFound();
                        }
                    }
                    Cursor.Current = Cursors.Default;
                }
                if (menuValue == "3")
                {
                    dt = new DataTable("DailyLoss");
                    dt.Columns.Add("Location");
                    dt.Columns.Add("ItemNo");
                    dt.Columns.Add("Description");
                    dt.Columns.Add("Description2");
                    dt.Columns.Add("Quantity");
                    dt.Columns.Add("Date");

                    QHItemJournalLine.QHItemJournalLine_Service qhjnlSev = new QHMobile.QHItemJournalLine.QHItemJournalLine_Service();
                    qhjnlSev.Url         = WebServiceInstants.GetURL(ServiceType.QHItemJournalLine);
                    qhjnlSev.Credentials = nc;

                    List <QHItemJournalLine.QHItemJournalLine_Filter> filterJNLArray = new List <QHMobile.QHItemJournalLine.QHItemJournalLine_Filter>();

                    QHItemJournalLine.QHItemJournalLine_Filter qhfilterBin = new QHMobile.QHItemJournalLine.QHItemJournalLine_Filter();
                    qhfilterBin.Field = QHMobile.QHItemJournalLine.QHItemJournalLine_Fields.Bin_Code;

                    if (!String.IsNullOrEmpty(txtBinNo.Text.Trim()))
                    {
                        qhfilterBin.Criteria = txtBinNo.Text.Trim();
                    }

                    QHItemJournalLine.QHItemJournalLine_Filter filterqty = new QHMobile.QHItemJournalLine.QHItemJournalLine_Filter();
                    filterqty.Field    = QHMobile.QHItemJournalLine.QHItemJournalLine_Fields.Quantity;
                    filterqty.Criteria = "<>0";

                    QHItemJournalLine.QHItemJournalLine_Filter filterbatch = new QHMobile.QHItemJournalLine.QHItemJournalLine_Filter();
                    filterbatch.Field    = QHMobile.QHItemJournalLine.QHItemJournalLine_Fields.Journal_Batch_Name;
                    filterbatch.Criteria = "DOA";

                    QHItemJournalLine.QHItemJournalLine_Filter filterPostingDate = new QHMobile.QHItemJournalLine.QHItemJournalLine_Filter();
                    filterPostingDate.Field    = QHMobile.QHItemJournalLine.QHItemJournalLine_Fields.Posting_Date;
                    filterPostingDate.Criteria = txtFromDate.Text.Trim() + ".." + txtToDate.Text.Trim();

                    filterJNLArray.Add(qhfilterBin);
                    filterJNLArray.Add(filterqty);
                    filterJNLArray.Add(filterbatch);
                    filterJNLArray.Add(filterPostingDate);

                    QHItemJournalLine.QHItemJournalLine[] getJNLlines = qhjnlSev.ReadMultiple(filterJNLArray.ToArray(), null, 0);

                    dt.Clear();

                    if (getJNLlines.Length > 0)
                    {
                        dt.Clear();
                        for (int i = 0; i < getJNLlines.Length; i++)
                        {
                            Object[] array = new Object[6];
                            array[0] = getJNLlines[i].Location_Code;
                            array[1] = getJNLlines[i].Item_No;

                            if (!String.IsNullOrEmpty(getJNLlines[i].Item_No.Trim()))
                            {
                                ItemQH.ItemQH_Service itemsev = new QHMobile.ItemQH.ItemQH_Service();
                                itemsev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                                itemsev.Credentials = nc;

                                ItemQH.ItemQH itemdescription = itemsev.Read(getJNLlines[i].Item_No.ToString());
                                array[2] = itemdescription.Description;
                                array[3] = itemdescription.Description_2;
                            }


                            array[4] = getJNLlines[i].Quantity;
                            array[5] = getJNLlines[i].Posting_Date;


                            dt.Rows.Add(array);
                        }

                        //lblCount.Text = "(" + qhBinContent.Length.ToString() + ")";
                        gdBins.DataSource = dt;
                        gdBins.TableStyles.Clear();
                        gdBins.TableStyles.Add(DataGridStyleDailyLoss(dt));
                    }

                    QHWarehouseEntry.QHWarehouseEntry_Service waresev = new QHMobile.QHWarehouseEntry.QHWarehouseEntry_Service();
                    waresev.Url         = WebServiceInstants.GetURL(ServiceType.QHWarehouseEntry);
                    waresev.Credentials = nc;

                    List <QHWarehouseEntry.QHWarehouseEntry_Filter> filterWarehouseArray = new List <QHMobile.QHWarehouseEntry.QHWarehouseEntry_Filter>();

                    QHWarehouseEntry.QHWarehouseEntry_Filter warehousebin = new QHMobile.QHWarehouseEntry.QHWarehouseEntry_Filter();
                    warehousebin.Field = QHMobile.QHWarehouseEntry.QHWarehouseEntry_Fields.Bin_Code;
                    if (!String.IsNullOrEmpty(txtBinNo.Text.Trim()))
                    {
                        warehousebin.Criteria = txtBinNo.Text.Trim();
                    }
                    filterWarehouseArray.Add(warehousebin);

                    QHWarehouseEntry.QHWarehouseEntry_Filter warehouseqty = new QHMobile.QHWarehouseEntry.QHWarehouseEntry_Filter();
                    warehouseqty.Field    = QHMobile.QHWarehouseEntry.QHWarehouseEntry_Fields.Quantity;
                    warehouseqty.Criteria = "<>0";
                    filterWarehouseArray.Add(warehouseqty);

                    QHWarehouseEntry.QHWarehouseEntry_Filter warehousebatch = new QHMobile.QHWarehouseEntry.QHWarehouseEntry_Filter();
                    warehousebatch.Field    = QHMobile.QHWarehouseEntry.QHWarehouseEntry_Fields.Journal_Batch_Name;
                    warehousebatch.Criteria = "DOA";
                    filterWarehouseArray.Add(warehousebatch);

                    QHWarehouseEntry.QHWarehouseEntry_Filter filterWHRegDate = new QHMobile.QHWarehouseEntry.QHWarehouseEntry_Filter();
                    filterWHRegDate.Field    = QHMobile.QHWarehouseEntry.QHWarehouseEntry_Fields.Registering_Date;
                    filterWHRegDate.Criteria = txtFromDate.Text.Trim() + ".." + txtToDate.Text.Trim();
                    filterWarehouseArray.Add(filterWHRegDate);

                    QHWarehouseEntry.QHWarehouseEntry[] getWarehouseList = waresev.ReadMultiple(filterWarehouseArray.ToArray(), null, 0);

                    if (getWarehouseList.Length > 0)
                    {
                        for (int k = 0; k < getWarehouseList.Length; k++)
                        {
                            Object[] array = new Object[5];
                            array[0] = getWarehouseList[k].Location_Code;
                            array[1] = getWarehouseList[k].Item_No;
                            if (!String.IsNullOrEmpty(getWarehouseList[k].Item_No.Trim()))
                            {
                                ItemQH.ItemQH_Service itemsev = new QHMobile.ItemQH.ItemQH_Service();
                                itemsev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                                itemsev.Credentials = nc;

                                ItemQH.ItemQH itemdescription = itemsev.Read(getWarehouseList[k].Item_No.ToString());
                                array[2] = itemdescription.Description;
                            }

                            array[3] = getWarehouseList[k].Quantity;
                            array[4] = getWarehouseList[k].Registering_Date; // suppposed to be posting date
                            dt.Rows.Add(array);
                        }

                        //lblCount.Text = "(" + qhBinContent.Length.ToString() + ")";
                        gdBins.DataSource = dt;
                        gdBins.TableStyles.Clear();
                        gdBins.TableStyles.Add(DataGridStyleDailyLoss(dt));
                    }

                    int totalcount = getJNLlines.Length + getWarehouseList.Length;

                    lblCount.Text = "(" + totalcount + ")";

                    //END Bin Content by Item

                    Cursor.Current = Cursors.Default;
                }
                if (menuValue == "4")
                {
                    DataTable dt = new DataTable("DailyLoss");
                    dt.Columns.Add("Location");
                    dt.Columns.Add("ItemNo");
                    dt.Columns.Add("Description");
                    dt.Columns.Add("Description2");
                    dt.Columns.Add("Quantity");
                    dt.Columns.Add("ReferenceNo"); // Reference No
                    dt.Columns.Add("VendorNo");
                    dt.Columns.Add("ReceiptDate");
                    dt.Columns.Add("CustomerNo");

                    QHWarehouseEntry.QHWarehouseEntry_Service waresev = new QHMobile.QHWarehouseEntry.QHWarehouseEntry_Service();
                    waresev.Url         = WebServiceInstants.GetURL(ServiceType.QHWarehouseEntry);
                    waresev.Credentials = nc;

                    List <QHWarehouseEntry.QHWarehouseEntry_Filter> filterWarehouseArray = new List <QHMobile.QHWarehouseEntry.QHWarehouseEntry_Filter>();

                    QHWarehouseEntry.QHWarehouseEntry_Filter warehousebin = new QHMobile.QHWarehouseEntry.QHWarehouseEntry_Filter();
                    warehousebin.Field = QHMobile.QHWarehouseEntry.QHWarehouseEntry_Fields.Bin_Code;
                    if (!String.IsNullOrEmpty(txtBinNo.Text.Trim()))
                    {
                        warehousebin.Criteria = txtBinNo.Text.Trim();
                    }
                    filterWarehouseArray.Add(warehousebin);

                    QHWarehouseEntry.QHWarehouseEntry_Filter warehouseqty = new QHMobile.QHWarehouseEntry.QHWarehouseEntry_Filter();
                    warehouseqty.Field    = QHMobile.QHWarehouseEntry.QHWarehouseEntry_Fields.Quantity;
                    warehouseqty.Criteria = "<>0";
                    filterWarehouseArray.Add(warehouseqty);

                    QHWarehouseEntry.QHWarehouseEntry_Filter warehousebatch = new QHMobile.QHWarehouseEntry.QHWarehouseEntry_Filter();
                    warehousebatch.Field    = QHMobile.QHWarehouseEntry.QHWarehouseEntry_Fields.Journal_Batch_Name;
                    warehousebatch.Criteria = "<>DOA";
                    filterWarehouseArray.Add(warehousebatch);

                    QHWarehouseEntry.QHWarehouseEntry_Filter filterWHRegDate = new QHMobile.QHWarehouseEntry.QHWarehouseEntry_Filter();
                    filterWHRegDate.Field    = QHMobile.QHWarehouseEntry.QHWarehouseEntry_Fields.Registering_Date;
                    filterWHRegDate.Criteria = txtFromDate.Text.Trim() + ".." + txtToDate.Text.Trim();
                    filterWarehouseArray.Add(filterWHRegDate);

                    QHWarehouseEntry.QHWarehouseEntry[] getWarehouseList = waresev.ReadMultiple(filterWarehouseArray.ToArray(), null, 0);

                    //dt.Clear();
                    //dt.Rows.Clear();

                    if (getWarehouseList.Length > 0)
                    {
                        //  dt.Clear();


                        for (int k = 0; k < getWarehouseList.Length; k++)
                        {
                            Object[] array = new Object[9];
                            array[0] = getWarehouseList[k].Location_Code;
                            array[1] = getWarehouseList[k].Item_No;
                            if (!String.IsNullOrEmpty(getWarehouseList[k].Item_No.Trim()))
                            {
                                ItemQH.ItemQH_Service itemsev = new QHMobile.ItemQH.ItemQH_Service();
                                itemsev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                                itemsev.Credentials = nc;

                                ItemQH.ItemQH itemdescription = itemsev.Read(getWarehouseList[k].Item_No.ToString());
                                array[2] = itemdescription.Description;
                                array[3] = itemdescription.Description_2;
                            }

                            array[4] = getWarehouseList[k].Quantity;
                            array[5] = getWarehouseList[k].Reference_No; // suppposed to be posting date
                            array[6] = getWarehouseList[k].VendorNo;
                            array[7] = getWarehouseList[k].ReceiptDate;
                            array[8] = getWarehouseList[k].CustNo;
                            dt.Rows.Add(array);
                        }

                        //lblCount.Text = "(" + qhBinContent.Length.ToString() + ")";
                        gdBins.DataSource = dt;
                        gdBins.TableStyles.Clear();
                        gdBins.TableStyles.Add(DataGridStyleDailyLoss(dt));
                    }
                    else
                    {
                        dt = null;
                        gdBins.DataSource = dt;
                    }

                    int totalcount = getWarehouseList.Length;

                    lblCount.Text = "(" + totalcount + ")";

                    //END Bin Content by Item

                    Cursor.Current = Cursors.Default;
                }
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message);
            }
        }
Пример #10
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);
            }
        }
Пример #11
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);
            }
        }
Пример #12
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;
        }
Пример #13
0
        private void BindtoGrid()
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                if (menuValue == "0") //0= Find Empty Bin
                {
                    dt = new DataTable("EmptyBin");
                    dt.Columns.Add("BinCode");
                    dt.Columns.Add("LocationCode");
                    dt.Columns.Add("ZoneCode");

                    //List<BinQH.BinQH> Lbin = new List<QHMobile.BinQH.BinQH>();

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

                    List <BinQH.BinQH_Filter> binFilterArray = new List <QHMobile.BinQH.BinQH_Filter>();
                    BinQH.BinQH_Filter        binFilter      = new QHMobile.BinQH.BinQH_Filter();
                    if (!String.IsNullOrEmpty(txtBinNo.Text.Trim()))
                    {
                        binFilter.Field    = QHMobile.BinQH.BinQH_Fields.Code;
                        binFilter.Criteria = txtBinNo.Text.Trim();
                        binFilterArray.Add(binFilter);
                    }
                    BinQH.BinQH_Filter EmptyFilter = new QHMobile.BinQH.BinQH_Filter();
                    EmptyFilter.Field    = QHMobile.BinQH.BinQH_Fields.Empty;
                    EmptyFilter.Criteria = "1";
                    binFilterArray.Add(EmptyFilter);
                    BinQH.BinQH[] BinList = binserv.ReadMultiple(binFilterArray.ToArray(), null, 0);
                    dt.Clear();
                    if (BinList.Length > 0)
                    {
                        for (int i = 0; i < BinList.Length; i++)
                        {
                            Object[] array = new Object[3];
                            array[0] = BinList[i].Code;
                            array[1] = BinList[i].Location_Code;
                            array[2] = BinList[i].Zone_Code;
                            dt.Rows.Add(array);
                        }
                        lblCount.Text     = "(" + BinList.Length.ToString() + ")";
                        gdBins.DataSource = dt;
                        gdBins.TableStyles.Clear();
                        gdBins.TableStyles.Add(DataGridStyle(dt));
                    }
                    else
                    {
                        NoEmptyBinFound();
                    }
                }//End Empty Bin
                if (menuValue == "1") //1= Find Bin Content
                {
                    dt = new DataTable("BinContent");
                    dt.Columns.Add("LocationCode");
                    dt.Columns.Add("BinCode");
                    dt.Columns.Add("ItemNo");
                    dt.Columns.Add("ItemDescription");
                    dt.Columns.Add("Quantity");

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

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

                    QHBinContent.QHBinContent_Filter filBin = new QHMobile.QHBinContent.QHBinContent_Filter();

                    if (!String.IsNullOrEmpty(txtBinNo.Text.Trim()))
                    {
                        //binFilter.Field = QHMobile.BinQH.BinQH_Fields.Code;
                        //binFilter.Criteria = txtBinNo.Text.Trim();
                        //binFilterArray.Add(binFilter);
                        filBin.Field    = QHMobile.QHBinContent.QHBinContent_Fields.Bin_Code;
                        filBin.Criteria = txtBinNo.Text.Trim();
                        filterarray.Add(filBin);
                    }

                    QHBinContent.QHBinContent[] qhBinContent;
                    if (!String.IsNullOrEmpty(txtBinNo.Text.Trim()))
                    {
                        qhBinContent = qhBinContSev.ReadMultiple(filterarray.ToArray(), null, 0);
                    }
                    else
                    {
                        qhBinContent = qhBinContSev.ReadMultiple(filterarray.ToArray(), null, 10);
                    }
                    dt.Clear();
                    if (qhBinContent.Length > 0)
                    {
                        dt.Clear();
                        for (int i = 0; i < qhBinContent.Length; i++)
                        {
                            Object[] array = new Object[5];
                            array[0] = qhBinContent[i].Location_Code;
                            array[1] = qhBinContent[i].Bin_Code;
                            array[2] = qhBinContent[i].Item_No;
                            if (!String.IsNullOrEmpty(qhBinContent[i].Item_No.Trim()))
                            {
                                ItemQH.ItemQH_Service itemsev = new QHMobile.ItemQH.ItemQH_Service();
                                itemsev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                                itemsev.Credentials = nc;

                                ItemQH.ItemQH itemdescription = itemsev.Read(qhBinContent[i].Item_No.ToString());
                                array[3] = itemdescription.Description;
                            }
                            else
                            {
                                array[3] = "";
                            }
                            array[4] = qhBinContent[i].Quantity;
                            dt.Rows.Add(array);
                        }

                        lblCount.Text     = "(" + qhBinContent.Length.ToString() + ")";
                        gdBins.DataSource = dt;
                        gdBins.TableStyles.Clear();
                        gdBins.TableStyles.Add(DataGridStyleBinContent(dt));
                    }
                    else
                    {
                        NoBinContentFound();
                    }
                }//END Bin Content
                if (menuValue == "2") //1= Find Bin Content by Item
                {
                    dt = new DataTable("BinContent");
                    dt.Columns.Add("LocationCode");
                    dt.Columns.Add("BinCode");
                    dt.Columns.Add("ItemNo");
                    dt.Columns.Add("ItemDescription");
                    dt.Columns.Add("Quantity");

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

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

                    QHBinContent.QHBinContent_Filter filItem = new QHMobile.QHBinContent.QHBinContent_Filter();

                    if (!String.IsNullOrEmpty(txtBinNo.Text.Trim()))
                    {
                        filItem.Field    = QHMobile.QHBinContent.QHBinContent_Fields.Item_No;
                        filItem.Criteria = txtBinNo.Text.Trim();
                        filterarray.Add(filItem);
                    }

                    QHBinContent.QHBinContent[] qhBinContent;
                    if (!String.IsNullOrEmpty(txtBinNo.Text.Trim()))
                    {
                        qhBinContent = qhBinContSev.ReadMultiple(filterarray.ToArray(), null, 0);
                    }
                    else
                    {
                        qhBinContent = qhBinContSev.ReadMultiple(filterarray.ToArray(), null, 10);
                    }
                    dt.Clear();
                    if (qhBinContent.Length > 0)
                    {
                        dt.Clear();
                        for (int i = 0; i < qhBinContent.Length; i++)
                        {
                            Object[] array = new Object[5];
                            array[0] = qhBinContent[i].Location_Code;
                            array[1] = qhBinContent[i].Bin_Code;
                            array[2] = qhBinContent[i].Item_No;
                            if (!String.IsNullOrEmpty(qhBinContent[i].Item_No.Trim()))
                            {
                                ItemQH.ItemQH_Service itemsev = new QHMobile.ItemQH.ItemQH_Service();
                                itemsev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                                itemsev.Credentials = nc;

                                ItemQH.ItemQH itemdescription = itemsev.Read(qhBinContent[i].Item_No.ToString());
                                array[3] = itemdescription.Description;
                            }
                            else
                            {
                                array[3] = "";
                            }
                            array[4] = qhBinContent[i].Quantity;
                            dt.Rows.Add(array);
                        }

                        lblCount.Text     = "(" + qhBinContent.Length.ToString() + ")";
                        gdBins.DataSource = dt;
                        gdBins.TableStyles.Clear();
                        gdBins.TableStyles.Add(DataGridStyleBinContent(dt));
                    }
                    else
                    {
                        NoBinContentFound();
                    }
                }//END Bin Content by Item

                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message);
            }
        }