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);
        }
예제 #2
0
        public ActionResult EditFeedInfo(string employeename, string taskNumber, DateTime time)
        {
            if (Session["CheckFeed"] == null || !(bool) Session["EditFeedInfo"] || !(bool) Session["CheckFeedInfo"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            FeedInfo checkFeedInfo = new FeedInfo().CheckFeedInfo(employeename, taskNumber, time);
            if (checkFeedInfo == null)
            {
                ViewBag.Title = "查看修改失败,请重新进入";
                return View("Message");
            }
            var listService = new ListService();

            ViewData["pigsty"] = new ListService().GetFirstPigstyList();
            ViewData["Employee"] = new ListService().GetEmployeeList();
            ViewData["pighouse"] = listService.GetPigHouseList();
            ViewData["FodderType"] = new ListService().GetFodderTypeList();
            ViewData["unit"] = listService.GetUnitList();
            ViewData["SourceTime"] = time;
            ViewData["Name"] = checkFeedInfo.EmployeeName;
            ViewBag.Title = "修改喂食信息";
            return View("NewFeedInfo", checkFeedInfo);
        }
 public ActionResult FodderTake(FodderTakeModel model)
 {
     model = new FodderDetail().GetFodderDetail(model);
     var listService = new ListService();
     ViewData["FeedTaskEmployee"] = listService.GetFeedTaskEmployee();
     ViewData["FodderType"] = listService.GetFodderTypeList();
     ViewData["Unit"] = listService.GetUnitList();
     return View(model);
 }
 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 BasicTypeInfo(string type)
        {
            if (Session["CheckFeed"] == null || !(bool) Session["CheckSystemManage"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            //根据不同的类型返回对应类型的NameModel

            var listService = new ListService();
            ViewData["Medicine"] = listService.GetMedicineList();
            ViewData["Unit"] = listService.GetUnitList();
            BasicInfoModel basicInfoModel = new BasicInfoModel().ReadBasicInfo(type);
            return View(basicInfoModel);
        }
        public ActionResult BasicTypeInfo(BasicInfoModel model)
        {
            //保存对应类型的信息
            try
            {
                new NameModel().SaveAll(model, model.Type);
                Response.Write("<script language='JavaScript'>alert('保存成功.');</script>");
            }
            catch (Exception)
            {
                Response.Write("<script language='JavaScript'>alert('保存失败.');history.go(0);</script>");
            }

            var listService = new ListService();
            ViewData["Medicine"] = listService.GetMedicineList();
            ViewData["Unit"] = listService.GetUnitList();
            if (Request.IsAjaxRequest())
            {
                BasicInfoModel basicInfoModel = new BasicInfoModel().ReadBasicInfo(model.Type);
                return PartialView("UCJqBasicTypeInfo", basicInfoModel);
            }
            return View(model);
        }
        public ActionResult FodderTake()
        {
            if (Session["CheckFeed"] == null || !(bool) Session["CheckFodderTake"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            var listService = new ListService();
            ViewData["FeedTaskEmployee"] = listService.GetFeedTaskEmployee();
            ViewData["FodderType"] = listService.GetFodderTypeList();
            ViewData["Unit"] = listService.GetUnitList();
            //初始化
            var fodderTakeModel = new FodderTakeModel();
            var taskDetail = new List<FodderDetail>();
            var actualDetail = new List<FodderDetail>();
            var fodderDetail = new FodderDetail();
            taskDetail.Add(fodderDetail);
            actualDetail.Add(fodderDetail);
            fodderTakeModel.ActualDetail = actualDetail;
            fodderTakeModel.TaskDetail = taskDetail;
            return View(fodderTakeModel);
        }
예제 #8
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);
        }
예제 #9
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());
        }
예제 #10
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);
        }
예제 #11
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);
        }