public OrderLine(body.wm_order_item line, int index) { InitializeComponent(); this.line = line; // this.lblindex.Text = index.ToString(); this.lblgoodsname.Text = line.goods_name; this.lblremark.Text = (line.color + " " + line.size).Trim(); if (this.lblremark.Text == "") { this.panel2.Visible = false; } this.lblqty.Text = line.qty; this.lblamount.Text = "¥" + line.amount; if (line.enable == "0") { this.panel1.BackgroundImage = pictureBox1.Image; this.panel1.Enabled = false; this.panel2.BackgroundImage = pictureBox2.Image; this.lblindex.ForeColor = Color.Gray; this.lblgoodsname.ForeColor = Color.Gray; this.lblremark.ForeColor = Color.Gray; this.lblqty.ForeColor = Color.Gray; this.lblamount.ForeColor = Color.Gray; } // control.ClickActive.addActive(this.panel1); }
void IOrder.GetOrder(string ord_id, out body.wm_order ord, out List <body.wm_order_item> lines, out int un_read_num) { var req = new Request(); var json = req.request("/order?t=get_order", "{\"ord_id\":\"" + ord_id + "\"}"); ReadWriteContext.IReadContext read = new ReadWriteContext.ReadContextByJson(json); if (read.Read("errId") != "0") { throw new Exception(read.Read("errMsg")); } // ord = new body.wm_order(); un_read_num = Conv.ToInt(read.Read("un_read_num")); ord.ord_id = read.Read("ord_id"); ord.create_time = read.Read("create_time"); ord.mobile = read.Read("mobile"); ord.mobile_is_new = read.Read("mobile_is_new"); ord.sname = read.Read("sname"); ord.sex = read.Read("sex"); ord.address = read.Read("address"); ord.qty = read.Read("qty"); ord.amount = read.Read("amount"); ord.enable_qty = read.Read("enable_qty"); ord.enable_amount = read.Read("enable_amount"); ord.status = read.Read("status"); ord.build_status = read.Read("build_status"); ord.send_status = read.Read("send_status"); ord.pay_type = read.Read("pay_type"); ord.reach_time = read.Read("reach_time"); ord.cus_remark = read.Read("cus_remark"); ord.cus_no = read.Read("cus_no"); ord.salesman_id = read.Read("salesman_id"); ord.is_pay = read.Read("is_pay"); ord.take_fee = Conv.ToDecimal(read.Read("take_fee")); ord.discount_amt = Conv.ToDecimal(read.Read("discount_amt")); // lines = new List <body.wm_order_item>(); if (read.Read("lines") != "") { foreach (ReadWriteContext.IReadContext r in read.ReadList("lines")) { var line = new body.wm_order_item(); lines.Add(line); line.ord_id = r.Read("ord_id"); line.row_index = r.Read("row_index"); line.goods_id = r.Read("goods_id"); line.goods_no = r.Read("goods_no"); line.goods_name = r.Read("goods_name"); line.price = r.Read("price"); line.qty = r.Read("qty"); line.amount = r.Read("amount"); line.color = r.Read("color"); line.size = r.Read("size"); line.enable = r.Read("enable"); } } }