Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="item"></param>
        /// <param name="notice"></param>
        /// <returns></returns>
        bool InserToNotice(scanItemDetail item, string notice)
        {
            try
            {
                StringDictionary dicItemValue = new StringDictionary();
                //user
                StringDictionary DidUserCollum = new StringDictionary();
                //log for use
                DidUserCollum[t_alarmdata.adduser] = "true";
                DidUserCollum[t_alarmdata.addtime] = "true";
                DidUserCollum[t_alarmdata.updtime] = "true";
                DidUserCollum[t_alarmdata.upduser] = "true";

                dicItemValue[t_alarmdata.recd_id]    = DateTime.Now.ToString("yyyyMMddHHmmss") + "R" + item.rfid;
                dicItemValue[t_alarmdata.alarm_type] = "Alarm_03";
                dicItemValue[t_alarmdata.depot_no]   = item.rfid;
                dicItemValue[t_alarmdata.cell_no]    = item.ctnno_no;
                dicItemValue[t_alarmdata.begin_time] = DateTime.Now.ToString();
                dicItemValue[t_alarmdata.over_time]  = DateTime.Now.ToString();
                dicItemValue[t_alarmdata.remark]     = "抽检实际重量大于1%。重量:" + item.nwet + ",实际重量:" + item.gwet + ",误差:" + notice;
                dicItemValue[t_alarmdata.status]     = "1";


                this.m_daoCommon.SetInsertDataItem(ViewOrTable.t_alarmdata, dicItemValue, DidUserCollum);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #2
0
        private void txt12prdct_no_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (!string.IsNullOrEmpty(txt12prdct_no.Text))
                {
                    var tmpGet = getRFID_t_stockDetails(txt11stockin_id.Text.Trim(), txt12prdct_no.Text.Trim());

                    if (tmpGet == null)
                    {
                        var tmpmsg = "未查到有效的 订单号:" + txt11stockin_id.Text + ",货物编号:" + txt12prdct_no.Text;
                        SetMsg(lbl0Msg, tmpmsg);
                        MessageBox.Show(tmpmsg);

                        txt11stockin_id.Focus();
                        return;
                    }
                    else
                    {
                        lbl0Msg.Text        = "";
                        _currStockInDetails = tmpGet;
                    }
                    timer1.Enabled = true;
                }

                setFouces(e, txt3RFID);

                if (!string.IsNullOrEmpty(txt3RFID.Text))
                {
                    txt4XiangHao.Focus();
                }
            }
        }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="item"></param>
        /// <param name="notice"></param>
        /// <returns></returns>
        bool InserTot_sampling(scanItemDetail item)
        {
            try
            {
                StringDictionary dicItemValue = new StringDictionary();
                //user
                StringDictionary DidUserCollum = new StringDictionary();
                //log for use
                DidUserCollum[t_sampling.adduser] = "true";
                DidUserCollum[t_sampling.addtime] = "true";
                DidUserCollum[t_sampling.updtime] = "true";
                DidUserCollum[t_sampling.upduser] = "true";

                dicItemValue[t_sampling.stockin_id] = item.stockid;
                dicItemValue[t_sampling.rfid_no]    = item.rfid;
                dicItemValue[t_sampling.qty]        = item.qty;
                dicItemValue[t_sampling.nwet]       = item.nwet;
                dicItemValue[t_sampling.gwet]       = item.gwet;
                dicItemValue[t_sampling.agwet]      = item.agwet;
                dicItemValue[t_sampling.status]     = "1";


                this.m_daoCommon.SetInsertDataItem(ViewOrTable.t_sampling, dicItemValue, DidUserCollum);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #4
0
        void initToTxt(scanItemDetail s)
        {
            _currScanItem = s;

            _isChangeTxt  = true;
            txt5PQty.Text = s.pqty;
            txt5qty.Text  = s.qty;
            txt5nWet.Text = s.nwet;
            _isChangeTxt  = false;
        }
Exemple #5
0
        public void getRFID_CheckTime()
        {
            scanItemDetail tmpScan = new scanItemDetail();

            StringDictionary disWhereValueItem = new StringDictionary();
            StringDictionary disForValueItem = new StringDictionary();

            //table
            DataTable dt = null;

            disWhereValueItem[m_checkpoint.status] = "1";
            disForValueItem[m_checkpoint.status] = "true";

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                //get dt
                dt = this.m_daoCommon.GetTableInfo(ViewOrTable.m_checkpoint, disWhereValueItem, disForValueItem, _disNull, "checktime", false);

                if (dt.Rows.Count > 0)
                {
                    _checkTime = new List<string>();
                    txt2Shelf.Items.Clear();

                    foreach (DataRow dr in dt.Rows)
                    {
                        var tmptime = dr[m_checkpoint.checktime].ToString();
                        _checkTime.Add(tmptime);
                        txt2Shelf.Items.Add(tmptime);
                    }

                    Cursor.Current = Cursors.Default;

                }
                else
                {
                    Cursor.Current = Cursors.Default;

                }

            }
            catch (Exception ex)
            {
                var msg = "Get Check Time." + ex.Message;
                LogManager.WriteLog(Common.LogFile.Error, msg);
                SetMsg(lbl0Msg, msg);
                MessageBox.Show(msg);
                Cursor.Current = Cursors.Default;
            }
            finally
            {

                Cursor.Current = Cursors.Default;
            }
        }
Exemple #6
0
        void addToList(scanItemDetail item)
        {
            string[] tmpstr = new string[2];

            tmpstr[0] = item.rfid;
            tmpstr[1] = item.shelf_no;

            ListViewItem tmpitems1 = new ListViewItem(tmpstr);

            listView1.Items.Add(tmpitems1);
            listView1.Items[0].Selected = true;
        }
Exemple #7
0
        public void getRFID_CheckTime()
        {
            scanItemDetail tmpScan = new scanItemDetail();

            StringDictionary disWhereValueItem = new StringDictionary();
            StringDictionary disForValueItem   = new StringDictionary();

            //table
            DataTable dt = null;

            disWhereValueItem[m_checkpoint.status] = "1";
            disForValueItem[m_checkpoint.status]   = "true";


            Cursor.Current = Cursors.WaitCursor;
            try
            {
                //get dt
                dt = this.m_daoCommon.GetTableInfo(ViewOrTable.m_checkpoint, disWhereValueItem, disForValueItem, _disNull, "checktime", false);

                if (dt.Rows.Count > 0)
                {
                    _checkTime = new List <string>();
                    txt2Shelf.Items.Clear();

                    foreach (DataRow dr in dt.Rows)
                    {
                        var tmptime = dr[m_checkpoint.checktime].ToString();
                        _checkTime.Add(tmptime);
                        txt2Shelf.Items.Add(tmptime);
                    }

                    Cursor.Current = Cursors.Default;
                }
                else
                {
                    Cursor.Current = Cursors.Default;
                }
            }
            catch (Exception ex)
            {
                var msg = "Get Check Time." + ex.Message;
                LogManager.WriteLog(Common.LogFile.Error, msg);
                SetMsg(lbl0Msg, msg);
                MessageBox.Show(msg);
                Cursor.Current = Cursors.Default;
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Exemple #8
0
        private void txt5PQty_KeyDown(object sender, KeyEventArgs e)
        {
            if (!string.IsNullOrEmpty(txt2Shelf.Text))
            {
                if (e.KeyCode == Keys.Enter)
                {
                    var tmpmsg = "";

                    Cursor.Current = Cursors.WaitCursor;
                    try
                    {
                        if (!checkTxt())
                        {
                            return;
                        }
                        var tmpkey = txt3RFID.Text.Trim();

                        if (_dicScanItemDetail.ContainsKey(tmpkey))
                        {
                            if (!string.IsNullOrEmpty(txt2Shelf.Text))
                            {
                                _dicScanItemDetail[tmpkey].shelf_no = txt2Shelf.Text.Trim();
                            }
                            addToListAllView();

                            SetMsg(lbl0Msg, "RFID:" + txt3RFID.Text + " 已经存在。");
                        }
                        else
                        {
                            scanItemDetail tmpscan = new scanItemDetail();

                            tmpscan.rfid     = txt3RFID.Text.Trim();
                            tmpscan.shelf_no = txt2Shelf.Text.Trim();

                            //_dicScanItemDetail.Add(tmpkey, tmpscan);
                            addToListAllView(tmpkey, tmpscan);
                        }
                        AllInit(false);
                    }
                    catch (Exception ex)
                    {
                        tmpmsg = ex.Message;
                        SetMsg(lbl0Msg, tmpmsg);
                        MessageBox.Show(tmpmsg);
                    }
                    finally
                    {
                        Cursor.Current = Cursors.Default;
                    }
                }
            }
        }
Exemple #9
0
        public scanItemDetail getRFID_t_stockinctnnodetail(string tmprfid)
        {
            scanItemDetail tmpScan = new scanItemDetail();

            StringDictionary disWhereValueItem = new StringDictionary();
            StringDictionary disForValueItem   = new StringDictionary();

            //table
            DataTable dt = null;

            disWhereValueItem[t_stockinctnnodetail.rfid_no] = tmprfid;
            disForValueItem[t_stockinctnnodetail.rfid_no]   = "true";

            disWhereValueItem[t_stockinctnnodetail.status] = "1";
            disForValueItem[t_stockinctnnodetail.status]   = "true";

            try
            {
                //打开数据库连接
                Common.AdoConnect.Connect.ConnectOpen();
                //主表
                //get dt
                dt = this.m_daoCommon.GetTableInfo(ViewOrTable.t_stockinctnnodetail, disWhereValueItem, disForValueItem, _disNull, "", false);

                if (dt.Rows.Count > 0)
                {
                    var dr = dt.Rows[0];

                    tmpScan.stockid  = dr[t_stockinctnnodetail.stockin_id].ToString();
                    tmpScan.rfid     = dr[t_stockinctnnodetail.rfid_no].ToString();
                    tmpScan.ctnno_no = dr[t_stockinctnnodetail.ctnno_no].ToString();
                    tmpScan.pqty     = dr[t_stockinctnnodetail.pqty].ToString();
                    tmpScan.qty      = dr[t_stockinctnnodetail.qty].ToString();
                    tmpScan.nwet     = dr[t_stockinctnnodetail.nwet].ToString();
                    tmpScan.gwet     = dr[t_stockinctnnodetail.gwet].ToString();

                    return(tmpScan);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                LogManager.WriteLog(Common.LogFile.Error, ex.Message);
                SetMsg(lbl0Msg, ex.Message);
                return(null);
            }
        }
Exemple #10
0
        void addToList(scanItemDetail item)
        {
            string[] tmpstr = new string[5];

            tmpstr[0] = item.rfid;
            tmpstr[1] = item.pqty;
            tmpstr[2] = item.qty;
            tmpstr[3] = item.nwet;
            tmpstr[4] = item.agwet;

            ListViewItem tmpitems1 = new ListViewItem(tmpstr);

            listView1.Items.Add(tmpitems1);
            listView1.Items[0].Selected = true;
        }
Exemple #11
0
        bool Update_stockdetail(scanItemDetail item)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                StringDictionary dicItemValue = new StringDictionary();


                dicItemValue[t_stockinctnnodetail.stockin_id] = item.stockid;
                dicItemValue[t_stockinctnnodetail.prdct_no]   = item.productid;
                dicItemValue[t_stockinctnnodetail.rfid_no]    = item.rfid;
                dicItemValue[t_stockinctnnodetail.ctnno_no]   = item.ctnno_no;

                //primary key
                StringDictionary disPrimaryKey = new StringDictionary();


                disPrimaryKey[t_stockinctnnodetail.stockin_id] = item.stockid;
                disPrimaryKey[t_stockinctnnodetail.prdct_no]   = item.productid;
                disPrimaryKey[t_stockinctnnodetail.rfid_no]    = item.rfid;
                disPrimaryKey[t_stockinctnnodetail.ctnno_no]   = item.ctnno_no;

                var dis00UserCollum2 = new StringDictionary();
                dis00UserCollum2[t_stockinctnno.updtime] = "true";
                dis00UserCollum2[t_stockinctnno.upduser] = "true";

                //value

                dicItemValue[t_stockdetail.status] = "0";


                this.m_daoCommon.SetModifyDataItem(ViewOrTable.t_stockinctnnodetail, dicItemValue, disPrimaryKey, dis00UserCollum2);

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Exemple #12
0
        void addToListAllView(string tmpKey, scanItemDetail tmpNewValue)
        {
            this.Invoke(new Action(delegate()
            {
                listView1.Items.Clear();

                addToList(tmpNewValue);

                foreach (var item in _dicScanItemDetail.Values)
                {
                    addToList(item);
                }


                _dicScanItemDetail.Add(tmpKey, tmpNewValue);
            }));


            SetMsg(lbl0Msg, "添加 " + tmpNewValue.rfid + " 成功。");
        }
Exemple #13
0
        public string getRFID_t_sampling(scanItemDetail tmprfid)
        {
            StringDictionary disWhereValueItem = new StringDictionary();
            StringDictionary disForValueItem   = new StringDictionary();

            //table
            DataTable dt = null;

            disWhereValueItem[t_sampling.stockin_id] = tmprfid.stockid;
            disForValueItem[t_sampling.stockin_id]   = "true";

            disWhereValueItem[t_sampling.rfid_no] = tmprfid.rfid;
            disForValueItem[t_sampling.rfid_no]   = "true";

            try
            {
                //打开数据库连接
                Common.AdoConnect.Connect.ConnectOpen();
                //主表
                //get dt
                dt = this.m_daoCommon.GetTableInfo(ViewOrTable.t_sampling, disWhereValueItem, disForValueItem, _disNull, "", false);

                if (dt.Rows.Count > 0)
                {
                    var dr = dt.Rows[0];
                    return(dr[t_sampling.stockin_id].ToString());
                }
                else
                {
                    return("");
                }
            }
            catch (Exception ex)
            {
                LogManager.WriteLog(Common.LogFile.Error, ex.Message);
                SetMsg(lbl0Msg, ex.Message);
                return("");
            }
        }
Exemple #14
0
        bool InserToT_stockdetail(scanItemDetail item)
        {
            try
            {
                StringDictionary dicItemValue = new StringDictionary();
                //user
                StringDictionary DidUserCollum = new StringDictionary();
                //log for use
                DidUserCollum[t_stockdetail.adduser] = "true";
                DidUserCollum[t_stockdetail.addtime] = "true";
                DidUserCollum[t_stockdetail.updtime] = "true";
                DidUserCollum[t_stockdetail.upduser] = "true";

                dicItemValue[t_stockdetail.prdct_no] = item.productid;
                dicItemValue[t_stockdetail.rfid_no]  = item.rfid;
                dicItemValue[t_stockdetail.ctnno_no] = item.ctnno_no;

                dicItemValue[t_stockdetail.shelf_no]  = item.shelf_no;
                dicItemValue[t_stockdetail.receiptno] = item.receiptno;

                dicItemValue[t_stockdetail.pqty] = item.pqty;
                dicItemValue[t_stockdetail.qty]  = item.qty;
                dicItemValue[t_stockdetail.nwet] = item.nwet;
                dicItemValue[t_stockdetail.gwet] = item.gwet;

                dicItemValue[t_stockdetail.remark] = item.stockid;

                dicItemValue[t_stockdetail.status] = "1";


                this.m_daoCommon.SetInsertDataItem(ViewOrTable.t_stockdetail, dicItemValue, DidUserCollum);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #15
0
        bool InserToT_Checkdetail(scanItemDetail item, string gridid, string checktime)
        {
            try
            {
                StringDictionary dicItemValue = new StringDictionary();
                //user
                StringDictionary DidUserCollum = new StringDictionary();
                //log for use
                DidUserCollum[t_checkdetailresult.adduser] = "true";
                DidUserCollum[t_checkdetailresult.addtime] = "true";
                DidUserCollum[t_checkdetailresult.updtime] = "true";
                DidUserCollum[t_checkdetailresult.upduser] = "true";

                dicItemValue[t_checkdetailresult.check_id]    = gridid;
                dicItemValue[t_checkdetailresult.rfid_no]     = item.rfid;
                dicItemValue[t_checkdetailresult.out_item_no] = "1";

                dicItemValue[t_checkdetailresult.prdct_no]  = item.productid;
                dicItemValue[t_checkdetailresult.receiptno] = item.receiptno;

                dicItemValue[t_checkdetailresult.cell_no] = item.shelf_no;
                dicItemValue[t_checkdetailresult.qty]     = item.qty;
                dicItemValue[t_checkdetailresult.nwet]    = item.nwet;
                dicItemValue[t_checkdetailresult.gwet]    = item.gwet;

                dicItemValue[t_checkdetailresult.remark] = "补检:" + checktime + ",收到 RFID:" + item.rfid;

                dicItemValue[t_checkdetailresult.status] = "1";


                this.m_daoCommon.SetInsertDataItem(ViewOrTable.t_checkdetailresult, dicItemValue, DidUserCollum);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #16
0
        bool InserToT_CheckMain(scanItemDetail item, string gridid)
        {
            try
            {
                StringDictionary dicItemValue = new StringDictionary();
                //user
                StringDictionary DidUserCollum = new StringDictionary();
                //log for use
                DidUserCollum[t_checkresult.adduser] = "true";
                DidUserCollum[t_checkresult.addtime] = "true";
                DidUserCollum[t_checkresult.updtime] = "true";
                DidUserCollum[t_checkresult.upduser] = "true";

                dicItemValue[t_checkresult.check_id]   = gridid;
                dicItemValue[t_checkresult.check_date] = DateTime.Now.ToString();
                dicItemValue[t_checkresult.bespeak_no] = item.remark == null ? "" : item.remark;

                dicItemValue[t_checkresult.bespeak_date] = item.shelf_no;
                dicItemValue[t_checkresult.user_no]      = Common._personid;

                dicItemValue[t_checkresult.user_nm] = item.rfid;
                dicItemValue[t_checkresult.flag]    = "1";


                dicItemValue[t_checkresult.remark] = "补检:" + item.shelf_no + ",收到 RFID:" + item.rfid;

                dicItemValue[t_checkresult.status] = "1";


                this.m_daoCommon.SetInsertDataItem(ViewOrTable.t_checkresult, dicItemValue, DidUserCollum);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #17
0
        void addToListAllView(string tmpKey, scanItemDetail tmpNewValue)
        {
            this.Invoke(new Action(delegate()
            {
                listView1.Items.Clear();

                addToList(tmpNewValue);

                foreach (var item in _dicScanItemDetail.Values)
                {
                    addToList(item);
                }


                _dicScanItemDetail.Add(tmpKey, tmpNewValue);

                txt5PQty.Text = _dicScanItemDetail.Count.ToString();

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


            SetMsg(lbl0Msg, "添加 " + tmpNewValue.ctnno_no + " 成功。");
        }
Exemple #18
0
        bool InserToT_Checkdetail(scanItemDetail item, string gridid, string checktime)
        {
            try
            {
                StringDictionary dicItemValue = new StringDictionary();
                //user
                StringDictionary DidUserCollum = new StringDictionary();
                //log for use
                DidUserCollum[t_checkdetailresult.adduser] = "true";
                DidUserCollum[t_checkdetailresult.addtime] = "true";
                DidUserCollum[t_checkdetailresult.updtime] = "true";
                DidUserCollum[t_checkdetailresult.upduser] = "true";

                dicItemValue[t_checkdetailresult.check_id] = gridid;
                dicItemValue[t_checkdetailresult.rfid_no] = item.rfid;
                dicItemValue[t_checkdetailresult.out_item_no] = "1";

                dicItemValue[t_checkdetailresult.prdct_no] = item.productid;
                dicItemValue[t_checkdetailresult.receiptno] = item.receiptno;

                dicItemValue[t_checkdetailresult.cell_no] = item.shelf_no;
                dicItemValue[t_checkdetailresult.qty] = item.qty;
                dicItemValue[t_checkdetailresult.nwet] = item.nwet;
                dicItemValue[t_checkdetailresult.gwet] = item.gwet;

                dicItemValue[t_checkdetailresult.remark] = "补检:" + checktime + ",收到 RFID:" + item.rfid;

                dicItemValue[t_checkdetailresult.status] = "1";

                this.m_daoCommon.SetInsertDataItem(ViewOrTable.t_checkdetailresult, dicItemValue, DidUserCollum);
                return true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #19
0
        private void txt4XiangHao_KeyDown(object sender, KeyEventArgs e)
        {
            var tmpmsg = "";

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    if (!checkTxt())
                    {
                        return;
                    }
                    var tmpCheckScan1 = Check_RFID_t_stockinctnnodetail(txt3RFID.Text.Trim(), "1");
                    if (tmpCheckScan1 != null)
                    {
                        tmpmsg = "RFID:" + txt3RFID.Text + "已经在使用中1。";
                        SetMsg(lbl0Msg, tmpmsg);
                        MessageBox.Show(tmpmsg);
                        txt3RFID.Text = "";
                        _rfid = "";
                        return;
                    }
                    var tmpCheckScan2 = Check_RFID_t_stockinctnnodetail(txt3RFID.Text.Trim(), "2");
                    if (tmpCheckScan2 != null)
                    {

                        tmpmsg = "RFID:" + txt3RFID.Text + "已经在使用中2。";
                        SetMsg(lbl0Msg, tmpmsg);
                        MessageBox.Show(tmpmsg);
                        txt3RFID.Text = "";
                        _rfid = "";
                        return;
                    }

                    var tmpkey = txt3RFID.Text.Trim();// txt11stockin_id.Text.Trim() + "," + txt12prdct_no.Text.Trim() + "," + txt3RFID.Text.Trim() + "," + txt4XiangHao.Text.Trim();

                    if (_dicScanItemDetail.ContainsKey(tmpkey))
                    {
                        _dicScanItemDetail[tmpkey].qty = txt5qty.Text.Trim();
                        _dicScanItemDetail[tmpkey].nwet = txt6nwet.Text.Trim();

                        addToListAllView();

                        SetMsg(lbl0Msg, "RFID:" + txt3RFID.Text + ", 已经存在。");//托盘号:" + txt4XiangHao.Text + "
                    }
                    else
                    {
                        scanItemDetail tmpscan = new scanItemDetail();

                        tmpscan.receiptno = _currStockInDetails.receiptno;

                        tmpscan.stockid = txt11stockin_id.Text.Trim();
                        tmpscan.productid = txt12prdct_no.Text.Trim();
                        tmpscan.rfid = txt3RFID.Text.Trim();
                        tmpscan.ctnno_no = txt4XiangHao.Text.Trim();
                        tmpscan.pqty = "1";

                        tmpscan.qty = txt5qty.Text.Trim();
                        tmpscan.nwet = txt6nwet.Text.Trim();

                        //_dicScanItemDetail.Add(tmpkey, tmpscan);
                        addToListAllView(tmpkey, tmpscan);
                    }

                }
                setFouces(e, txt5qty);
            }
            catch (Exception ex)
            {
                tmpmsg = ex.Message;
                MessageBox.Show(ex.Message);
                SetMsg(lbl0Msg, tmpmsg);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Exemple #20
0
        private void txt4XiangHao_KeyDown(object sender, KeyEventArgs e)
        {
            var tmpmsg = "";

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    if (!checkTxt())
                    {
                        return;
                    }



                    var tmpCheckScan1 = Check_RFID_t_stockOutdetail(txt3RFID.Text.Trim(), txt11stockin_id.Text.Trim(), txt12prdct_no.Text.Trim());


                    if (tmpCheckScan1 == null)
                    {
                        tmpmsg = "不存在对应的 出库号:" + txt11stockin_id.Text + ",货物编号:" + txt12prdct_no.Text + ",RFID:" + txt3RFID.Text;
                        SetMsg(lbl0Msg, tmpmsg);
                        MessageBox.Show(tmpmsg);
                        txt3RFID.Text = "";
                        _rfid         = "";
                        return;
                    }

                    var tmpCheckStockDetails = Check_RFID_t_stockdetail(txt3RFID.Text.Trim(), txt12prdct_no.Text.Trim());


                    if (tmpCheckStockDetails == null)
                    {
                        tmpmsg = "出库号:" + txt11stockin_id.Text + ", 货物编号:" + txt12prdct_no.Text + ",RFID:" + txt3RFID.Text + " 早已出库。";
                        SetMsg(lbl0Msg, tmpmsg);
                        MessageBox.Show(tmpmsg);
                        txt3RFID.Text = "";
                        _rfid         = "";
                        return;
                    }

                    var tmpkey = txt3RFID.Text.Trim();// txt11stockin_id.Text.Trim() + "," + txt12prdct_no.Text.Trim() + "," + txt3RFID.Text.Trim() + "," + txt4XiangHao.Text.Trim();

                    if (_dicScanItemDetail.ContainsKey(tmpkey))
                    {
                        _dicScanItemDetail[tmpkey].qty  = txt5qty.Text.Trim();
                        _dicScanItemDetail[tmpkey].nwet = txt6nwet.Text.Trim();

                        addToListAllView();

                        SetMsg(lbl0Msg, "RFID:" + txt3RFID.Text + ", 已经存在。");//托盘号:" + txt4XiangHao.Text + "
                    }
                    else
                    {
                        scanItemDetail tmpscan = new scanItemDetail();

                        tmpscan.receiptno = tmpCheckScan1.receiptno;

                        _isChangeTxt      = true;
                        tmpscan.stockid   = txt11stockin_id.Text.Trim();
                        tmpscan.productid = txt12prdct_no.Text.Trim();
                        tmpscan.rfid      = txt3RFID.Text.Trim();
                        tmpscan.ctnno_no  = txt4XiangHao.Text.Trim();
                        tmpscan.pqty      = "1";

                        txt5qty.Text  = tmpCheckScan1.qty;
                        txt6nwet.Text = tmpCheckScan1.nwet;

                        tmpscan.qty  = txt5qty.Text.Trim();
                        tmpscan.nwet = txt6nwet.Text.Trim();
                        tmpscan.gwet = (tmpCheckScan1.gwet == null || tmpCheckScan1.gwet == "") ? "0" : tmpCheckScan1.gwet;

                        _isChangeTxt = false;
                        //_dicScanItemDetail.Add(tmpkey, tmpscan);
                        addToListAllView(tmpkey, tmpscan);
                    }
                }
                setFouces(e, txt5qty);
            }
            catch (Exception ex)
            {
                tmpmsg = ex.Message;
                MessageBox.Show(ex.Message);
                SetMsg(lbl0Msg, tmpmsg);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Exemple #21
0
        private void txt6gwet_KeyDown(object sender, KeyEventArgs e)
        {
            if (!string.IsNullOrEmpty(txt6gwet.Text))
            {
                if (e.KeyCode == Keys.Enter)
                {
                    if (txt6gwet.Text.Equals("0"))
                    {
                        txt6gwet.Focus();
                        return;
                    }

                    var tmpmsg = "";

                    Cursor.Current = Cursors.WaitCursor;
                    try
                    {
                        if (!checkTxt())
                        {
                            return;
                        }
                        var tmpkey = txt3RFID.Text.Trim();

                        if (_dicScanItemDetail.ContainsKey(tmpkey))
                        {
                            _dicScanItemDetail[tmpkey].gwet = txt6gwet.Text.Trim();

                            addToListAllView();

                            SetMsg(lbl0Msg, "RFID:" + txt3RFID.Text + " 已经存在。");
                        }
                        else
                        {
                            scanItemDetail tmpscan = new scanItemDetail();

                            tmpscan.rfid = txt3RFID.Text.Trim();
                            tmpscan.pqty = txt5PQty.Text.Trim();
                            tmpscan.qty  = txt5qty.Text.Trim();
                            tmpscan.nwet = txt5nWet.Text.Trim();

                            tmpscan.agwet = txt6gwet.Text.Trim();

                            tmpscan.ctnno_no = _currScanItem.ctnno_no;
                            tmpscan.stockid  = _currScanItem.stockid;
                            tmpscan.gwet     = _currScanItem.gwet;

                            //_dicScanItemDetail.Add(tmpkey, tmpscan);
                            addToListAllView(tmpkey, tmpscan);
                        }
                        AllInit(false);
                    }
                    catch (Exception ex)
                    {
                        tmpmsg = ex.Message;
                        MessageBox.Show(ex.Message);
                        SetMsg(lbl0Msg, tmpmsg);
                    }
                    finally
                    {
                        Cursor.Current = Cursors.Default;
                    }
                }
            }
        }
Exemple #22
0
        private void txt2Shelf_KeyDown(object sender, KeyEventArgs e)
        {
            if (!string.IsNullOrEmpty(txt2Shelf.Text))
            {
                if (e.KeyCode == Keys.Enter)
                {
                    var tmpmsg = "";

                    Cursor.Current = Cursors.WaitCursor;
                    try
                    {
                        if (!checkTxt())
                        {
                            return;
                        }
                        var tmpkey = txt3RFID.Text.Trim();

                        if (_dicScanItemDetail.ContainsKey(tmpkey))
                        {
                            if (!string.IsNullOrEmpty(txt2Shelf.Text))
                            {
                                _dicScanItemDetail[tmpkey].shelf_no = txt2Shelf.Text.Trim();
                            }
                            addToListAllView();

                            SetMsg(lbl0Msg, "RFID:" + txt3RFID.Text + " 已经存在。");
                        }
                        else
                        {
                            scanItemDetail tmpscan = new scanItemDetail();

                            tmpscan.rfid = txt3RFID.Text.Trim();
                            tmpscan.shelf_no = txt2Shelf.Text.Trim();

                            //_dicScanItemDetail.Add(tmpkey, tmpscan);
                            addToListAllView(tmpkey, tmpscan);

                        }
                        AllInit(false);
                    }
                    catch (Exception ex)
                    {
                        tmpmsg = ex.Message;
                        SetMsg(lbl0Msg, tmpmsg);
                        MessageBox.Show(tmpmsg);
                    }
                    finally
                    {
                        Cursor.Current = Cursors.Default;
                    }
                }
            }
        }
Exemple #23
0
        bool InserToT_stockdetail(scanItemDetail item)
        {
            try
            {
                StringDictionary dicItemValue = new StringDictionary();
                //user
                StringDictionary DidUserCollum = new StringDictionary();
                //log for use
                DidUserCollum[t_stockdetail.adduser] = "true";
                DidUserCollum[t_stockdetail.addtime] = "true";
                DidUserCollum[t_stockdetail.updtime] = "true";
                DidUserCollum[t_stockdetail.upduser] = "true";

                dicItemValue[t_stockdetail.prdct_no] = item.productid;
                dicItemValue[t_stockdetail.rfid_no] = item.rfid;
                dicItemValue[t_stockdetail.ctnno_no] = item.ctnno_no;

                dicItemValue[t_stockdetail.shelf_no] = item.shelf_no;
                dicItemValue[t_stockdetail.receiptno] = item.receiptno;

                dicItemValue[t_stockdetail.pqty] = item.pqty;
                dicItemValue[t_stockdetail.qty] = item.qty;
                dicItemValue[t_stockdetail.nwet] = item.nwet;
                dicItemValue[t_stockdetail.gwet] = item.gwet;

                dicItemValue[t_stockdetail.remark] = item.stockid;

                dicItemValue[t_stockdetail.status] = "1";

                this.m_daoCommon.SetInsertDataItem(ViewOrTable.t_stockdetail, dicItemValue, DidUserCollum);
                return true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #24
0
        void addToList(scanItemDetail item)
        {
            string[] tmpstr = new string[2];

            tmpstr[0] = item.rfid;
            tmpstr[1] = item.shelf_no;

            ListViewItem tmpitems1 = new ListViewItem(tmpstr);
            listView1.Items.Add(tmpitems1);
            listView1.Items[0].Selected = true;
        }
Exemple #25
0
        private void txt12prdct_no_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {

                if (!string.IsNullOrEmpty(txt12prdct_no.Text))
                {
                    var tmpGet = getRFID_t_stockDetails(txt11stockin_id.Text.Trim(), txt12prdct_no.Text.Trim());

                    if (tmpGet == null)
                    {

                        var tmpmsg = "未查到有效的 订单号:" + txt11stockin_id.Text + ",货物编号:" + txt12prdct_no.Text;
                        SetMsg(lbl0Msg, tmpmsg);
                        MessageBox.Show(tmpmsg);

                        txt11stockin_id.Focus();
                        return;
                    }
                    else
                    {
                        lbl0Msg.Text = "";
                        _currStockInDetails = tmpGet;

                    }
                    timer1.Enabled = true;
                }

                setFouces(e, txt3RFID);

                if (!string.IsNullOrEmpty(txt3RFID.Text))
                {
                    txt4XiangHao.Focus();
                }
            }
        }
Exemple #26
0
        void addToList(scanItemDetail item)
        {
            string[] tmpstr = new string[6];

            tmpstr[0] = item.rfid;
            tmpstr[1] = item.productid;
            tmpstr[2] = item.ctnno_no;
            tmpstr[3] = item.qty;
            tmpstr[4] = item.nwet;
            tmpstr[5] = item.pqty;

            ListViewItem tmpitems1 = new ListViewItem(tmpstr);
            listView1.Items.Add(tmpitems1);
            listView1.Items[0].Selected = true;
        }
Exemple #27
0
        public scanItemDetail getRFID_t_stockDetails(scanItemDetail item)
        {
            scanItemDetail tmpScan = new scanItemDetail();

            StringDictionary disWhereValueItem = new StringDictionary();
            StringDictionary disForValueItem   = new StringDictionary();

            //table
            DataTable dt = null;

            disWhereValueItem[t_stockdetail.rfid_no] = item.rfid;
            disForValueItem[t_stockdetail.rfid_no]   = "true";

            disWhereValueItem[t_stockdetail.prdct_no] = item.productid;
            disForValueItem[t_stockdetail.prdct_no]   = "true";


            disWhereValueItem[t_stockdetail.shelf_no] = item.shelf_no;
            disForValueItem[t_stockdetail.shelf_no]   = "true";


            disWhereValueItem[t_stockdetail.status] = "1";
            disForValueItem[t_stockdetail.status]   = "true";



            disWhereValueItem[t_stockdetail.ctnno_no] = item.ctnno_no;
            disForValueItem[t_stockdetail.ctnno_no]   = "true";


            Cursor.Current = Cursors.WaitCursor;
            try
            {
                //get dt
                dt = this.m_daoCommon.GetTableInfo(ViewOrTable.t_stockdetail, disWhereValueItem, disForValueItem, _disNull, "", false);

                if (dt.Rows.Count > 0)
                {
                    var dr = dt.Rows[0];

                    //tmpScan.stockid = dr[t_stockdetail.].ToString();
                    tmpScan.productid = dr[t_stockdetail.prdct_no].ToString();

                    tmpScan.receiptno = dr[t_stockdetail.receiptno].ToString();


                    tmpScan.rfid     = dr[t_stockdetail.rfid_no].ToString();
                    tmpScan.shelf_no = dr[t_stockdetail.shelf_no].ToString();

                    tmpScan.ctnno_no = dr[t_stockdetail.ctnno_no].ToString();

                    tmpScan.pqty = dr[t_stockdetail.pqty].ToString();
                    tmpScan.qty  = dr[t_stockdetail.qty].ToString();
                    tmpScan.nwet = dr[t_stockdetail.nwet].ToString();
                    tmpScan.gwet = dr[t_stockdetail.gwet].ToString();

                    Cursor.Current = Cursors.Default;
                    return(tmpScan);
                }
                else
                {
                    Cursor.Current = Cursors.Default;
                    return(null);
                }
            }
            catch (Exception ex)
            {
                var msg = "RFID:" + item.rfid + ",Product:" + item.productid + "," + ex.Message;
                LogManager.WriteLog(Common.LogFile.Error, msg);
                SetMsg(lbl0Msg, msg);
                MessageBox.Show(msg);
                Cursor.Current = Cursors.Default;
                return(null);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Exemple #28
0
        private void txt4XiangHao_KeyDown(object sender, KeyEventArgs e)
        {
            var tmpmsg = "";

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    if (!checkTxt())
                    {
                        return;
                    }
                    var tmpCheckScan1 = Check_RFID_t_stockinctnnodetail(txt3RFID.Text.Trim(), "1");
                    if (tmpCheckScan1 != null)
                    {
                        tmpmsg = "RFID:" + txt3RFID.Text + "已经在使用中1。";
                        SetMsg(lbl0Msg, tmpmsg);
                        MessageBox.Show(tmpmsg);
                        txt3RFID.Text = "";
                        _rfid         = "";
                        return;
                    }
                    var tmpCheckScan2 = Check_RFID_t_stockinctnnodetail(txt3RFID.Text.Trim(), "2");
                    if (tmpCheckScan2 != null)
                    {
                        tmpmsg = "RFID:" + txt3RFID.Text + "已经在使用中2。";
                        SetMsg(lbl0Msg, tmpmsg);
                        MessageBox.Show(tmpmsg);
                        txt3RFID.Text = "";
                        _rfid         = "";
                        return;
                    }

                    var tmpkey = txt3RFID.Text.Trim();// txt11stockin_id.Text.Trim() + "," + txt12prdct_no.Text.Trim() + "," + txt3RFID.Text.Trim() + "," + txt4XiangHao.Text.Trim();

                    if (_dicScanItemDetail.ContainsKey(tmpkey))
                    {
                        _dicScanItemDetail[tmpkey].qty  = txt5qty.Text.Trim();
                        _dicScanItemDetail[tmpkey].nwet = txt6nwet.Text.Trim();

                        addToListAllView();

                        SetMsg(lbl0Msg, "RFID:" + txt3RFID.Text + ", 已经存在。");//托盘号:" + txt4XiangHao.Text + "
                    }
                    else
                    {
                        scanItemDetail tmpscan = new scanItemDetail();

                        tmpscan.receiptno = _currStockInDetails.receiptno;

                        tmpscan.stockid   = txt11stockin_id.Text.Trim();
                        tmpscan.productid = txt12prdct_no.Text.Trim();
                        tmpscan.rfid      = txt3RFID.Text.Trim();
                        tmpscan.ctnno_no  = txt4XiangHao.Text.Trim();
                        tmpscan.pqty      = "1";

                        tmpscan.qty  = txt5qty.Text.Trim();
                        tmpscan.nwet = txt6nwet.Text.Trim();

                        //_dicScanItemDetail.Add(tmpkey, tmpscan);
                        addToListAllView(tmpkey, tmpscan);
                    }
                }
                setFouces(e, txt5qty);
            }
            catch (Exception ex)
            {
                tmpmsg = ex.Message;
                MessageBox.Show(ex.Message);
                SetMsg(lbl0Msg, tmpmsg);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Exemple #29
0
        void addToListAllView(string tmpKey, scanItemDetail tmpNewValue)
        {
            this.Invoke(new Action(delegate()
            {
                listView1.Items.Clear();

                addToList(tmpNewValue);

                foreach (var item in _dicScanItemDetail.Values)
                {
                    addToList(item);
                }

                _dicScanItemDetail.Add(tmpKey, tmpNewValue);

            }));

            SetMsg(lbl0Msg, "添加 " + tmpNewValue.rfid + " 成功。");
        }
Exemple #30
0
        bool Update_stockdetail(scanItemDetail item)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                StringDictionary dicItemValue = new StringDictionary();

                dicItemValue[t_stockinctnnodetail.stockin_id] = item.stockid;
                dicItemValue[t_stockinctnnodetail.prdct_no] = item.productid;
                dicItemValue[t_stockinctnnodetail.rfid_no] = item.rfid;
                dicItemValue[t_stockinctnnodetail.ctnno_no] = item.ctnno_no;

                //primary key
                StringDictionary disPrimaryKey = new StringDictionary();

                disPrimaryKey[t_stockinctnnodetail.stockin_id] = item.stockid;
                disPrimaryKey[t_stockinctnnodetail.prdct_no] = item.productid;
                disPrimaryKey[t_stockinctnnodetail.rfid_no] = item.rfid;
                disPrimaryKey[t_stockinctnnodetail.ctnno_no] = item.ctnno_no;

                var dis00UserCollum2 = new StringDictionary();
                dis00UserCollum2[t_stockinctnno.updtime] = "true";
                dis00UserCollum2[t_stockinctnno.upduser] = "true";

                //value

                dicItemValue[t_stockdetail.status] = "0";

                this.m_daoCommon.SetModifyDataItem(ViewOrTable.t_stockinctnnodetail, dicItemValue, disPrimaryKey, dis00UserCollum2);

                return true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {

                Cursor.Current = Cursors.Default;

            }
        }
Exemple #31
0
        void addToListAllView(string tmpKey, scanItemDetail tmpNewValue)
        {
            this.Invoke(new Action(delegate()
            {
                listView1.Items.Clear();

                addToList(tmpNewValue);

                foreach (var item in _dicScanItemDetail.Values)
                {
                    addToList(item);
                }

                _dicScanItemDetail.Add(tmpKey, tmpNewValue);

                txt5PQty.Text = _dicScanItemDetail.Count.ToString();

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

            SetMsg(lbl0Msg, "添加 " + tmpNewValue.ctnno_no + " 成功。");
        }
Exemple #32
0
        public bool Update_t_Stock(scanItemDetail item)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                StringDictionary dicItemValue = new StringDictionary();

                StringDictionary dicConsValue = new StringDictionary();
                //主表
                DataTable dtStock = null;
                dicItemValue[t_stock.prdct_no] = item.productid;
                dicConsValue[t_stock.prdct_no] = "true";

                //primary key
                StringDictionary disPrimaryKey = new StringDictionary();
                disPrimaryKey[t_stock.prdct_no] = item.productid;

                var dis00UserCollum2 = new StringDictionary();
                dis00UserCollum2[t_stock.updtime] = "true";
                dis00UserCollum2[t_stock.upduser] = "true";

                //user
                StringDictionary dis00UserCollum = new StringDictionary();
                //log for use
                dis00UserCollum[t_stock.adduser] = "true";
                dis00UserCollum[t_stock.addtime] = "true";
                dis00UserCollum[t_stock.updtime] = "true";
                dis00UserCollum[t_stock.upduser] = "true";

                //todo
                //get dt
                dtStock = this.m_daoCommon.GetTableInfo(ViewOrTable.t_stock, dicItemValue, dicConsValue, _disNull, "", false);

                if (dtStock.Rows.Count <= 0)
                {
                    //new
                    dicItemValue[t_stock.prdct_no] = item.productid;
                    dicItemValue[t_stock.pqty] = item.pqty;
                    dicItemValue[t_stock.qty] = item.qty;
                    dicItemValue[t_stock.nwet] = item.nwet;
                    dicItemValue[t_stock.gwet] = item.gwet;
                    dicItemValue[t_stock.status] = "1";

                    this.m_daoCommon.SetInsertDataItem(ViewOrTable.t_stock, dicItemValue, dis00UserCollum);

                }
                else
                {

                    var tmp_pqty_Stock = decimal.Parse(dtStock.Rows[0][t_stock.pqty].ToString());
                    var tmp_pqty_StockIn = decimal.Parse(item.pqty);

                    var tmp_qty_Stock = decimal.Parse(dtStock.Rows[0][t_stock.qty].ToString());
                    var tmp_qty_StockIn = decimal.Parse(item.qty);

                    var tmp_nwet_Stock = decimal.Parse(dtStock.Rows[0][t_stock.nwet].ToString());
                    var tmp_nwet_StockIn = decimal.Parse(item.nwet);

                    var tmp_gwet_Stock = decimal.Parse(dtStock.Rows[0][t_stock.gwet].ToString());
                    var tmp_gwet_StockIn = decimal.Parse(item.gwet);
                    //new
                    dicItemValue[t_stock.prdct_no] = item.productid;
                    dicItemValue[t_stock.pqty] = (tmp_pqty_Stock + tmp_pqty_StockIn).ToString();
                    dicItemValue[t_stock.qty] = (tmp_qty_Stock + tmp_qty_StockIn).ToString();
                    dicItemValue[t_stock.nwet] = (tmp_nwet_Stock + tmp_nwet_StockIn).ToString();
                    dicItemValue[t_stock.gwet] = (tmp_gwet_Stock + tmp_gwet_StockIn).ToString();
                    dicItemValue[t_stock.status] = "1";

                    this.m_daoCommon.SetModifyDataItem(ViewOrTable.t_stock, dicItemValue, disPrimaryKey, dis00UserCollum2);

                }

                return true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Exemple #33
0
        public scanItemDetail getRFID_t_stockDetails(scanItemDetail item)
        {
            scanItemDetail tmpScan = new scanItemDetail();

            StringDictionary disWhereValueItem = new StringDictionary();
            StringDictionary disForValueItem = new StringDictionary();

            //table
            DataTable dt = null;
            disWhereValueItem[t_stockdetail.rfid_no] = item.rfid;
            disForValueItem[t_stockdetail.rfid_no] = "true";

            disWhereValueItem[t_stockdetail.prdct_no] = item.productid;
            disForValueItem[t_stockdetail.prdct_no] = "true";

            disWhereValueItem[t_stockdetail.shelf_no] = item.shelf_no;
            disForValueItem[t_stockdetail.shelf_no] = "true";

            disWhereValueItem[t_stockdetail.status] = "1";
            disForValueItem[t_stockdetail.status] = "true";

            disWhereValueItem[t_stockdetail.ctnno_no] = item.ctnno_no;
            disForValueItem[t_stockdetail.ctnno_no] = "true";

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                //get dt
                dt = this.m_daoCommon.GetTableInfo(ViewOrTable.t_stockdetail, disWhereValueItem, disForValueItem, _disNull, "", false);

                if (dt.Rows.Count > 0)
                {
                    var dr = dt.Rows[0];

                    //tmpScan.stockid = dr[t_stockdetail.].ToString();
                    tmpScan.productid = dr[t_stockdetail.prdct_no].ToString();

                    tmpScan.receiptno = dr[t_stockdetail.receiptno].ToString();

                    tmpScan.rfid = dr[t_stockdetail.rfid_no].ToString();
                    tmpScan.shelf_no = dr[t_stockdetail.shelf_no].ToString();

                    tmpScan.ctnno_no = dr[t_stockdetail.ctnno_no].ToString();

                    tmpScan.pqty = dr[t_stockdetail.pqty].ToString();
                    tmpScan.qty = dr[t_stockdetail.qty].ToString();
                    tmpScan.nwet = dr[t_stockdetail.nwet].ToString();
                    tmpScan.gwet = dr[t_stockdetail.gwet].ToString();

                    Cursor.Current = Cursors.Default;
                    return tmpScan;
                }
                else
                {
                    Cursor.Current = Cursors.Default;
                    return null;
                }

            }
            catch (Exception ex)
            {
                var msg = "RFID:" + item.rfid + ",Product:" + item.productid + "," + ex.Message;
                LogManager.WriteLog(Common.LogFile.Error, msg);
                SetMsg(lbl0Msg, msg);
                MessageBox.Show(msg);
                Cursor.Current = Cursors.Default;
                return null;
            }
            finally
            {

                Cursor.Current = Cursors.Default;
            }
        }
Exemple #34
0
        bool InserToT_CheckMain(scanItemDetail item, string gridid)
        {
            try
            {
                StringDictionary dicItemValue = new StringDictionary();
                //user
                StringDictionary DidUserCollum = new StringDictionary();
                //log for use
                DidUserCollum[t_checkresult.adduser] = "true";
                DidUserCollum[t_checkresult.addtime] = "true";
                DidUserCollum[t_checkresult.updtime] = "true";
                DidUserCollum[t_checkresult.upduser] = "true";

                dicItemValue[t_checkresult.check_id] = gridid;
                dicItemValue[t_checkresult.check_date] = DateTime.Now.ToString();
                dicItemValue[t_checkresult.bespeak_no] = item.remark == null ? "" : item.remark;

                dicItemValue[t_checkresult.bespeak_date] = item.shelf_no;
                dicItemValue[t_checkresult.user_no] = Common._personid;

                dicItemValue[t_checkresult.user_nm] = item.rfid;
                dicItemValue[t_checkresult.flag] = "1";

                dicItemValue[t_checkresult.remark] = "补检:" + item.shelf_no + ",收到 RFID:" + item.rfid;

                dicItemValue[t_checkresult.status] = "1";

                this.m_daoCommon.SetInsertDataItem(ViewOrTable.t_checkresult, dicItemValue, DidUserCollum);
                return true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #35
0
        public bool Update_t_Stock(scanItemDetail item)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                StringDictionary dicItemValue = new StringDictionary();

                StringDictionary dicConsValue = new StringDictionary();
                //主表
                DataTable dtStock = null;
                dicItemValue[t_stock.prdct_no] = item.productid;
                dicConsValue[t_stock.prdct_no] = "true";

                //primary key
                StringDictionary disPrimaryKey = new StringDictionary();
                disPrimaryKey[t_stock.prdct_no] = item.productid;

                var dis00UserCollum2 = new StringDictionary();
                dis00UserCollum2[t_stock.updtime] = "true";
                dis00UserCollum2[t_stock.upduser] = "true";

                //user
                StringDictionary dis00UserCollum = new StringDictionary();
                //log for use
                dis00UserCollum[t_stock.adduser] = "true";
                dis00UserCollum[t_stock.addtime] = "true";
                dis00UserCollum[t_stock.updtime] = "true";
                dis00UserCollum[t_stock.upduser] = "true";

                //todo
                //get dt
                dtStock = this.m_daoCommon.GetTableInfo(ViewOrTable.t_stock, dicItemValue, dicConsValue, _disNull, "", false);

                if (dtStock.Rows.Count <= 0)
                {
                    //new
                    dicItemValue[t_stock.prdct_no] = item.productid;
                    dicItemValue[t_stock.pqty]     = item.pqty;
                    dicItemValue[t_stock.qty]      = item.qty;
                    dicItemValue[t_stock.nwet]     = item.nwet;
                    dicItemValue[t_stock.gwet]     = item.gwet;
                    dicItemValue[t_stock.status]   = "1";

                    this.m_daoCommon.SetInsertDataItem(ViewOrTable.t_stock, dicItemValue, dis00UserCollum);
                }
                else
                {
                    var tmp_pqty_Stock   = decimal.Parse(dtStock.Rows[0][t_stock.pqty].ToString());
                    var tmp_pqty_StockIn = decimal.Parse(item.pqty);

                    var tmp_qty_Stock   = decimal.Parse(dtStock.Rows[0][t_stock.qty].ToString());
                    var tmp_qty_StockIn = decimal.Parse(item.qty);

                    var tmp_nwet_Stock   = decimal.Parse(dtStock.Rows[0][t_stock.nwet].ToString());
                    var tmp_nwet_StockIn = decimal.Parse(item.nwet);

                    var tmp_gwet_Stock   = decimal.Parse(dtStock.Rows[0][t_stock.gwet].ToString());
                    var tmp_gwet_StockIn = decimal.Parse(item.gwet);
                    //new
                    dicItemValue[t_stock.prdct_no] = item.productid;
                    dicItemValue[t_stock.pqty]     = (tmp_pqty_Stock + tmp_pqty_StockIn).ToString();
                    dicItemValue[t_stock.qty]      = (tmp_qty_Stock + tmp_qty_StockIn).ToString();
                    dicItemValue[t_stock.nwet]     = (tmp_nwet_Stock + tmp_nwet_StockIn).ToString();
                    dicItemValue[t_stock.gwet]     = (tmp_gwet_Stock + tmp_gwet_StockIn).ToString();
                    dicItemValue[t_stock.status]   = "1";

                    this.m_daoCommon.SetModifyDataItem(ViewOrTable.t_stock, dicItemValue, disPrimaryKey, dis00UserCollum2);
                }

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Exemple #36
0
        private void txt4XiangHao_KeyDown(object sender, KeyEventArgs e)
        {
            var tmpmsg = "";

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    if (!checkTxt())
                    {
                        return;
                    }

                    var tmpCheckScan1 = Check_RFID_t_stockOutdetail(txt3RFID.Text.Trim(), txt11stockin_id.Text.Trim(), txt12prdct_no.Text.Trim());

                    if (tmpCheckScan1 == null)
                    {
                        tmpmsg = "不存在对应的 出库号:" + txt11stockin_id.Text + ",货物编号:" + txt12prdct_no.Text + ",RFID:" + txt3RFID.Text;
                        SetMsg(lbl0Msg, tmpmsg);
                        MessageBox.Show(tmpmsg);
                        txt3RFID.Text = "";
                        _rfid = "";
                        return;
                    }

                    var tmpCheckStockDetails = Check_RFID_t_stockdetail(txt3RFID.Text.Trim(), txt12prdct_no.Text.Trim());

                    if (tmpCheckStockDetails == null)
                    {
                        tmpmsg = "出库号:" + txt11stockin_id.Text + ", 货物编号:" + txt12prdct_no.Text + ",RFID:" + txt3RFID.Text + " 早已出库。";
                        SetMsg(lbl0Msg, tmpmsg);
                        MessageBox.Show(tmpmsg);
                        txt3RFID.Text = "";
                        _rfid = "";
                        return;
                    }

                    var tmpkey = txt3RFID.Text.Trim();// txt11stockin_id.Text.Trim() + "," + txt12prdct_no.Text.Trim() + "," + txt3RFID.Text.Trim() + "," + txt4XiangHao.Text.Trim();

                    if (_dicScanItemDetail.ContainsKey(tmpkey))
                    {
                        _dicScanItemDetail[tmpkey].qty = txt5qty.Text.Trim();
                        _dicScanItemDetail[tmpkey].nwet = txt6nwet.Text.Trim();

                        addToListAllView();

                        SetMsg(lbl0Msg, "RFID:" + txt3RFID.Text + ", 已经存在。");//托盘号:" + txt4XiangHao.Text + "
                    }
                    else
                    {
                        scanItemDetail tmpscan = new scanItemDetail();

                        tmpscan.receiptno = tmpCheckScan1.receiptno;

                        _isChangeTxt = true;
                        tmpscan.stockid = txt11stockin_id.Text.Trim();
                        tmpscan.productid = txt12prdct_no.Text.Trim();
                        tmpscan.rfid = txt3RFID.Text.Trim();
                        tmpscan.ctnno_no = txt4XiangHao.Text.Trim();
                        tmpscan.pqty = "1";

                        txt5qty.Text = tmpCheckScan1.qty;
                        txt6nwet.Text = tmpCheckScan1.nwet;

                        tmpscan.qty = txt5qty.Text.Trim();
                        tmpscan.nwet = txt6nwet.Text.Trim();
                        tmpscan.gwet = (tmpCheckScan1.gwet == null || tmpCheckScan1.gwet == "") ? "0" : tmpCheckScan1.gwet;

                        _isChangeTxt = false;
                        //_dicScanItemDetail.Add(tmpkey, tmpscan);
                        addToListAllView(tmpkey, tmpscan);
                    }

                }
                setFouces(e, txt5qty);
            }
            catch (Exception ex)
            {
                tmpmsg = ex.Message;
                MessageBox.Show(ex.Message);
                SetMsg(lbl0Msg, tmpmsg);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }