示例#1
0
 private void txtSlId_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 27)
     {
         mc = null;
         this.labmaterialcode.Text = "";
         //this.labmaterialname.Text = "";
         this.labinfo.Text    = "";
         this.labsIname.Text  = "";
         this.txtSlId.Text    = "";
         this.txtSlId.Enabled = false;
         this.cbxrr.Enabled   = true;
         this.cbxrr.Focus();
         //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 != mc.data.slName)
     {
         MessageBox.Show("盘点库位不正确");
         this.txtSlId.SelectAll();
         return;
     }
     this.txtSlId.Enabled      = false;
     this.txtcommonqty.Enabled = true;
     this.txtcommonqty.Focus();
 }
示例#2
0
 private void cbxrr_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 27)
     {
         this.cbxrr.Enabled      = false;
         this.txtorderid.Enabled = true;
         this.txtorderid.Focus();
         this.txtorderid.SelectAll();
         return;
     }
     if (e.KeyChar != 13)
     {
         return;
     }
     try
     {
         string x = HttpHelper.HttpPost("checkResult", @"lcCode=" + Comm.lcCode + "&orderId=" + this.txtorderid.Text + "&whId=" + Comm.warehousecode + "&rrId=" + this.cbxrr.SelectedValue.ToString());
         msg = (Model.Mmsg)JsonConvert.DeserializeObject(x, typeof(Model.Mmsg));
         if (msg == null)
         {
             throw new Exception("错误信息捕捉失败");
         }
         if (!msg.success)
         {
             throw new Exception(msg.msg);
         }
         mc = (Model.McheckResult)JsonConvert.DeserializeObject(x, typeof(Model.McheckResult));
         if (mc == null)
         {
             throw new Exception("checkResult捕捉失败");
         }
         if (mc.data == null)
         {
             throw new Exception("该库区盘点完成");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         return;
     }
     this.labsIname.Text       = mc.data.slName;
     this.labmaterialcode.Text = "物料信息 " + mc.data.materialCode + " " + mc.data.materialName;
     //this.labmaterialname.Text = mc.data.materialName;
     this.labcommonUnit.Text = mc.data.commonUnitName;
     this.labminunit.Text    = mc.data.minUnitName;
     this.labinfo.Text       = mc.data.pdate + " " + mc.data.batchNo;
     if (!mc.data.blind)
     {
         this.labinfo.Text     += " " + mc.data.quantity.ToString() + mc.data.commonUnitName + mc.data.minQuantity.ToString() + mc.data.minUnitName;
         this.txtcommonqty.Text = mc.data.quantity.ToString();
         this.txtminqty.Text    = mc.data.minQuantity.ToString();
     }
     //commonqty = mc.data.quantity;
     //minqty = mc.data.minQuantity;
     this.cbxrr.Enabled   = false;
     this.txtSlId.Enabled = true;
     this.txtSlId.Focus();
 }
