Пример #1
0
        void Next()
        {
            row++;
            if (row == mf.data.Count)
            {
                mf = null;
                try
                {
                    Cursor.Current = Cursors.WaitCursor;

                    GetMaterialStockInOrder();
                    Cursor.Current = Cursors.Default;
                }
                catch (Exception ex)
                {
                    Cursor.Current = Cursors.Default;
                    MessageBox.Show(ex.Message);
                    return;
                }
                //Findsoorderid();
                this.labneedqty.Text     = "";
                this.txtsorderid.Text    = "";
                this.txtsorderid.Enabled = true;
                this.txtsorderid.Focus();
                return;
            }
            else
            {
                ShowVal();
                this.txtcommonqty.Enabled = true;
                this.txtcommonqty.Focus();
                return;
            }
        }
Пример #2
0
 void Findsoorderid()
 {
     row = 0;
     try
     {
         Cursor.Current = Cursors.WaitCursor;
         string x = HttpHelper.HttpPost("verifyStockInOrderInMerge", @"stockInOrderId=" + this.txtsorderid.Text + "&lcCode=" + Comm.lcCode + "&refundOrderId=" + this.txtorderid.Text + "&whId=" + Comm.warehousecode + @"&materialCode=" + materialbody.code);
         msg = (Model.Mmsg)JsonConvert.DeserializeObject(x, typeof(Model.Mmsg));
         if (msg == null)
         {
             throw new Exception("错误信息捕捉失败");
         }
         if (!msg.success)
         {
             throw new Exception(msg.msg);
         }
         mf = (Model.MergeRefundOrder)JsonConvert.DeserializeObject(x, typeof(Model.MergeRefundOrder));
         if (mf == null)
         {
             throw new Exception("数据信息捕捉失败");
         }
         ShowVal();
         //this.labneedqty.Text =  mf.data[row].quantity + materialbody.commonUnit + mf.data[row].minQuantity + materialbody.minUnit;
         Cursor.Current = Cursors.Default;
     }
     catch (Exception ex)
     {
         Cursor.Current = Cursors.Default;
         //this.txtbarcode.Text = "";
         MessageBox.Show(ex.Message);
         return;
     }
     this.txtsorderid.Enabled  = false;
     this.txtminqty.Enabled    = false;
     this.txtminqty.Text       = "";
     this.txtcommonqty.Text    = "";
     this.txtcommonqty.Enabled = true;
     this.txtcommonqty.Focus();
 }
Пример #3
0
        private void txtminqty_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == 27)
            {
                this.txtcommonqty.Enabled = true;
                this.txtminqty.Enabled    = false;
                this.txtminqty.Text       = "";
                this.txtcommonqty.Focus();
                //btnShelve.Visible = false;
                this.txtcommonqty.SelectAll();
                return;
            }
            if (e.KeyChar != 13)
            {
                return;
            }
            if (this.txtminqty.Text == "")
            {
                this.txtminqty.Text = "0";
            }
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                checkmin();
                Save();
                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message);
                return;
            }
            this.txtminqty.Enabled = false;
            this.txtminqty.Text    = "";
            this.txtcommonqty.Text = "";
            //maxquantity = getmaterial.data[0].quantity - getmaterial.data[0].realQuantity - getmaterial.data[0].surplusQuantity + mb.data.quantity;
            //maxminquantity = getmaterial.data[0].minQuantity - getmaterial.data[0].realMinquantity - getmaterial.data[0].surplusMinQuantity + mb.data.minQuantity;
            maxquantity    = getmaterial.data[0].quantity - getmaterial.data[0].realQuantity;
            maxminquantity = getmaterial.data[0].minQuantity - getmaterial.data[0].realMinquantity;
            allqty        -= commonqty;
            allminqty     -= minqty;
            if (maxquantity <= 0 && maxminquantity <= 0)
            {
                mf = null;
                this.labneedqty.Text      = "";
                this.labsurplus.Text      = "";
                this.txtcommonqty.Text    = "";
                this.txtminqty.Text       = "";
                this.txtsorderid.Text     = "";
                this.labmaterialname.Text = "";
                this.labminunit.Text      = "";
                this.labcommonUnit.Text   = "";
                this.txtbarcode.Text      = "";
                this.txtbarcode.Enabled   = true;
                this.txtbarcode.Focus();
                return;
            }
            //if (commonqty == mf.data[row].quantity && minqty == mf.data[row].minQuantity)
            //{
            Next();

            return;
            //}

            //this.labneedqty.Text = "";
            //this.labsurplus.Text = "";
            //this.txtcommonqty.Text = "";
            //this.txtminqty.Text = "";
            //this.txtsorderid.Text = "";
            //this.txtsorderid.Enabled = true;
            //this.txtsorderid.Focus();
            //return;
        }