Example #1
0
        private void btnData_Click(object sender, EventArgs e)
        {
            if (this.txtorderid.Enabled)
            {
                MessageBox.Show("请先扫描单据");
                this.txtorderid.Focus();
                this.txtorderid.SelectAll();
                return;
            }
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                string x = HttpHelper.HttpPost("getPickSlList", @"lcCode=" + Comm.lcCode + "&pickNo=" + 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);
                }
                ms1 = (Model.MShowList)JsonConvert.DeserializeObject(x, typeof(Model.MShowList));
                if (ms1 == null)
                {
                    throw new Exception("数据信息捕捉失败");
                }
                if (ms1.data.Count == 0)
                {
                    throw new Exception("当前库区拣货完成!");
                }
                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message);
                return;
            }

            DataTable dt = GetDT(ms1.data);

            Ot.frmList frm = new Rf_Wms.Ot.frmList();
            frm.dt      = dt;
            frm.txtname = "待拣货列表";
            frm.ShowDialog();
            foreach (Control v in this.Controls)
            {
                if (v is TextBox)
                {
                    if (v.Enabled)
                    {
                        v.Focus();
                    }
                }
            }
        }
Example #2
0
        private void btnData_Click(object sender, EventArgs e)
        {
            if (this.txtorderid.Enabled)
            {
                //MessageBox.Show("请先扫描单据");
                this.txtorderid.Focus();
                this.txtorderid.SelectAll();
                return;
            }
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                string x = HttpHelper.HttpPost("replenishOrder/findWaitMachineList", @"lcCode=" + Comm.lcCode + "&orderId=" + this.txtorderid.Text);
                msg = (Model.Mmsg)JsonConvert.DeserializeObject(x, typeof(Model.Mmsg));
                if (msg == null)
                {
                    throw new Exception("错误信息捕捉失败");
                }
                if (!msg.success)
                {
                    throw new Exception(msg.msg);
                }
                ms = (Model.MShowList)JsonConvert.DeserializeObject(x, typeof(Model.MShowList));
                if (ms == null)
                {
                    throw new Exception("数据信息捕捉失败");
                }
                if (ms.data.Count == 0)
                {
                    throw new Exception("该单据已经操作完成");
                }
                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message);
                return;
            }
            DataTable dt = Comm.GetDT(ms.data);

            Ot.frmList frm = new Rf_Wms.Ot.frmList();
            frm.dt      = dt;
            frm.txtname = "待补货列表";
            frm.ShowDialog();
        }
Example #3
0
        private void btnData_Click(object sender, EventArgs e)
        {
            if (this.txtorderid.Enabled)
            {
                return;
            }
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                string x = HttpHelper.HttpPost("allWaitingRefundItem", @"lcCode=" + Comm.lcCode + "&orderId=" + this.txtorderid.Text + "&whId=" + Comm.warehousecode);
                msg = (Model.Mmsg)JsonConvert.DeserializeObject(x, typeof(Model.Mmsg));
                if (msg == null)
                {
                    throw new Exception("错误信息捕捉失败");
                }
                if (!msg.success)
                {
                    throw new Exception(msg.msg);
                }
                ms = (Model.MShowList)JsonConvert.DeserializeObject(x, typeof(Model.MShowList));
                if (ms == null)
                {
                    throw new Exception("数据信息捕捉失败");
                }
                if (ms.data.Count == 0)
                {
                    throw new Exception("该单据已经操作完成");
                }
                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message);
                return;
            }
            //DataTable dt = Comm.GetDT(ms.data);
            DataTable dt = new DataTable();

            dt.Columns.Add("materialCode");
            dt.Columns.Add("materialName");
            dt.Columns.Add("pdate");
            dt.Columns.Add("batchNo");
            dt.Columns.Add("qty");
            dt.Columns.Add("slName");
            dt.Columns.Add("fromSlIdName");
            dt.Columns.Add("toSlIdName");
            dt.Columns.Add("trayCode");
            DataRow dr;

            foreach (Model.material v in ms.data)
            {
                //if (v.quantity == v.realQuantity && v.minQuantity == v.realMinquantity)
                //    continue;
                dr = dt.NewRow();
                dr["materialCode"] = v.materialCode;
                dr["materialName"] = v.materialName;
                //if (!string.IsNullOrEmpty(v.pDate))
                //{
                //    dr["pdate"] = v.pDate;
                //}
                //else
                //{
                dr["pdate"] = "";
                //}
                if (!string.IsNullOrEmpty(v.batchNo))
                {
                    dr["batchNo"] = v.batchNo;
                }
                else
                {
                    dr["batchNo"] = "";
                }
                dr["slName"] = v.slName;
                //int _quantity = v.quantity-v.realQuantity-v.surplusQuantity;
                ////if (_quantity < 0)
                ////    _quantity = 0;
                //int _minquantity = v.minQuantity-v.realMinquantity-v.surplusMinQuantity;
                ////if (_minquantity < 0)
                ////    _minquantity = 0;
                //dr["qty"] = _quantity.ToString() + v.commonUnitName + _minquantity.ToString() + v.minUnitName;
                int _quantity = v.quantity - v.realQuantity - v.surplusQuantity;
                //if (_quantity < 0)
                //    _quantity = 0;
                int _minquantity = v.minQuantity - v.realMinquantity - v.surplusMinQuantity;
                //if (_minquantity < 0)
                //    _minquantity = 0;

                if (_quantity < 0 || _minquantity < 0)
                {
                    int imax = _quantity * v.spec + _minquantity;
                    //_quantity = (int)(Math.Ceiling(((double)(imax) / v.spec)));
                    _quantity    = imax / v.spec;
                    _minquantity = imax % v.spec;
                }
                dr["qty"]          = _quantity.ToString() + v.commonUnitName + _minquantity.ToString() + v.minUnitName;
                dr["fromSlIdName"] = "";
                dr["toSlIdName"]   = "";
                dr["trayCode"]     = "";
                //if (string.IsNullOrEmpty(v.pDate))
                //{
                //    v.pDate = "";
                //}
                if (string.IsNullOrEmpty(v.batchNo))
                {
                    v.batchNo = "";
                }
                dt.Rows.Add(dr);
            }
            Ot.frmList frm = new Rf_Wms.Ot.frmList();
            frm.dt      = dt;
            frm.txtname = "合单待收货列表";
            frm.ShowDialog();
        }
Example #4
0
        private void btnData_Click(object sender, EventArgs e)
        {
            //if (this.txtorderid.Enabled)
            //    return;
            Model.MShowList mx = null;
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                string x = HttpHelper.HttpPost("/getPickOperateList", @"lcCode=" + Comm.lcCode + "&pickNo=" + this.lblpickno.Text + "&whId=" + Comm.warehousecode);
                msg = (Model.Mmsg)JsonConvert.DeserializeObject(x, typeof(Model.Mmsg));
                if (msg == null)
                {
                    throw new Exception("错误信息捕捉失败");
                }
                if (!msg.success)
                {
                    throw new Exception(msg.msg);
                }
                mx = (Model.MShowList)JsonConvert.DeserializeObject(x, typeof(Model.MShowList));
                if (mx == null)
                {
                    throw new Exception("数据信息捕捉失败");
                }
                if (mx.data.Count == 0)
                {
                    throw new Exception("该单据已经操作完成");
                }
                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message);
                return;
            }
            //DataTable dt = Comm.GetDT(mx.data);
            DataTable dt = new DataTable();

            dt.Columns.Add("materialCode");
            dt.Columns.Add("materialName");
            dt.Columns.Add("pdate");
            dt.Columns.Add("batchNo");
            dt.Columns.Add("qty");
            dt.Columns.Add("slName");
            dt.Columns.Add("fromSlIdName");
            dt.Columns.Add("toSlIdName");
            dt.Columns.Add("trayCode");
            DataRow dr;

            foreach (Model.material v in mx.data)
            {
                //if (v.quantity == v.realQuantity && v.minQuantity == v.realMinquantity)
                //    continue;
                dr = dt.NewRow();
                dr["materialCode"] = v.materialCode;
                dr["materialName"] = v.materialName;
                if (!string.IsNullOrEmpty(v.pdate))
                {
                    dr["pdate"] = v.pdate;
                }
                else
                {
                    dr["pdate"] = "";
                }
                if (!string.IsNullOrEmpty(v.batchNo))
                {
                    dr["batchNo"] = v.batchNo;
                }
                else
                {
                    dr["batchNo"] = "";
                }
                dr["slName"] = "";
                int _quantity = v.quantity;
                if (_quantity < 0)
                {
                    _quantity = 0;
                }
                int _minquantity = v.minQuantity;
                if (_minquantity < 0)
                {
                    _minquantity = 0;
                }
                dr["qty"]          = _quantity.ToString() + v.commonUnitName + _minquantity.ToString() + v.minUnitName;
                dr["fromSlIdName"] = "";
                dr["toSlIdName"]   = "";
                dr["trayCode"]     = "";
                if (string.IsNullOrEmpty(v.pdate))
                {
                    v.pdate = "";
                }
                if (string.IsNullOrEmpty(v.batchNo))
                {
                    v.batchNo = "";
                }
                dt.Rows.Add(dr);
            }
            Ot.frmList frm = new Rf_Wms.Ot.frmList();
            frm.dt = dt;
            frm.ShowDialog();
            foreach (Control v in this.Controls)
            {
                if (v is TextBox)
                {
                    if (v.Enabled)
                    {
                        v.Focus();
                    }
                }
            }
        }
