public ActionResult pullone(string productno) { dynamic data = new System.Dynamic.ExpandoObject(); var no = WebRequest.GetString("no", true); var type = WebRequest.GetString("type", true); var model = new V_ProductPullModel(); var product = new V_ProductionModel(); var message = ""; var order = ""; if (type == "" || no == "") { #region 创建申请单 type = "add"; no = bomService.GetProductPullNo(); product = ServiceDB.Instance.QueryOneModel<V_ProductionModel>("select top 1 * from V_ProductionModel where produceNo='" + productno + "'"); #endregion } else if (type == "edit") { model = ServiceDB.Instance.QueryOneModel<V_ProductPullModel>("select * from V_ProductPullModel where pullNo='" + no + "'"); product = ServiceDB.Instance.QueryOneModel<V_ProductionModel>("select top 1 * from V_ProductionModel where produceNo='" + model.produceNo + "'"); } data.no = no; data.one = model; data.order = order; data.product = product; data.message = message; data.type = type; return View(data); }
public ActionResult produceone() { dynamic data = new System.Dynamic.ExpandoObject(); var no = WebRequest.GetString("no", true); var type = WebRequest.GetString("type", true); var model = new V_ProductionModel(); List<ReturnValue> ddl = new List<ReturnValue>(); var message = ""; if (type == "" || no == "") { #region 创建申请单 type = "add"; no = bomService.GetProductNo(); #endregion } else if (type == "edit") { model = ServiceDB.Instance.QueryOneModel<V_ProductionModel>("select * from V_ProductionModel where produceNo='" + no + "'"); var orderdetal = ServiceDB.Instance.QueryOneModel<BomOrderDetail>("select * from BomOrderDetail where detailSn=" + model.orderDetailSn); ddl = ServiceDB.Instance.QueryModelList<ReturnValue>("select m.materialNo as value,m.materialName as value2,m.materialModel as value3,m.unit as message,convert(bit,1) as status from bommain as bm inner join Material as m on bm.materialNo=m.materialNo where bm.parent_Id=" + orderdetal.bomId).ToList(); } data.no = no; data.one = model; data.message = message; data.ddl = ddl; data.type = type; return View(data); }