예제 #1
0
        public ActionResult GetProductPlanGrid()
        {
            string strCurPage;
            string strRowNum;

            if (Request["curpage1"] != null)
            {
                strCurPage = Request["curpage1"].ToString();
            }
            if (Request["rownum"] != null)
            {
                strRowNum = Request["rownum"].ToString();
            }
            else
            {
                strRowNum = "10";
            }

            string JHID = Request["JHID"].ToString();


            UIDataTable udtTask = ProducePlanMan.GetProductPlan(GFun.SafeToInt32(strRowNum), GFun.SafeToInt32(Request["curpage1"]) - 1, JHID);
            string      strjson = GFun.Dt2Json("", udtTask.DtData);

            strjson = strjson.Substring(1);
            strjson = strjson.Substring(0, strjson.Length - 1);
            string jsonData = "{ \"page\":" + GFun.SafeToInt32(Request["curpage1"]) + ", \"total\": " + udtTask.IntTotalPages + ", \"records\": " + udtTask.IntRecords + ", \"rows\": ";

            jsonData += strjson + "}";
            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
예제 #2
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));
        }
예제 #3
0
        public ActionResult GetZD()
        {
            DataTable dt = ProducePlanMan.GetZD();

            if (dt == null)
            {
                return(Json(new { success = false }));
            }
            else
            {
                return(Json(new { success = true, datas = GFun.Dt2Json("", dt) }));
            }
        }
예제 #4
0
        public ActionResult LoadPlanDatail()
        {
            string    JHID = Request["JHID"].ToString();
            DataTable dt   = ProducePlanMan.LoadPlanDatail(JHID);

            if (dt == null)
            {
                return(Json(new { success = false }));
            }
            else
            {
                return(Json(new { success = true, datas = GFun.Dt2Json("", dt) }));
            }
        }
예제 #5
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 }));
            }
        }
예제 #6
0
        public ActionResult GetProductPlan(ProduceList JH)
        {
            if (ModelState.IsValid)
            {
                string where = " ";
                string strCurPage;
                string strRowNum;

                if (Request["curpage"] != null)
                {
                    strCurPage = Request["curpage"].ToString();
                }
                if (Request["rownum"] != null)
                {
                    strRowNum = Request["rownum"].ToString();
                }
                else
                {
                    strRowNum = "10";
                }

                string Name           = JH.Name;
                string Specifications = Request["Specifications"].ToString();

                string Starts = Request["Starts"].ToString();
                if (Starts != "")
                {
                    Starts += " 00:00:00";
                }

                string Starte = Request["Starte"].ToString();
                if (Starte != "")
                {
                    Starte += " 23:59:59";
                }

                string Type  = Request["Type"].ToString();
                string Type1 = Request["Type1"].ToString();
                string Type2 = Request["Type2"].ToString();
                string Type3 = Request["Type3"].ToString();
                string State = Request["State"].ToString();

                if (Request["Name"] != "")
                {
                    where += " and b.Name like '%" + Request["Name"] + "%'";
                }
                if (Specifications != "")
                {
                    where += " and b.Specifications = '" + Specifications + "'";
                }
                if (Starts != "" && Starte != "")
                {
                    where += " and a.Specifieddate between '" + Starts + "' and '" + Starte + "'";
                }
                if (Type != "" && Type2 != "")
                {
                    where += " and a.Plannedyear between '" + Type + "' and '" + Type2 + "'";
                }
                if (Type1 != "" && Type3 != "")
                {
                    where += " and a.Plannedmonth between '" + Type1 + "' and '" + Type3 + "'";
                }
                if (State != "")
                {
                    where += " and a.State = '" + State + "'";
                }


                //where = where.Substring(0, where.Length - 3);

                UIDataTable udtTask = ProducePlanMan.getPlanList(GFun.SafeToInt32(strRowNum), GFun.SafeToInt32(Request["curpage"]) - 1, where);
                string      strjson = GFun.Dt2Json("", udtTask.DtData);
                strjson = strjson.Substring(1);
                strjson = strjson.Substring(0, strjson.Length - 1);
                string jsonData = "{ \"page\":" + GFun.SafeToInt32(Request["curpage"]) + ", \"total\": " + udtTask.IntTotalPages + ", \"records\": " + udtTask.IntRecords + ", \"rows\": ";
                jsonData += strjson + "}";
                return(Json(jsonData, JsonRequestBehavior.AllowGet));
                //return Json(jsonData, JsonRequestBehavior.AllowGet);
            }
            else
            {
                return(Json(new { success = "false", Msg = "操作失败!" }));
            }
        }