public JsonResult DeleteArea([DataSourceRequest] DataSourceRequest request, AdminAreas area)
        {
            var existingArea = this.Data.Areas.GetById(area.Id);

            this.Data.Areas.Delete(existingArea);
            this.Data.SaveChanges();

            return Json(new[] { area }, JsonRequestBehavior.AllowGet);
        }
        public JsonResult EditArea([DataSourceRequest] DataSourceRequest request, AdminAreas area)
        {
            var existingArea = this.Data.Areas.GetById(area.Id);

            if (area != null && ModelState.IsValid)
            {
                existingArea.Name = area.Name;

                this.Data.SaveChanges();
            }

            return Json((new[] { area }.ToDataSourceResult(request, ModelState)), JsonRequestBehavior.AllowGet);
        }
        public JsonResult CreateArea([DataSourceRequest] DataSourceRequest request, AdminAreas area)
        {
            if (area != null && ModelState.IsValid)
            {
                var newArea = new Area
                {
                    Name = area.Name
                };

                this.Data.Areas.Add(newArea);
                this.Data.SaveChanges();

                area.Id = newArea.Id;
            }

            return Json(new[] { area }.ToDataSourceResult(request, ModelState), JsonRequestBehavior.AllowGet);
        }