예제 #1
0
        scanItemDetail getInList(string findvalue)
        {
            var dd = new scanItemDetail();

            for (int i = 0; i < _lisCtnNo.Count; i++)
            {
                if (_lisCtnNo[i].ctnno_no.Equals(findvalue))
                {
                    return(_lisCtnNo[i]);
                }
            }
            return(dd);
        }
예제 #2
0
        void addToListView(scanItemDetail selectitem)
        {
            listView1.Items.Clear();
            addToList(selectitem, true);
            foreach (var item in _lisCtnNo)
            {
                addToList(item, false);
            }
            _lisCtnNo.Add(selectitem);

            //txt13pqty.Text = _lisCtnNo.Count.ToString();

            SetMsg(lnlTotal, "add " + selectitem.ctnno_no + " success。");
        }
예제 #3
0
        void addToList(scanItemDetail item, bool select)
        {
            string[] tmpstr = new string[4];

            tmpstr[0] = item.ctnno_no;
            tmpstr[1] = item.pqty;
            tmpstr[2] = item.qty;
            tmpstr[3] = item.nwet;

            ListViewItem tmpitems1 = new ListViewItem(tmpstr);

            listView1.Items.Add(tmpitems1);
            listView1.Items[0].Selected = true;
        }
예제 #4
0
 bool editInList(scanItemDetail value)
 {
     for (int i = 0; i < _lisCtnNo.Count; i++)
     {
         if (_lisCtnNo[i].ctnno_no.Equals(value.ctnno_no))
         {
             _lisCtnNo.RemoveAt(i);
             value.pqty = txt13pqty.Text.Trim();
             value.nwet = txt23nwet.Text.Trim();
             value.qty  = txt22qty.Text.Trim();
             _lisCtnNo.Add(value);
             return(true);
         }
     }
     return(false);
 }
예제 #5
0
        private void txt21ctnno_no_KeyDown(object sender, KeyEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    if (!string.IsNullOrEmpty(txt21ctnno_no.Text.Trim()))
                    {
                        if (!checkInList(txt21ctnno_no.Text.Trim(), false))
                        {
                            scanItemDetail tmp = new scanItemDetail();

                            tmp.ctnno_no = txt21ctnno_no.Text.Trim();
                            tmp.pqty     = txt13pqty.Text.Trim();
                            tmp.qty      = txt22qty.Text.Trim();
                            tmp.nwet     = txt23nwet.Text.Trim();

                            addToListView(tmp);

                            setFouces(e, txt22qty);
                        }
                        else
                        {
                            SetMsg(lnlTotal, " 箱号:" + txt21ctnno_no.Text + " 已扫。");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
예제 #6
0
        void addToList(scanItemDetail item, bool select)
        {
            string[] tmpstr = new string[4];

            tmpstr[0] = item.ctnno_no;
            tmpstr[1] = item.pqty;
            tmpstr[2] = item.qty;
            tmpstr[3] = item.nwet;

            ListViewItem tmpitems1 = new ListViewItem(tmpstr);
            listView1.Items.Add(tmpitems1);
            listView1.Items[0].Selected = true;
        }
예제 #7
0
 scanItemDetail getInList(string findvalue)
 {
     var dd = new scanItemDetail();
     for (int i = 0; i < _lisCtnNo.Count; i++)
     {
         if (_lisCtnNo[i].ctnno_no.Equals(findvalue))
         {
             return _lisCtnNo[i];
         }
     }
     return dd;
 }
예제 #8
0
        bool editInList(scanItemDetail value)
        {
            for (int i = 0; i < _lisCtnNo.Count; i++)
            {
                if (_lisCtnNo[i].ctnno_no.Equals(value.ctnno_no))
                {

                    _lisCtnNo.RemoveAt(i);
                    value.pqty = txt13pqty.Text.Trim();
                    value.nwet = txt23nwet.Text.Trim();
                    value.qty = txt22qty.Text.Trim();
                    _lisCtnNo.Add(value);
                    return true;
                }
            }
            return false;
        }
예제 #9
0
        void addToListView(scanItemDetail selectitem)
        {
            listView1.Items.Clear();
            addToList(selectitem, true);
            foreach (var item in _lisCtnNo)
            {
                addToList(item, false);
            }
            _lisCtnNo.Add(selectitem);

            //txt13pqty.Text = _lisCtnNo.Count.ToString();

            SetMsg(lnlTotal, "add " + selectitem.ctnno_no + " success。");
        }
예제 #10
0
        private void txt21ctnno_no_KeyDown(object sender, KeyEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    if (!string.IsNullOrEmpty(txt21ctnno_no.Text.Trim()))
                    {

                        if (!checkInList(txt21ctnno_no.Text.Trim(), false))
                        {
                            scanItemDetail tmp = new scanItemDetail();

                            tmp.ctnno_no = txt21ctnno_no.Text.Trim();
                            tmp.pqty = txt13pqty.Text.Trim();
                            tmp.qty = txt22qty.Text.Trim();
                            tmp.nwet = txt23nwet.Text.Trim();

                            addToListView(tmp);

                            setFouces(e, txt22qty);
                        }
                        else
                        {
                            SetMsg(lnlTotal, " 箱号:" + txt21ctnno_no.Text + " 已扫。");
                        }

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