示例#3
0
        void checkAgain()
        {
            string con = @"orderId=" + this.txtorderid.Text + "&lcCode=" + Comm.lcCode + "&whId=" + Comm.warehousecode + "&orderItemId=" + mc.data.orderItemId + "&updater=" + Comm.usercode;

            con += "&exception=1";
            try
            {
                if (string.IsNullOrEmpty(this.txtcommonqty.Text))
                {
                    commonqty = -1;
                }
                else
                {
                    commonqty = Convert.ToInt32(this.txtcommonqty.Text);
                }
                if (string.IsNullOrEmpty(this.txtminqty.Text))
                {
                    minqty = -1;
                }
                else
                {
                    minqty = Convert.ToInt32(this.txtminqty.Text);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            if (commonqty != -1 || minqty != -1)
            {
                con += "&quantity=" + commonqty + "&minQuantity=" + minqty;
            }
            con += "&rrId=" + this.cbxrr.SelectedValue.ToString();
            //if (k.Count != 0)
            //{
            //    con += "&repeatReason=[";
            //    foreach (Model.MCVreason y in k)
            //    {
            //        con += "{\"trayCode\":\"" + y.code + "\",";
            //        con += "\"repeatReason\":" + y.des + "},";
            //    }
            //    con = con.Substring(0, con.Length - 1) + "]";
            //}
            string x = HttpHelper.HttpPost("checkRepeats", con);

            msg = (Model.Mmsg)JsonConvert.DeserializeObject(x, typeof(Model.Mmsg));
            if (msg == null)
            {
                throw new Exception("错误信息捕捉失败");
            }
            if (!msg.success)
            {
                throw new Exception(msg.msg);
            }

            m = (Model.MrepeatInfos)JsonConvert.DeserializeObject(x, typeof(Model.MrepeatInfos));
            if (m == null)
            {
                throw new Exception("Mcheckrepeats捕捉失败");
            }
            Cursor.Current = Cursors.Default;
            frmCheckVoSecond frm = new frmCheckVoSecond();

            frm.m       = m;
            frm.orderid = this.txtorderid.Text;
            frm.ShowDialog();

            x   = HttpHelper.HttpPost("checkResult", @"lcCode=" + Comm.lcCode + "&orderId=" + this.txtorderid.Text + "&whId=" + Comm.warehousecode + "&rrId=" + this.cbxrr.SelectedValue.ToString());
            msg = (Model.Mmsg)JsonConvert.DeserializeObject(x, typeof(Model.Mmsg));
            if (msg == null)
            {
                throw new Exception("错误信息捕捉失败");
            }
            if (!msg.success)
            {
                throw new Exception(msg.msg);
            }
            mc = (Model.McheckResult)JsonConvert.DeserializeObject(x, typeof(Model.McheckResult));
            if (mc == null)
            {
                throw new Exception("checkResult捕捉失败");
            }
            Clear();
            //k.Clear();

            if (mc.data == null)
            {
                this.txtorderid.Enabled = true;
                this.txtorderid.Focus();
                this.txtorderid.SelectAll();
                throw new Exception("该库区盘点完成");
            }
            this.labsIname.Text       = mc.data.slName;
            this.labmaterialcode.Text = "物料信息 " + mc.data.materialCode + " " + mc.data.materialName;
            //this.labmaterialname.Text = mc.data.materialName;
            this.labcommonUnit.Text = mc.data.commonUnitName;
            this.labminunit.Text    = mc.data.minUnitName;
            this.labinfo.Text       = mc.data.pdate + " " + mc.data.batchNo;
            if (!mc.data.blind)
            {
                this.labinfo.Text         += " " + mc.data.quantity.ToString() + mc.data.commonUnitName + mc.data.minQuantity.ToString() + mc.data.minUnitName;
                this.btnCheckAgain.Visible = true;
            }
            else
            {
                this.btnCheckAgain.Visible = false;
            }
            this.txtorderid.Enabled = false;
            this.txtSlId.Enabled    = true;
            this.txtSlId.Focus();
        }
示例#4
0
        void Save(bool isexception)
        {
            //string addcon = "";
            //if (commonqty != 0)
            //{
            //    if (commonqty > mc.data.quantity || (commonqty == mc.data.quantity && minqty > mc.data.minQuantity))
            //    {
            //        addcon = "&quantity=" + commonqty + "&minQuantity=" + minqty + "&repeatReason=5";
            //    }
            //    if (commonqty < mc.data.quantity || (commonqty == mc.data.quantity && minqty < mc.data.minQuantity))
            //    {
            //        addcon = "&quantity=" + commonqty + "&minQuantity=" + minqty + "&repeatReason=4";
            //    }
            //}

            string con = @"orderId=" + this.txtorderid.Text + "&lcCode=" + Comm.lcCode + "&whId=" + Comm.warehousecode + "&orderItemId=" + mc.data.orderItemId + "&updater=" + Comm.usercode;

            if (commonqty != mc.data.quantity || minqty != mc.data.minQuantity || isexception)
            {
                con += "&exception=1";
            }
            else
            {
                con += "&exception=0";
            }
            if (isexception)
            {
                con += "&quantity=0&minQuantity=0";
            }
            else if (commonqty != -1 || minqty != -1)
            {
                con += "&quantity=" + commonqty + "&minQuantity=" + minqty;
            }
            con += "&rrId=" + this.cbxrr.SelectedValue.ToString();
            //if (k.Count != 0)
            //{
            //    con += "&repeatReason=[";
            //    foreach (Model.MCVreason y in k)
            //    {
            //        con += "{\"trayCode\":\""+y.code+"\",";
            //        con += "\"repeatReason\":" + y.des+"}," ;
            //    }
            //    con = con.Substring(0, con.Length - 1) + "]";
            //}
            string x = HttpHelper.HttpPost("checkResult", con);

            msg = (Model.Mmsg)JsonConvert.DeserializeObject(x, typeof(Model.Mmsg));
            if (msg == null)
            {
                throw new Exception("错误信息捕捉失败");
            }
            if (!msg.success)
            {
                throw new Exception(msg.msg);
            }

            mc = (Model.McheckResult)JsonConvert.DeserializeObject(x, typeof(Model.McheckResult));
            if (mc == null)
            {
                throw new Exception("checkResult捕捉失败");
            }

            Clear();
            if (mc.data == null)
            {
                //this.txtorderid.Text = "";
                this.txtorderid.SelectAll();
                this.txtorderid.Enabled = true;
                this.txtorderid.Focus();
                throw new Exception("该库区盘点完成");
            }
            //k.Clear();
            this.labsIname.Text       = mc.data.slName;
            this.labmaterialcode.Text = "物料信息 " + mc.data.materialCode + " " + mc.data.materialName;
            //this.labmaterialname.Text = mc.data.materialName;
            this.labcommonUnit.Text = mc.data.commonUnitName;
            this.labminunit.Text    = mc.data.minUnitName;
            this.labinfo.Text       = mc.data.pdate + " " + mc.data.batchNo;
            if (!mc.data.blind)
            {
                this.labinfo.Text     += " " + mc.data.quantity.ToString() + mc.data.commonUnitName + mc.data.minQuantity.ToString() + mc.data.minUnitName;
                this.txtcommonqty.Text = mc.data.quantity.ToString();
                this.txtminqty.Text    = mc.data.minQuantity.ToString();
            }
            this.txtorderid.Enabled = false;
            this.txtSlId.Enabled    = true;
            this.txtSlId.Focus();
        }