public ActionResult Update(ZoneModel model) { if (!CheckPermission(WidgetPermissions.ManageWidgets)) { return(new HttpUnauthorizedResult()); } var record = model.Id != 0 ? zoneService.GetById(model.Id) : new Zone(); record.Name = model.Name; zoneService.Save(record); return(new AjaxResult().NotifyMessage("UPDATE_ENTITY_COMPLETE").CloseModalDialog()); }