コード例 #1
0
        private void frmBalTranMove_Load(object sender, EventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                string x = HttpHelper.HttpPost("getZcqSlList", "&lcCode=" + Comm.lcCode + "&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);
                }
                mz = (Model.MZcqSlList)JsonConvert.DeserializeObject(x, typeof(Model.MZcqSlList));
                //var v = from q in mz.data where q.status == "EFFECTIVE" select q;
                List <Model.zcq> zcql = new List <Rf_Wms.Model.zcq>();
                foreach (Model.zcq v in mz.data)
                {
                    if (v.status == "EFFECTIVE")
                    {
                        zcql.Add(v);
                    }
                }
                if (zcql.Count == 0)
                {
                    throw new Exception("没有可用的转储区信息");
                }
                this.cmbtoslname.DataSource    = zcql;
                this.cmbtoslname.ValueMember   = "slId";
                this.cmbtoslname.DisplayMember = "slName";

                x   = HttpHelper.HttpPost("getBalanceTransferOrderNumber", "&lcCode=" + Comm.lcCode + "&whId=" + Comm.warehousecode + "&updater=" + Comm.usercode);
                msg = (Model.Mmsg)JsonConvert.DeserializeObject(x, typeof(Model.Mmsg));
                if (msg == null)
                {
                    throw new Exception("错误信息捕捉失败");
                }
                if (!msg.success)
                {
                    throw new Exception(msg.msg);
                }
                Model.Mccode mc = (Model.Mccode)JsonConvert.DeserializeObject(x, typeof(Model.Mccode));
                this.labccode.Text = mc.data;
                Cursor.Current     = Cursors.Default;
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message);

                return;
            }
            init();
            this.txtbarcode.Text     = "";
            this.txttoslname.Enabled = true;
            this.cmbtoslname.Enabled = true;
            this.txttoslname.Focus();
        }
コード例 #2
0
        private void frmPackingUp_Load(object sender, EventArgs e)
        {
            //this.cmbtoslname.Items.Add("ceshi", 60);

            try
            {
                Cursor.Current = Cursors.WaitCursor;
                string x = HttpHelper.HttpPost("getZcqSlList", "&lcCode=" + Comm.lcCode + "&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);
                }
                mz = (Model.MZcqSlList)JsonConvert.DeserializeObject(x, typeof(Model.MZcqSlList));
                List <Model.zcq> zcql = new List <Rf_Wms.Model.zcq>();
                foreach (Model.zcq v in mz.data)
                {
                    if (v.status == "EFFECTIVE")
                    {
                        zcql.Add(v);
                    }
                }
                if (zcql.Count == 0)
                {
                    throw new Exception("没有可用的转储区信息");
                }
                this.cmbtoslname.DataSource = zcql;
                //this.cmbtoslname.DataSource = mz.data;
                this.cmbtoslname.ValueMember   = "slId";
                this.cmbtoslname.DisplayMember = "slName";
                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message);
                this.Close();
                return;
            }
            Clear();
            this.txtorderid.Enabled = true;
            this.txtorderid.Focus();
        }