Esempio n. 1
0
 public AreaItem(AreaItemResponse response)
 {
     this.AreaID = response.AreaID;
     this.AreaItemID = response.AreaItemID;
     this.RoomDescription = response.RoomDescription;
     this.RoomItem = response.RoomItem;
 }
Esempio n. 2
0
        public JsonResult AddedAreaItem(AreaItemResponse model)
        {
            CreateAreaItemRequest request = new CreateAreaItemRequest();
            request.AreaItemID = model.AreaItemID;
            request.RoomItem = model.RoomItem;
            request.AreaID = model.AreaID;
            request.RoomDescription = model.RoomDescription;

            var result = ApiWrapper.Post<AreaItemResponse>("api/areaitem/add", request);

            return Json(result);
        }
Esempio n. 3
0
        public static AreaItem Create(AreaItemResponse response)
        {
            if (response == null)
                return null;

            AreaItem user = new AreaItem();
            user.AreaItemID = response.AreaItemID;
            user.RoomItem = response.RoomItem;
            user.RoomDescription = response.RoomDescription;
            user.AreaID = response.AreaID;

            return user;

        }
Esempio n. 4
0
        public ActionResult AddAreaItem(int areaitemID = 0)
        {
            AreaItemResponse formModel = new AreaItemResponse();

            if (areaitemID != 0)
            {
                AreaItemResponse areaitem = ApiWrapper.Get<AreaItemResponse>("api/areaitem/get/" + areaitemID);
                formModel.AreaItemID = areaitem.AreaItemID;
                formModel.RoomDescription = areaitem.RoomItem;
                formModel.AreaID = areaitem.AreaID;
                formModel.RoomDescription = areaitem.RoomDescription;
            }

            return View("Add", formModel);
        }
Esempio n. 5
0
        public JsonResult Get(int id)
        {
            AreaItemResponse response = null;

            AreaItem areaItem = db.AreaItems.Where(x => x.AreaItemID == id).FirstOrDefault();

            if (areaItem != null)
            {
                response = new AreaItemResponse();
                response.AreaID = areaItem.AreaID;
                response.AreaItemID = areaItem.AreaItemID;
                response.RoomDescription = areaItem.RoomDescription;
                response.RoomItem = areaItem.RoomItem;
            }

            return Json(response, JsonRequestBehavior.AllowGet);
        }