Beispiel #1
0
        public ActionResult UpdatePlan()
        {
            string          JHID     = Request["JHID"].ToString();
            tk_Product_Plan Material = ProducePlanMan.IndexAllupdatePlan(JHID);

            ViewData["JHID"]          = Request["JHID"].ToString();
            ViewData["Specifieddate"] = Material.Specifieddate.ToString("yyyy-MM-dd");
            return(View(Material));
        }
Beispiel #2
0
        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 }));
            }
        }