public ActionResult AddPigstyEquipMentInfo(PigstyModel model)
 {
     var pigstyService = new PigstyService();
     var pigsty = new pigsty
                      {
                          Number = model.Number,
                          PigHouseId = model.PigHouseId,
                          RFID = model.Rfid,
                          Memo = model.Memo,
                          Capacity = model.Capacity
                      };
     pigstyService.Insert(pigsty);
     ViewBag.Title = "添加成功";
     return View("PigstyMessage");
 }
        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 PigstyEquipMentInfo(int pageIndex = 1)
        {
            if (Session["CheckFeed"] == null || !(bool) Session["CheckSystemManage"])
            {
                Response.Write("<script>history.go(0);</script>");
                return View("Error");
            }

            const int pageSize = 25;
            var pigstyModel = new PigstyModel();
            PagedList<PigstyModel> infoPagerList = pigstyModel.GetPigstyPagedList(pageIndex, pageSize);

            if (Request.IsAjaxRequest())
            {
                return PartialView("UCJqPigsty", infoPagerList);
            }
            return View(infoPagerList);
        }
 public ActionResult ModifyPigstyEquipMentInfo(PigstyModel model)
 {
     var pigstyService = new PigstyService();
     pigsty pigsty = pigstyService.Find(model.Id);
     pigsty.RFID = model.Rfid;
     pigsty.Number = model.Number;
     pigsty.PigHouseId = model.PigHouseId;
     pigsty.Memo = model.Memo;
     pigsty.Capacity = model.Capacity;
     pigstyService.Update(pigsty);
     ViewBag.Title = "修改成功";
     return View("PigstyMessage");
 }