Esempio n. 1
0
        public ActionResult EditCureTask(string taskNumber)
        {
            if (Session["CheckFeed"] == null || !(bool)Session["EditCure"] || !(bool)Session["CheckCure"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            object cureTask = new CureTask().GetCureTask(taskNumber);
            if (cureTask == null)
            {
                return View("Error");
            }

            var listService = new ListService();

            ViewData["Pigsty"] = listService.GetFirstPigstyList();
            ViewData["Employee"] = listService.GetEmployeeList();
            ViewData["PigHouse"] = listService.GetPigHouseList();
            ViewData["Medicine"] = listService.GetMedicineList();
            ViewData["CureType"] = listService.GetCureTypeList();
            ViewData["Unit"] = listService.GetUnitList();
            ViewData["Status"] = listService.GetTaskStatusList();
            ViewBag.Title = "修改治疗信息";
            return View("NewCureTask", cureTask);
        }
        public ActionResult NewTransferPigstyTask()
        {
            if (Session["CheckFeed"] == null || !(bool) Session["AddTransferPigsty"] ||
                !(bool) Session["CheckTransferPigsty"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            var listService = new ListService();

            ViewData["pighouse"] = listService.GetPigHouseList();
            ViewData["pigsty"] = listService.GetFirstPigstyList();
            ViewBag.Title = "新建转栏任务";
            return View(new TransferTask());
        }
        public ActionResult EditTransferPigstyTask(string taskNumber)
        {
            if (Session["CheckFeed"] == null || !(bool) Session["EditTransferPigsty"] ||
                !(bool) Session["CheckTransferPigsty"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            var listService = new ListService();

            ViewData["pighouse"] = listService.GetPigHouseList();
            ViewData["pigsty"] = listService.GetFirstPigstyList();
            ViewData["taskStatus"] = listService.GetTaskStatusList();
            ViewBag.Title = "修改转栏任务";
            TransferTask checkTransfertask = new TransferTask().GetTransferTask(taskNumber);
            return checkTransfertask != null ? View("NewTransferPigstyTask", checkTransfertask) : View("Error");
        }
Esempio n. 4
0
        public ActionResult NewCureTask()
        {
            if (Session["CheckFeed"] == null || !(bool)Session["AddCure"] || !(bool)Session["CheckCure"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            var listService = new ListService();

            ViewData["Pigsty"] = listService.GetFirstPigstyList();
            ViewData["Employee"] = listService.GetEmployeeList();
            ViewData["PigHouse"] = listService.GetPigHouseList();
            ViewData["Medicine"] = listService.GetMedicineList();
            ViewData["CureType"] = listService.GetCureTypeList();
            ViewData["Unit"] = listService.GetUnitList();
            ViewBag.Title = "新建治疗任务";

            return View(new CureTask());
        }
        public ActionResult EditDeadTask(string taskNumber)
        {
            if (Session["CheckDeadTask"] == null || !(bool)Session["EditDeadTask"] || !(bool)Session["CheckDeadTask"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            deadTask updateTask = new deadTask().GetdeadTask(taskNumber);

            if (updateTask == null)
            {
                return View("Error");
            }

            var listService = new ListService();

            ViewData["Status"] = listService.GetTaskStatusList();
            ViewData["PigHouse"] = listService.GetPigHouseList();
            ViewData["Pigsty"] = listService.GetFirstPigstyList();
            ViewBag.Title = "修改死亡任务";
            return View("NewDeadTask", updateTask);
        }
        public ActionResult NewDeadTask()
        {
            if (Session["CheckDeadTask"] == null || !(bool)Session["AddDeadTask"] || !(bool)Session["CheckDeadTask"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            var listService = new ListService();
            //将猪的类型存入下拉列表
            ViewData["PigHouse"] = listService.GetPigHouseList();
            ViewData["Pigsty"] = listService.GetFirstPigstyList();
            ViewBag.Title = "新建死亡任务";

            return View(new deadTask());
        }
        public ActionResult NewCureInfo()
        {
            if (Session["CheckFeed"] == null || !(bool) Session["AddCureInfo"] || !(bool) Session["CheckCureInfo"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            var newInfo = new CureInfo();
            IEnumerable<SelectListItem> taskNumberList = newInfo.GetTaskNumberSelect(TaskTypeId);
            if (!taskNumberList.Any())
            {
                const string returnstring = "任务为空,请先添加任务";
                Response.Write("<script language='JavaScript'>alert('" + returnstring + ".');history.go(-1);</script>");
                return Content("");
            }
            SelectListItem firstOrDefault = newInfo.GetTaskNumberSelect(TaskTypeId).FirstOrDefault();
            long taskId = 0;
            if (firstOrDefault != null)
                taskId = long.Parse(firstOrDefault.Value);

            var listService = new ListService();

            ViewData["TaskNumber"] = newInfo.GetTaskNumberSelect(TaskTypeId);
            ViewData["pigsty"] = listService.GetFirstPigstyList();
            ViewData["Employee"] = listService.GetEmployeeList();
            ViewData["pighouse"] = listService.GetPigHouseList();
            ViewData["Medicine"] = listService.GetMedicineList();
            ViewData["CureType"] = listService.GetCureTypeList();
            ViewData["unit"] = listService.GetUnitList();
            ViewData["pig"] = listService.GetFirstPigList();
            ViewData["Order"] = listService.GetCureTaskOrder(taskId);
            ViewBag.Title = "新建治疗信息";
            return View(newInfo);
        }
        public ActionResult EditCureInfo(string employeename, string taskNumber, int order)
        {
            if (Session["CheckFeed"] == null || !(bool) Session["EditCureInfo"] || !(bool) Session["CheckCureInfo"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            CureInfo checkCureInfo = new CureInfo().CheckCureInfo(employeename, taskNumber, order);
            if (checkCureInfo == null)
            {
                ViewBag.Title = "查看修改失败,请重新操作";
                return View("Message");
            }
            long taskId = 0;
            SelectListItem firstOrDefault = checkCureInfo.GetTaskNumberSelect(TaskTypeId).FirstOrDefault();
            if (firstOrDefault != null)
                taskId = long.Parse(firstOrDefault.Value);
            ViewData["Name"] = employeename;

            var listService = new ListService();

            ViewData["TaskNumber"] = checkCureInfo.GetTaskNumberSelect(TaskTypeId);
            ViewData["pigsty"] = listService.GetFirstPigstyList();
            ViewData["Employee"] = listService.GetEmployeeList();
            ViewData["pighouse"] = listService.GetPigHouseList();
            ViewData["Medicine"] = listService.GetMedicineList();
            ViewData["CureType"] = listService.GetCureTypeList();
            ViewData["unit"] = listService.GetUnitList();
            ViewData["pig"] = listService.GetFirstPigList();
            ViewData["Order"] = listService.GetCureTaskOrder(taskId);
            ViewBag.Title = "修改治疗信息";
            return View("NewCureInfo", checkCureInfo);
        }