Ejemplo n.º 1
0
 public ActionResult AddPigHouseEquipMentInfo(PigHouseModel model)
 {
     var pigHouseService = new PigHouseService();
     var pigHouse = new pig_house
                        {
                            PigHouseTypeId = model.PigHouseTypeId,
                            Number = model.Number,
                            RFID = model.Rfid,
                            Memo = model.Memo
                        };
     pigHouseService.Insert(pigHouse);
     ViewBag.Title = "添加成功";
     return View("PigHouseMessage");
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public ActionResult PigHouseEquipMentInfo(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 pigHouseModel = new PigHouseModel();
            PagedList<PigHouseModel> infoPagerList = pigHouseModel.GetPigHousePagedList(pageIndex, pageSize);

            if (Request.IsAjaxRequest())
            {
                return PartialView("UCJqPigHouse", infoPagerList);
            }

            return View(infoPagerList);
        }
Ejemplo n.º 4
0
 public ActionResult ModifyPigHouseEquipMentInfo(PigHouseModel model)
 {
     var pigHouseService = new PigHouseService();
     pig_house pigHouse = pigHouseService.Find(model.Id);
     pigHouse.RFID = model.Rfid;
     pigHouse.Number = model.Number;
     pigHouse.PigHouseTypeId = model.PigHouseTypeId;
     pigHouse.Memo = model.Memo;
     pigHouseService.Update(pigHouse);
     ViewBag.Title = "修改成功";
     return View("PigHouseMessage");
 }