Example #1
0
 private void txtSlId_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 27)
     {
         mtrans = null;
         this.labmaterialname.Text = "";
         this.labneedqty.Text      = "";
         this.labfromsIId.Text     = "";
         this.txtSlId.Text         = "";
         this.txtSlId.Enabled      = false;
         this.txtorderid.Enabled   = true;
         this.txtorderid.Text      = "";
         this.txtorderid.Focus();
         return;
     }
     if (e.KeyChar != 13)
     {
         return;
     }
     //this.txtSlId.Text = this.txtSlId.Text.ToUpper();
     if (this.txtSlId.Text != mtrans.data.fromSlIdName.ToString())
     {
         MessageBox.Show("来源库位不正确");
         this.txtSlId.SelectAll();
         return;
     }
     this.txtSlId.Enabled     = false;
     this.txttraycode.Enabled = true;
     this.txttraycode.Focus();
 }
Example #2
0
        void GetTrans(bool benter)
        {
            string con = @"orderId=" + this.txtorderid.Text + "&lcCode=" + Comm.lcCode + "&whId=" + Comm.warehousecode;

            if (mtrans != null && mtrans.data != null && !benter)
            {
                con += "&orderItemId=" + mtrans.data.orderItemId.ToString() + "&quantity=" + commonqty.ToString() + "&minQuantity=" + minqty.ToString() + "&fromTrayCode=" + this.txttraycode.Text + "&toTrayCode=" + this.txttotraycode.Text + "&updater=" + Comm.usercode + "&fromSlId=" + this.mtrans.data.fromSlId + "&materialCode=" + mtrans.data.materialCode + "&recommendId=" + mtrans.data.recommendId;
            }
            if (benter)
            {
                con += "&orderItemId=" + mtrans.data.orderItemId.ToString() + "&recommendId=" + mtrans.data.recommendId;
            }
            string x = HttpHelper.HttpPost("replenishOrder/processorSourceOperate", con);

            msg = (Model.Mmsg)JsonConvert.DeserializeObject(x, typeof(Model.Mmsg));
            if (msg == null)
            {
                throw new Exception("错误信息捕捉失败");
            }
            if (!msg.success)
            {
                throw new Exception(msg.msg);
            }
            mtrans = (Model.Mreplenish)JsonConvert.DeserializeObject(x, typeof(Model.Mreplenish));
            if (mtrans == null)
            {
                throw new Exception("数据信息捕捉失败");
            }
            Clear();
            if (mtrans.data == null)
            {
                MessageBox.Show("该单据已经操作完成");
                this.txtorderid.Enabled = true;
                this.txtorderid.Text    = "";
                this.txtorderid.Focus();
            }
            else
            {
                this.btnAssistance.Text   = mtrans.data.assistanceName;
                this.labfromsIId.Text     = mtrans.data.fromSlIdName.ToString();
                this.labmaterialname.Text = "物料描述  " + mtrans.data.materialName;
                //this.labneedqty.Text = mtrans.data.quantity.ToString() + mtrans.data.commonUnitName + mtrans.data.minQuantity.ToString() + mtrans.data.minUnitName + " " + mtrans.data.batchNo;
                this.labneedqty.Text    = "应补数量 " + mtrans.data.quantity.ToString() + mtrans.data.commonUnitName + " " + mtrans.data.pdate;
                this.labcommonUnit.Text = mtrans.data.commonUnitName;
                //this.labminunit.Text = mtrans.data.minUnitName;
                this.labtoslidname.Text = mtrans.data.toSlIdName;
                //this.txtSlId.Enabled = true;
                //this.txtSlId.Focus();
                this.txttraycode.Enabled = true;
                this.txttraycode.Focus();
            }
        }
Example #3
0
        private void txttraycode_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == 27)
            {
                this.txttraycode.Text    = "";
                this.txttraycode.Enabled = false;
                //this.txtSlId.Enabled = true;
                //this.txtSlId.Text = "";
                //this.txtSlId.Focus();
                mtrans = null;
                this.labmaterialname.Text = "";
                this.labneedqty.Text      = "";
                this.labfromsIId.Text     = "";
                //this.txtSlId.Text = "";
                //this.txtSlId.Enabled = false;
                this.txtorderid.Enabled = true;
                this.txtorderid.Text    = "";
                this.txtorderid.Focus();
                return;
            }
            if (e.KeyChar != 13)
            {
                return;
            }
            if (this.txttraycode.Text == "")
            {
                return;
            }
            ////this.txttraycode.Text = this.txttraycode.Text.ToUpper();
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                string conn = @"orderItemId=" + mtrans.data.orderItemId.ToString() + "&lcCode=" + Comm.lcCode + "&whId=" + Comm.warehousecode + "&recommendId=" + mtrans.data.recommendId;
                if (this.txttraycode.Text.Length < Comm.lcCode.Length)
                {
                    MessageBox.Show("请扫描条码");
                    this.txttraycode.SelectAll();
                    return;
                }
                if (Comm.lcCode != this.txttraycode.Text.Substring(0, Comm.lcCode.Length))
                {
                    conn += @"&boxCode=" + this.txttraycode.Text;
                }
                else
                {
                    conn += @"&trayCode=" + this.txttraycode.Text;
                }
                string x = HttpHelper.HttpPost("replenishOrder/judgeTrayForReplenishOrder", conn);
                msg = (Model.Mmsg)JsonConvert.DeserializeObject(x, typeof(Model.Mmsg));
                if (msg == null)
                {
                    throw new Exception("错误信息捕捉失败");
                }
                if (!msg.success)
                {
                    throw new Exception(msg.msg);
                }
                _mt = (Model.Mtray)JsonConvert.DeserializeObject(x, typeof(Model.Mtray));
                if (_mt == null)
                {
                    throw new Exception("judgeTray数据信息捕捉失败");
                }
                this.txttraycode.Text = _mt.data.trayCode;
                //this.labtrayqty.Text = _mt.data.quantity.ToString() + mtrans.data.commonUnitName + _mt.data.minQuantity.ToString() + mtrans.data.minUnitName;
                this.labtrayqty.Text = _mt.data.quantity.ToString() + mtrans.data.commonUnitName;
                Cursor.Current       = Cursors.Default;
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message);
                return;
            }

            this.txttraycode.Enabled  = false;
            this.txtcommonqty.Enabled = true;
            this.txtcommonqty.Focus();
        }