Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }