Esempio n. 1
0
 public LandlordTemplateArea(LandlordTemplateAreaResponse response)
 {
     this.Name = response.AreaName;
     this.Order = response.AreaOrder;
     this.LandlordTemplateAreaID = response.LandlordTemplateAreaID;
     this.Items = LandlordTemplateAreaItem.CreateList(response.Items);
 }
        public JsonResult Get(int id)
        {
            LandlordTemplateAreaResponse response = null;

            LandlordTemplateArea landlordTemplateArea = db.LandlordTemplateAreas.Where(x => x.LandlordTemplateAreaID == id).FirstOrDefault();

            if (landlordTemplateArea != null)
            {
                response = new LandlordTemplateAreaResponse();
                response.LandlordTemplateAreaID = landlordTemplateArea.LandlordTemplateAreaID;
                response.AreaName = landlordTemplateArea.AreaName;
                response.AreaOrder = landlordTemplateArea.AreaOrder;
            }

            return Json(response, JsonRequestBehavior.AllowGet);
        }