Beispiel #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);
        }
Beispiel #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。");
        }
Beispiel #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;
        }
Beispiel #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);
 }
Beispiel #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;
            }
        }
Beispiel #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;
        }
Beispiel #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;
 }
Beispiel #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;
        }
Beispiel #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。");
        }
Beispiel #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;
            }
        }