public AjaxResult GetOldOrderAdd([FromBody] dynamic Json) { #region //参数 string ConNo = Json.ConNo; //合同号 JArray OrderList = (JArray)Json.OrderList; //.OrderNo #endregion #region 数据操作 AjaxResult result = new AjaxResult(); result.Code = DoResult.Success; List <Mod_TMO_ORDER> ListOrder = new List <Mod_TMO_ORDER>(); Mod_TMO_CON modCon = tmo_con.GetModel(ConNo); for (int i = 0; i < OrderList.Count; i++) { #region //添加订单 Mod_TMO_ORDER modOrder = tmo_order.GetOrderModel(OrderList[i]["OrderNo"].ToString()); string order_no = randomnumber.CreateOrderNo(ConNo); //订单号 modOrder.C_ORDER_NO = order_no; modOrder.C_CON_NO = ConNo; //合同号 modOrder.C_CON_NAME = modCon.C_CON_NAME; //合同名称 modOrder.C_AREA = modCon.C_AREA; //区域 //modOrder.D_NEED_DT = modCon.D_CONINVALID_DT;//需求日期 modOrder.D_DELIVERY_DT = modCon.D_CONINVALID_DT; //计划收货日期 modOrder.D_DT = DateTime.Now; //订单日期 modOrder.C_RECEIPTAREAID = modCon.C_CRECEIPTAREAID; //收货地区 modOrder.C_RECEIVEADDRESS = modCon.C_ADDRESS; //收货地址 modOrder.C_RECEIPTCORPID = modCon.C_CRECEIPTCUSTOMERID; //收货单位 modOrder.C_CURRENCYTYPEID = modCon.C_CURRENCYTYPEID; //货币 modOrder.N_USER_LEV = modCon.N_CUST_LEV; //客户等级 modOrder.C_REMARK = modCon.C_REAMRK; ListOrder.Add(modOrder); #endregion } result.Result = tmo_con.InsertConOrder(modCon, ListOrder) == true ? "提交成功" : "提交失败"; #endregion return(result); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["ID"])) { string id = Request.QueryString["ID"]; Mod_TMO_ORDER mod = tmo_order.GetOrderModel(id); string order = id.StartsWith("YC") == true ? "'" + id + "'" : "'" + mod?.C_ORDER_NO + "'"; if (!string.IsNullOrEmpty(mod?.C_ORDER_NO_OLD)) { order += ",'" + mod?.C_ORDER_NO_OLD + "'"; } DataTable dt = plan_xqcx.ListPlanData(order).Tables[0]; if (dt.Rows.Count > 0) { ltlNEEDWGT.Text = dt.Compute("sum(计划需求量)", "true").ToString(); ltlWGWGT.Text = dt.Compute("sum(完工数量)", "true").ToString(); ltlHGWGT.Text = dt.Compute("sum(分配量)", "true").ToString(); rptList.DataSource = dt; rptList.DataBind(); } else { ltlNEEDWGT.Text = ""; ltlWGWGT.Text = ""; ltlHGWGT.Text = ""; rptList.DataSource = null; rptList.DataBind(); } } } }