public ActionResult MedicineTake() { if (Session["CheckFeed"] == null || !(bool) Session["CheckMedicineTake"]) { Response.Write("<script>history.go(0);</script>"); return View("Error"); } var listService = new ListService(); ViewData["CureTaskEmployee"] = listService.GetCureTaskEmployee(); ViewData["CureType"] = listService.GetCureTypeList(); ViewData["Medicine"] = listService.GetMedicineList(); ViewData["Unit"] = listService.GetUnitList(); //定义实际领取的药品 var medicineTakeModel = new MedicineTakeModel(); var cureTypeModels = new List<CureTypeModel>(); var medicineTakeDetails = new List<MedicineTakeDetail>(); var cureTypeModel = new CureTypeModel(); var medicineTakeDetail = new MedicineTakeDetail(); cureTypeModels.Add(cureTypeModel); medicineTakeDetails.Add(medicineTakeDetail); medicineTakeModel.CureType = cureTypeModels; cureTypeModel.MedicineTakeDetails = medicineTakeDetails; //定义任务的药品 var cureDetails = new List<CureDetail>(); var cureDetail = new CureDetail(); cureDetails.Add(cureDetail); var cureMedicineDetails = new List<CureMedicineDetail>(); var cureMedicineDetail = new CureMedicineDetail(); cureMedicineDetails.Add(cureMedicineDetail); cureDetail.CureMedicineDetail = cureMedicineDetails; medicineTakeModel.CureTaskType = cureDetails; return View(medicineTakeModel); }
public ActionResult MedicineTake(MedicineTakeModel model) { var listService = new ListService(); ViewData["CureTaskEmployee"] = listService.GetCureTaskEmployee(); ViewData["CureType"] = listService.GetCureTypeList(); ViewData["Medicine"] = listService.GetMedicineList(); ViewData["Unit"] = listService.GetUnitList(); var medicineTakeModel = new MedicineTakeModel(); medicineTakeModel = medicineTakeModel.GetCureTaskByEmployeeId(model.EmployeeId); model.TaskNumber = medicineTakeModel.TaskNumber; model.EmloyeeName = medicineTakeModel.EmloyeeName; model.TaskCourseId = medicineTakeModel.TaskCourseId; model.CureTaskType = medicineTakeModel.CureTaskType; return View(model); }
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 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 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); }