void clear() { mq = null; this.txtcheckminqty.Text = ""; this.txtcheckqty.Text = ""; this.txtcommonqty.Text = ""; this.txtminqty.Text = ""; //this.txttraycode.Text = ""; this.txtcheckminqty.Enabled = false; this.labbatch.Text = ""; this.labcheckqty.Text = ""; this.labcommonUnit.Text = ""; this.labmaterialname.Text = ""; this.labminunit.Text = ""; this.labpdata.Text = ""; this.labqty.Text = ""; sqty = 0; sminqty = 0; }
private void btnData_Click(object sender, EventArgs e) { //if (this.txttraycode.Enabled || this.txtorderid.Enabled) // return; //if (mq == null) //{ try { Cursor.Current = Cursors.WaitCursor; string x = HttpHelper.HttpPost("getQuantityListByTray", @"pickNo=" + this.lblpickno.Text + "&lcCode=" + Comm.lcCode + "&whId=" + Comm.warehousecode + "&toTrayCode=" + this.lbltraycode.Text); msg = (Model.Mmsg)JsonConvert.DeserializeObject(x, typeof(Model.Mmsg)); if (msg == null) { throw new Exception("错误信息捕捉失败"); } if (!msg.success) { throw new Exception(msg.msg); } mq = (Model.MQuantityListByTray)JsonConvert.DeserializeObject(x, typeof(Model.MQuantityListByTray)); if (mq == null || mq.data == null) { throw new Exception("MQuantityListByTray数据信息捕捉失败"); } Cursor.Current = Cursors.Default; } catch (Exception ex) { Cursor.Current = Cursors.Default; MessageBox.Show(ex.Message); 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.QuantityListByTrays v in mq.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; 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.txtname = "复核列表"; frm.ShowDialog(); foreach (Control v in this.Controls) { if (v is TextBox) { if (v.Enabled) { v.Focus(); } } } }