Example #5
0
        private void btnData_Click(object sender, EventArgs e)
        {
            if (ml == null)
            {
                return;
            }
            DataTable dt = new DataTable();

            dt.Columns.Add("materialCode");
            dt.Columns.Add("materialName");
            dt.Columns.Add("pdate");
            dt.Columns.Add("batchNo");
            dt.Columns.Add("qty");
            dt.Columns.Add("slName");
            dt.Columns.Add("fromSlIdName");
            dt.Columns.Add("toSlIdName");
            dt.Columns.Add("trayCode");
            DataRow dr;

            foreach (Model.locationStockLists v in ml.data)
            {
                //if (v.quantity == v.realQuantity && v.minQuantity == v.realMinquantity)
                //    continue;
                dr = dt.NewRow();
                dr["materialCode"] = v.materialCode;
                dr["materialName"] = v.materialCodeName;
                if (!string.IsNullOrEmpty(v.pdateStr))
                {
                    dr["pdate"] = v.pdateStr;
                }
                else
                {
                    dr["pdate"] = "";
                }
                if (!string.IsNullOrEmpty(v.batchNo))
                {
                    dr["batchNo"] = v.batchNo;
                }
                else
                {
                    dr["batchNo"] = "";
                }
                dr["slName"] = "";
                int _quantity = v.totalQuantity;
                //if (_quantity < 0)
                //    _quantity = 0;
                int _minquantity = v.minTotalQuantity;
                //if (_minquantity < 0)
                //    _minquantity = 0;

                if (_quantity < 0 || _minquantity < 0)
                {
                    int imax = _quantity * v.spec + _minquantity;
                    //_quantity = (int)(Math.Ceiling(((double)(imax) / v.spec)));
                    _quantity    = imax / v.spec;
                    _minquantity = imax % v.spec;
                }
                if (_quantity * v.spec + _minquantity == 0)
                {
                    continue;
                }
                dr["qty"]          = _quantity.ToString() + v.unit + _minquantity.ToString() + v.minUnit;
                dr["fromSlIdName"] = "";
                dr["toSlIdName"]   = "";
                dr["trayCode"]     = "";
                if (string.IsNullOrEmpty(v.pdateStr))
                {
                    v.pdateStr = "";
                }
                if (string.IsNullOrEmpty(v.batchNo))
                {
                    v.batchNo = "";
                }
                dt.Rows.Add(dr);
            }
            Ot.frmList frm = new Rf_Wms.Ot.frmList();
            frm.dt = dt;
            frm.ShowDialog();
            foreach (Control v in this.Controls)
            {
                if (v is TextBox)
                {
                    if (v.Enabled)
                    {
                        v.Focus();
                    }
                }
            }
        }