//public ActionResult SaveUpdatePlan() //{ // tk_Product_Plan task = new tk_Product_Plan(); // task.JHID = Request["JHID"].ToString(); // task.Specifieddate = Convert.ToDateTime(Request["Specifieddate"]); // task.Plannedmonth = Request["Plannedmonth"].ToString(); // task.Remarks = Request["Remarks"].ToString(); // task.Formulation = Request["Formulation"].ToString(); // string[] arrMain = Request["MainContent"].Split(','); // string[] arrDID = Request["DID"].Split(','); // string[] arrName = Request["Name"].Split(','); // string[] arrSpecifications = Request["Specifications"].Split(','); // string[] arrFinishedproduct = Request["Finishedproduct"].Split(','); // string[] arrfinishingproduct = Request["finishingproduct"].Split(','); // string[] arrfinishingproducts = Request["finishingproducts"].Split(','); // string[] arrnotavailable = Request["notavailable"].Split(','); // string[] arrTotal = Request["Total"].Split(','); // string[] arrplannumber = Request["plannumber"].Split(','); // string[] arrdemandnumber = Request["demandnumber"].Split(','); // string[] arrRemark = Request["Remark"].Split(','); // string strErr = ""; // tk_Product_PlanDetail deInfo = new tk_Product_PlanDetail(); // List<tk_Product_PlanDetail> detailList = new List<tk_Product_PlanDetail>(); // for (int i = 0; i < arrMain.Length; i++) // { // deInfo = new tk_Product_PlanDetail(); // deInfo.JHID = Request["JHID"].ToString(); // deInfo.DID = arrDID[i].ToString(); // deInfo.Name = arrName[i].ToString(); // deInfo.Specifications = arrSpecifications[i].ToString(); // deInfo.Finishedproduct = Convert.ToInt32(arrFinishedproduct[i]); // deInfo.finishingproduct = Convert.ToInt32(arrfinishingproduct[i]); // deInfo.Spareparts = Convert.ToInt32(arrfinishingproducts[i]); // deInfo.notavailable = Convert.ToInt32(arrnotavailable[i]); // deInfo.Total = Convert.ToInt32(arrTotal[i]); // deInfo.plannumber = Convert.ToInt32(arrplannumber[i]); // deInfo.demandnumber = Convert.ToInt32(arrdemandnumber[i]); // deInfo.Remarks = arrRemark[i].ToString(); // detailList.Add(deInfo); // } // var JHID = Request["JHID"].ToString(); // bool b = ProduceMan.SaveUpdatePlan(task, detailList, ref strErr, JHID); // if (b) // { // #region [添加日志] // tk_ProLog log = new tk_ProLog(); // log.LogTime = DateTime.Now; // log.YYCode = Request["JHID"].ToString(); // log.YYType = "修改成功 "; // log.Content = "修改计划单"; // log.Actor = GAccount.GetAccountInfo().UserName; // log.Unit = GAccount.GetAccountInfo().UnitName; // ProduceMan.AddProduceLog(log); // #endregion // return Json(new { success = true }); // } // else // { // #region [添加日志] // tk_ProLog log = new tk_ProLog(); // log.LogTime = DateTime.Now; // log.YYCode = Request["JHID"].ToString(); // log.YYType = "修改失败 "; // log.Content = "修改计划单"; // log.Actor = GAccount.GetAccountInfo().UserName; // log.Unit = GAccount.GetAccountInfo().UnitName; // ProduceMan.AddProduceLog(log); // #endregion // return Json(new { success = false, Msg = strErr }); // } //} #endregion #endregion #region 撤销计划单 #region 撤销 public ActionResult CXJH() { string strErr = ""; string JHID = Request["JHID"].ToString(); if (ProduceMan.CXJH(JHID, ref strErr)) { #region [添加日志] tk_ProLog log = new tk_ProLog(); log.LogTime = DateTime.Now; log.YYCode = JHID; log.YYType = "撤销成功 "; log.Content = "撤销计划"; log.Actor = GAccount.GetAccountInfo().UserName; log.Unit = GAccount.GetAccountInfo().UnitName; ProduceMan.AddProduceLog(log); #endregion return(Json(new { success = "true", Msg = "撤销成功" })); } else { #region [添加日志] tk_ProLog log = new tk_ProLog(); log.LogTime = DateTime.Now; log.YYCode = JHID; log.YYType = "撤销失败 "; log.Content = "撤销计划"; log.Actor = GAccount.GetAccountInfo().UserName; log.Unit = GAccount.GetAccountInfo().UnitName; ProduceMan.AddProduceLog(log); #endregion return(Json(new { success = "false", Msg = strErr })); } }
public ActionResult SaveUpdatePlan(tk_Product_Plan plan) { int count = Convert.ToInt32(Request["tbadyrows"]); tk_Product_PlanDetail deInfo = null; List <tk_Product_PlanDetail> detailList = new List <tk_Product_PlanDetail>(); for (int i = 0; i < count; i++) { string did = ""; if (i > 8) { did = plan.JHID + "-" + (i + 1); } else { did = plan.JHID + "-0" + (i + 1); } deInfo = new tk_Product_PlanDetail() { PID = Request["PID" + i].ToString(), Name = Request["Name" + i].ToString(), Specifications = Request["Specifications" + i].ToString(), Finishedproduct = Request["Finishedproduct" + i].ToString() == "" ? 0 : Convert.ToInt32(Request["Finishedproduct" + i]), finishingproduct = Request["finishingproduct" + i].ToString() == "" ? 0 : Convert.ToInt32(Request["finishingproduct" + i]), OnlineCount = Request["OnlineCount" + i].ToString() == "" ? 0 : Convert.ToInt32(Request["OnlineCount" + i]), Spareparts = Request["Spareparts" + i].ToString() == "" ? 0 : Convert.ToInt32(Request["Spareparts" + i]), notavailable = Request["notavailable" + i].ToString() == "" ? 0 : Convert.ToInt32(Request["notavailable" + i]), Total = Request["Total" + i].ToString() == "" ? 0 : Convert.ToInt32(Request["Total" + i]), plannumber = Request["plannumber" + i].ToString() == "" ? 0 : Convert.ToInt32(Request["plannumber" + i]), demandnumber = Request["demandnumber" + i].ToString() == "" ? 0 : Convert.ToInt32(Request["demandnumber" + i]), Remarks = Request["Remarks" + i].ToString(), JHID = plan.JHID, DID = did, CreateTime = Convert.ToDateTime(Request["CreateTime" + i]), CreateUser = Request["CreateUser" + i], Validate = "v" }; detailList.Add(deInfo); } string strErr = ""; bool b = ProducePlanMan.SaveUpdatePlan(plan, detailList, ref strErr); if (b) { #region [添加日志] tk_ProLog log = new tk_ProLog(); log.LogTime = DateTime.Now; log.YYCode = Request["JHID"].ToString(); log.YYType = "修改成功 "; log.Content = "修改计划单"; log.Actor = GAccount.GetAccountInfo().UserName; log.Unit = GAccount.GetAccountInfo().UnitName; ProduceMan.AddProduceLog(log); #endregion return(Json(new { success = true })); } else { #region [添加日志] tk_ProLog log = new tk_ProLog(); log.LogTime = DateTime.Now; log.YYCode = Request["JHID"].ToString(); log.YYType = "修改失败 "; log.Content = "修改计划单"; log.Actor = GAccount.GetAccountInfo().UserName; log.Unit = GAccount.GetAccountInfo().UnitName; ProduceMan.AddProduceLog(log); #endregion return(Json(new { success = false, Msg = strErr })); } }