public ActionResult CureTask(int pageIndex = 1)
        {
            if (Session["CheckFeed"] == null || !(bool)Session["CheckCure"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            string check = Request.Form["Check"];
            if (check != null)
            {
                int searchItem = int.Parse(Request.Form["SearchItem"]);
                return RedirectToAction("SearchTask", new { check, searchItem, pageIndex });
            }
            var task = new Task();
            PagedList<Task> taskPagerList = task.GetTaskPagedList(TaskTypeId, pageIndex, PageSize);

            if (Request.IsAjaxRequest())
            {
                return PartialView("UCJqTaskList", taskPagerList);
            }

            ViewData["Search"] = new ListService().GetInfoSearchList();
            return View(taskPagerList);
        }
        public ActionResult CheckEmployeeManage(long id)
        {
            if (Session["CheckFeed"] == null || !(bool) Session["CheckSystemManage"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            var employeeService = new EmployeeService();
            var roleService = new RoleService();
            var listService = new ListService();
            List<role> roles = roleService.FindByEmployeeId(id);
            employee employee = employeeService.Find(id);
            var employeeModel = new EmployeeModel
                                    {
                                        EmployeeId = employee.Id,
                                        EmployeeNumber = employee.Number,
                                        EmployeeName = employee.Name,
                                        Rfid = employee.RFID,
                                        Sex = employee.Sex,
                                        ConfirmPassWd = employee.Password,
                                        PassWd = employee.Password,
                                        Logon = employee.LogOn,
                                        Birthday = Convert.ToDateTime(employee.Birthday),
                                        Memo = employee.Memo
                                    };
            List<long> roleType = roles.Select(role => role.role_type.Id).ToList();
            employeeModel.RoleTypeId = roleType;
            ViewData["Role"] = listService.GetRoleTypeList();
            ViewData["Sex"] = listService.GetSexTypeList();
            ViewBag.Title = "查看人员信息";
            return View("AddNewEmployeeManage", employeeModel);
        }
        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 EditPreventionDiseaseTask(string taskNumber)
        {
            if (Session["CheckFeed"] == null || !(bool)Session["EditPreventionDisease"] ||
                !(bool)Session["CheckPreventionDisease"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            PreventionDiseaseTask updateTask = new PreventionDiseaseTask().GetPreventionDiseaseTask(taskNumber);

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

            var listService = new ListService();

            ViewData["PreventionType"] = listService.GetPreventionTypeList();
            ViewData["pighouse"] = listService.GetPigHouseList();
            ViewData["taskStatus"] = listService.GetTaskStatusList();
            ViewData["PigStyPigType"] = listService.GetPigStyPigTypeList();
            ViewBag.Title = "修改防疫任务";
            return View("NewPreventionDiseaseTask", updateTask);
        }
        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 EditInspectInfo(string taskNumber, string employeeName, DateTime time)
        {
            if (Session["CheckFeed"] == null || !(bool) Session["EditInspectInfo"] ||
                !(bool) Session["CheckInspectInfo"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            InspectInfo checkInspectInfo = new InspectInfo().CheckInspectInfo(taskNumber, employeeName, time);
            if (checkInspectInfo == null)
            {
                ViewBag.Title = "查看修改失败,请重新操作";
                return View("Message");
            }

            ViewData["TaskNumber"] = checkInspectInfo.GetTaskNumberSelect(TaskTypeId);
            ViewData["pigsty"] = new ListService().GetFirstPigstyList();
            ViewData["Employee"] = new ListService().GetEmployeeList();
            ViewData["pighouse"] = new ListService().GetPigHouseList();
            ViewData["Exception"] = new ListService().GetExceptionTypeList();
            ViewData["SourceTime"] = time;
            ViewData["Name"] = checkInspectInfo.EmployeeName;
            ViewBag.Title = "修改巡查信息";
            return View("NewInspectInfo", checkInspectInfo);
        }
        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);
        }
 //
 // GET: /DataImport/BatchAddPigsties/
 public ActionResult BatchAddPigsties()
 {
     var listService = new ListService();
     ViewData["PigHouseId"] = listService.GetPigHouseList();
     ViewBag.Title = "批量添加猪栏";
     var batchAddPigstiesModel = new BatchAddPigstiesModel();
     return View(batchAddPigstiesModel.GetAllPigstiesRfid());
 }
 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 AddPigHouseEquipMentInfo()
        {
            if (Session["CheckFeed"] == null || !(bool) Session["AddSystemManage"] ||
                !(bool) Session["CheckSystemManage"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            var listService = new ListService();
            ViewData["PigHouseType"] = listService.GetPigHouseTypeList();
            ViewBag.Title = "添加猪舍";
            return View();
        }
 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 NewPreventionDiseaseTask()
        {
            if (Session["CheckFeed"] == null || !(bool)Session["AddPreventionDisease"] ||
                !(bool)Session["CheckPreventionDisease"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            var listService = new ListService();
            ViewData["PreventionType"] = listService.GetPreventionTypeList();
            ViewData["pighouse"] = listService.GetPigHouseList();
            ViewData["PigStyPigType"] = listService.GetPigStyPigTypeList();
            ViewBag.Title = "新建防疫任务";
            return View(new PreventionDiseaseTask());
        }
        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 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");
        }
 public ActionResult AddNewEmployeeManage(EmployeeModel model)
 {
     if (ModelState.IsValid)
     {
         if (EmployeeModel.SaveNewEmployee(model))
         {
             ViewBag.Title = "添加成功";
             return View("SuccessEmployee");
         }
         Response.Write("<script language='JavaScript'>alert('添加新人员失败.');history.go(-1);</script>");
     }
     var listService = new ListService();
     //性别
     ViewData["Sex"] = listService.GetSexTypeList();
     //角色类型
     ViewData["Role"] = listService.GetRoleTypeList();
     ViewBag.Title = "添加新人员的信息";
     return View(model);
 }
        public ActionResult CureInfo(int pageIndex = 1)
        {
            if (Session["CheckFeed"] == null || !(bool) Session["CheckCureInfo"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            const int pageSize = 25;

            var cureInfo = new CureInfo();
            PagedList<Info> infoPagerList;
            if (Request.Form["CheckEmployee"] != null)
            {
                Session["check"] = Request.Form["CheckEmployee"];
                Session["chooseid"] = Request.Form["SearchChose"];
                infoPagerList =
                    cureInfo.GetInfoPagedList(
                        cureInfo.GetCureInfo(cureInfo.GetCureInfo(), Request.Form["CheckEmployee"],
                                             Request.Form["SearchChose"]), pageIndex, pageSize);
                //Session["SearchCure"] = Request.Form["CheckEmployee"];
            }
            else if (Session["check"] != null && Session["chooseid"] != null && Request.HttpMethod == "POST")
            {
                infoPagerList =
                    cureInfo.GetInfoPagedList(cureInfo.GetCureInfo(cureInfo.GetCureInfo(), Session["check"] as string,
                                                                   Session["chooseid"] as string), pageIndex, pageSize);
            }
            else
            {
                Session["check"] = "";
                Session["chooseid"] = "";
                infoPagerList = cureInfo.GetInfoPagedList(cureInfo.GetCureInfo(), pageIndex, pageSize);
            }

            if (Request.IsAjaxRequest())
            {
                return PartialView("UCJqInfoList", infoPagerList);
            }
            ViewData["Search"] = new ListService().GetInfoSearchList();
            return View(infoPagerList);
        }
        public ActionResult EditTransferPigstyInfo(string taskNumber)
        {
            if (Session["CheckFeed"] == null || !(bool) Session["EditTransferPigstyInfo"] ||
                !(bool) Session["CheckTransferPigstyInfo"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            TransferPigstyInfo checkTransferPigstyInfo = new TransferPigstyInfo().CheckTransferPigstyInfo(taskNumber);
            if (checkTransferPigstyInfo == null)
            {
                ViewBag.Title = "查看修改失败,请重新进入";
                return View("Message");
            }
            ViewData["pigsty"] = new ListService().GetFirstPigstyList();
            ViewData["pighouse"] = new ListService().GetPigHouseList();
            ViewData["pig"] = new ListService().GetFirstPigList();
            ViewBag.Title = "修改转栏信息";
            return View("NewTransferPigstyInfo", checkTransferPigstyInfo);
        }
        public ActionResult EditSalesInfo(string taskNumber)
        {
            if (Session["CheckFeed"] == null || !(bool) Session["EditSalesInfo"] || !(bool) Session["CheckSalesInfo"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            SalesInfo newInfo = new SalesInfo().CheckSalesInfo(taskNumber);
            if (newInfo == null)
            {
                ViewBag.Title = "查看修改失败,请重新操作";
                return View("Message");
            }
            ViewData["pigsty"] = new ListService().GetFirstPigstyList();
            ViewData["Employee"] = new ListService().GetEmployeeList();
            ViewData["pighouse"] = new ListService().GetPigHouseList();
            ViewData["pig"] = new ListService().GetFirstPigList();
            ViewBag.Title = "修改销售信息";
            return View("NewSalesInfo", newInfo);
        }
        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 EditEliminateInfo(string taskNumber)
        {
            if (Session["CheckEliminateInfo"] == null || !(bool)Session["EditEliminateInfo"] || !(bool)Session["CheckEliminateInfo"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            EliminateInfo newInfo = new EliminateInfo().CheckEliminateInfo(taskNumber);
            if (newInfo == null)
            {
                ViewBag.Title = "查看修改失败,请重新操作";
                return View("Message");
            }
            var pighouse= new ListService().GetPigHouseList();
            var pigsty = new ListService().FindPigstyListByPigHouseId(pighouse.FirstOrDefault().Value);
            ViewData["pighouse"] = pighouse;
            ViewData["pigsty"] = pigsty;
            ViewData["Employee"] = new ListService().GetEmployeeList();
            ViewData["pig"] = new ListService().FindPigListByPigstyId(pigsty.FirstOrDefault().Value);
            ViewBag.Title = "修改淘汰信息";
            return View("NewEliminateInfo", newInfo);
        }
        public ActionResult EditPreventionDiseaseInfo(string taskNumber, string employeeName)
        {
            if (Session["CheckFeed"] == null || !(bool) Session["EditPreventionDiseaseInfo"] ||
                !(bool) Session["CheckPreventionDiseaseInfo"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            PreventionInfo preventionDiseaseInfo = new PreventionInfo().CheckPreventionInfo(taskNumber, employeeName);
            if (preventionDiseaseInfo == null)
            {
                ViewBag.Title = "查看失败,请重新操作";
                return View("Message");
            }
            ViewBag.Title = "修改防疫信息";
            ViewData["pigsty"] = new ListService().GetFirstPigstyList();
            ViewData["Employee"] = new ListService().GetEmployeeList();
            ViewData["pighouse"] = new ListService().GetPigHouseList();
            ViewData["Pigfodder"] = new ListService().GetFodderTypeList();
            ViewData["unit"] = new ListService().GetUnitList();
            return View("NewPreventionDiseaseInfo", preventionDiseaseInfo);
        }
        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 EditSaleTask(string taskNumber)
        {
            if (Session["CheckFeed"] == null || !(bool)Session["EditSale"] || !(bool)Session["CheckSale"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            SaleTask updateTask = new SaleTask().GetSaleTask(taskNumber);

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

            var listService = new ListService();

            ViewData["Status"] = listService.GetTaskStatusList();
            ViewData["PigType"] = listService.GetPigTypeList();
            ViewData["Customer"] = listService.GetCustomerList();
            ViewBag.Title = "修改销售任务";
            return View("NewSaleTask", updateTask);
        }
        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);
        }
        public ActionResult EditEliminateTask(string taskNumber)
        {
            if (Session["CheckEliminateTask"] == null || !(bool)Session["EditEliminateTask"] || !(bool)Session["CheckEliminateTask"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            EliminateTask updateTask = new EliminateTask().GetEliminateTask(taskNumber);

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

            var listService = new ListService();
            IEnumerable<SelectListItem> pighouse = listService.GetPigHouseList();
            ViewData["Status"] = listService.GetTaskStatusList();
            ViewData["PigHouse"] = pighouse;
            ViewData["Pigsty"] = listService.FindPigstyListByPigHouseId(pighouse.First().Value);
            ViewBag.Title = "修改淘汰任务";
            return View("NewEliminateTask", updateTask);
        }
        public ActionResult CheckPigHouseEquipMentInfo(string rfid)
        {
            if (Session["CheckFeed"] == null || !(bool) Session["CheckSystemManage"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            var pigHouseService = new PigHouseService();
            pig_house pigHouse = pigHouseService.FindByRfid(rfid);
            var pigHouseModel = new PigHouseModel
                                    {
                                        Id = pigHouse.Id,
                                        PigHouseTypeId = pigHouse.PigHouseTypeId,
                                        PigHouseTypeName = pigHouse.pig_house_type.Name,
                                        Number = pigHouse.Number,
                                        Rfid = pigHouse.RFID,
                                        Memo = pigHouse.Memo
                                    };
            var listService = new ListService();
            ViewData["PigHouseType"] = listService.GetPigHouseTypeList();
            ViewBag.Title = "查看猪舍";
            return View("AddPigHouseEquipMentInfo", pigHouseModel);
        }
        public ActionResult CheckPigstyEquipMentInfo(string rfid)
        {
            if (Session["CheckFeed"] == null || !(bool) Session["CheckSystemManage"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            var pigstyService = new PigstyService();
            pigsty pigsty = pigstyService.FindByRfid(rfid);
            var pigstyModel = new PigstyModel
                                  {
                                      Id = pigsty.Id,
                                      PigHouseId = pigsty.PigHouseId,
                                      Capacity = Convert.ToInt32(pigsty.Capacity),
                                      Number = pigsty.Number,
                                      Rfid = pigsty.RFID,
                                      Memo = pigsty.Memo
                                  };
            var listService = new ListService();
            ViewData["PigHouse"] = listService.GetPigHouseList();
            ViewBag.Title = "查看猪栏";
            return View("AddPigstyEquipMentInfo", pigstyModel);
        }
        public ActionResult NewDeadInfo()
        {
            if (Session["CheckDeadInfo"] == null || !(bool)Session["AddDeadInfo"] || !(bool)Session["CheckDeadInfo"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            var newInfo = new DeadInfo();
            var taskService = new TaskService();
            if (!newInfo.GetTaskNumberSelect(TaskTypeId).Any())
            {
                const string returnstring = "淘汰任务的生产信息已全部导入";
                Response.Write("<script language='JavaScript'>alert('" + returnstring + ".');history.go(-1);</script>");
                return Content("");
            }

            SelectListItem firstOrDefault = newInfo.GetTaskNumberSelect(TaskTypeId).FirstOrDefault();
            var pighouse = new ListService().GetPigHouseList();
            var pigsty = new ListService().FindPigstyListByPigHouseId(pighouse.FirstOrDefault().Value);

            ViewData["TaskNumber"] = newInfo.GetTaskNumberSelect(TaskTypeId);
            ViewData["Employee"] = new ListService().GetEmployeeList();
            ViewData["pighouse"] = pighouse;
            ViewData["pigsty"] = pigsty;
            ViewData["pig"] = new ListService().FindPigListByPigstyId(pigsty.FirstOrDefault().Value);
            ViewBag.Title = "新建死亡信息";
            return View(newInfo);
        }
        public ActionResult NewEliminateTask()
        {
            if (Session["CheckEliminateTask"] == null || !(bool)Session["AddEliminateTask"] || !(bool)Session["CheckEliminateTask"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            var listService = new ListService();
            //将猪的类型存入下拉列表
            IEnumerable<SelectListItem> pighouse = listService.GetPigHouseList();
            ViewData["PigHouse"] = pighouse;
            ViewData["Pigsty"] = listService.FindPigstyListByPigHouseId(pighouse.First().Value);
            ViewBag.Title = "新建淘汰任务";

            return View(new EliminateTask());
        }