Exemplo n.º 1
0
        private void BindToGrid()
        {
            try
            {
                if (!String.IsNullOrEmpty(txtBinNo.Text.Trim()))
                {
                    dt = new DataTable("BlockBin");

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

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

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

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

                    BinQH.BinQH[] BinList = binserv.ReadMultiple(arrayBinFilter.ToArray(), null, 0);
                    if (BinList.Length > 0)
                    {
                        dt.Clear();
                        lblCount.Text = "(" + BinList.Length.ToString() + ")";
                        for (int i = 0; i < BinList.Length; i++)
                        {
                            if (BinList[i].Location_Code != BinList[i].Code)
                            {
                                Object[] array = new Object[3];
                                array[0] = BinList[i].Code;
                                array[1] = BinList[i].Location_Code;
                                array[2] = BinList[i].Block_Movement.ToString();
                                dt.Rows.Add(array);
                            }
                        }
                        gdBins.DataSource = dt;
                        gdBins.TableStyles.Clear();
                        gdBins.TableStyles.Add(DataGridStyle(dt));
                        Cursor.Current = Cursors.Default;
                    }
                    else
                    {
                        NoBinFound();
                    }
                }
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message);
            }
        }
Exemplo 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;
            }
        }
Exemplo n.º 3
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (cboEntryType.SelectedText.Equals("Positive Adjmt.") && chkEmpty.Checked == true)
                {
                    MessageBox.Show("PDA: You cannot now allow to empty the bin in positive state.");
                }
                else
                {
                    if (count == 0)
                    {
                        if (!string.IsNullOrEmpty(txtItemNo.Text.Trim()) && !string.IsNullOrEmpty(txtBinCode.Text.Trim()) && !string.IsNullOrEmpty(txtLocation.Text.Trim()) && !string.IsNullOrEmpty(txtQuantity.Text.Trim()) && !txtQuantity.Text.Trim().Equals("0"))
                        //if (!txtItemNo.Text.Equals("") && !txtBinCode.Text.Equals("") && !txtLocation.Text.Equals("") && !txtQuantity.Text.Equals(""))
                        {
                            bool isNum = IsItNumber(txtQuantity.Text.Trim());

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

                                bool flagItem = ItemValidating();

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

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

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

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

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

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

                                        filterArr.Add(bincodefilter);


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

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

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

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

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

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

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

                                bool flagItem = ItemValidating();

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

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

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

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

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

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

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

                    if (count == 1)
                    {
                        // txtBinCode.Enabled = false;
                        //txtItemNo.Enabled = true;
                        txtLocation.Enabled = false;
                        cboEntryType.Text   = cboEntryType.Items[0].ToString();
                    }
                    else
                    {
                        txtBinCode.Enabled  = true;
                        txtBinCode.Text     = "";
                        txtItemNo.Enabled   = true;
                        txtItemNo.Text      = "";
                        txtLocation.Enabled = true;
                        txtLocation.Text    = "";
                        txtQuantity.Text    = "";
                        txtBinCode.Focus();
                        cboEntryType.Text = cboEntryType.Items[1].ToString();
                    }
                    Cursor.Current = Cursors.Default;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Cursor.Current = Cursors.Default;
            }
        }
Exemplo n.º 4
0
        private void txtBin_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    try
                    {
                        globalsvr.Url         = WebServiceInstants.GetURL(ServiceType.QHBinContent);
                        globalsvr.Credentials = nc;
                        Cursor.Current        = Cursors.WaitCursor;

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

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

                        filterarray.Add(filterBin);

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

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

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

                        binfitlerArray.Add(bincodefilter);

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


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


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

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

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

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

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

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

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


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

                                    ItemQH.ItemQH item;

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

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


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

                                        txtCategory.Text = item.Item_Category_Code;

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

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

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

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


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

            Cursor.Current = Cursors.Default;
        }
Exemplo n.º 5
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());
            }
        }
Exemplo n.º 6
0
        private int QtyValidating()
        {
            try
            {
                QHBinContent.QHBinContent_Service qhserv = new QHMobile.QHBinContent.QHBinContent_Service();
                qhserv.Url         = WebServiceInstants.GetURL(ServiceType.QHBinContent);
                qhserv.Credentials = nc;

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

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

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

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

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

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

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


                if (binqh.Length != 0)
                {
                    //if (binqh[0].Quantity_Base < Convert.ToInt32(txtQuantity.Text))
                    //{
                    //    return 0;
                    //}
                    //{

                    return(1);
                    //}
                }
                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;
                    bincodefilter.Criteria = txtBinCode.Text.Trim();

                    filterArr.Add(bincodefilter);


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

                    if (binqhget.Length == 0)
                    {
                        return(3);
                    }
                    else
                    {
                        return(2);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return(2);
            }
        }
Exemplo n.º 7
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);
            }
        }
Exemplo n.º 8
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);
            }
        }
Exemplo n.º 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");

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