public ActionResult Delete(TimeZoneDelete value) { if (value == null) { throw new ArgumentNullException("value"); } var timeZone = this.TimeZoneService.GetById(value.Id); if (timeZone == null) { return base.HttpNotFound(); } var privilege = new TimeZonePrivilege(); if (!privilege.CanDelete(timeZone)) { return NotAuthorized(); } this.TimeZoneService.Delete(timeZone); return base.RedirectToRoute(AdministrationRoutes.TimeZoneIndex); }
public ActionResult Delete(int id) { var timeZone = this.TimeZoneService.GetById(id); if (timeZone == null) { return base.HttpNotFound(); } var privilege = new TimeZonePrivilege(); return privilege.CanDelete(timeZone) ? base.View(Views.Delete, new TimeZoneDelete(timeZone)) : NotAuthorized(); }