public JsonResult GetInBoundData(FormCollection collection) { string tempID = collection[0].ToString(); var OrderList = this.StoreService.GetOrderList(new OrderRequest()); IboundProperty ibp = new IboundProperty(); ibp.dpid = new List <string>(); ibp.clmc = new List <string>(); ibp.pm = new List <string>(); ibp.mf = new List <string>(); ibp.js = new List <string>(); ibp.numbers = new List <int>(); ibp.number = 0; foreach (DictionaryTree dt in OrderList) { if (dt.dt_id.ToString() == tempID) { ibp.khmc = this.StoreService.GetTreeName(dt.parent_id); ibp.number = 0; //int flag = 0; foreach (DictionaryProperty dp in dt.DictionaryProperty) { ibp.dpid.Add(dp.dpid.ToString()); ibp.clmc.Add(dp.clmc); ibp.pm.Add(dp.pm); ibp.mf.Add(dp.mf); ibp.js.Add(dp.js.Value.ToString()); //if(dp.leaf_id.Value.ToString() == tempID)//获取订单最大出库数量 //{ // int tempNumber = (this.StoreService.GetPropertyNumber(dp.dpid) / dp.js.Value).ToInt(); // if (flag == 0) // { // ibp.number = tempNumber; // flag = 1; // } // if (tempNumber<=0||tempNumber < ibp.number) // { // ibp.number = tempNumber; // ibp.minclmc = dp.clmc + "、" + ibp.minclmc; // } //} } } } TempData["dpids"] = ibp.dpid; string jsonItem = JsonHelper.JsonSerializer(ibp); return(Json(jsonItem)); }
public JsonResult GetMaxData(FormCollection collection) { string tempID = collection[0].ToString(); int outnumber = int.Parse(collection["outnumber"]); var OrderList = this.StoreService.GetOrderList(new OrderRequest()); IboundProperty ibp = new IboundProperty(); ibp.dpid = new List <string>(); ibp.clmc = new List <string>(); ibp.pm = new List <string>(); ibp.mf = new List <string>(); ibp.js = new List <string>(); ibp.numbers = new List <int>(); ibp.number = 0; foreach (DictionaryTree dt in OrderList) { if (dt.dt_id.ToString() == tempID) { ibp.khmc = this.StoreService.GetTreeName(dt.parent_id); ibp.number = 0; foreach (DictionaryProperty dp in dt.DictionaryProperty) { var kcsl = this.StoreService.GetPropertyNumber(dp.dpid);//库存数量 ibp.dpid.Add(dp.dpid.ToString()); ibp.clmc.Add(dp.clmc); ibp.pm.Add(dp.pm); ibp.mf.Add(dp.mf); ibp.js.Add(dp.js.Value.ToString()); if (dp.leaf_id.Value.ToString() == tempID)//获取订单最大出库数量 { decimal tempNumber = outnumber * dp.js.Value; if (tempNumber > kcsl) { ibp.minclmc = dp.clmc + "、" + ibp.minclmc; } } } } } string jsonItem = JsonHelper.JsonSerializer(ibp); return(Json(jsonItem)); }