Пример #1
0
        public ActionResult Delete(AttachmentRuleDelete value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            var rule = this.AttachmentRuleService.GetById(value.Id);

            if (rule == null)
            {
                return base.HttpNotFound();
            }

            var privilege = new AttachmentRulePrivilege();

            if (!privilege.CanDelete(rule))
            {
                return NotAuthorized();
            }

            this.AttachmentRuleService.Delete(rule);

            return base.RedirectToRoute(AdministrationRoutes.AttachmentRuleIndex);
        }
Пример #2
0
        public ActionResult Delete(int id)
        {
            var rule = this.AttachmentRuleService.GetById(id);

            if (rule == null)
            {
                return base.HttpNotFound();
            }

            var privilege = new AttachmentRulePrivilege();

            return privilege.CanDelete(rule) ? base.View(Views.Delete, new AttachmentRuleDelete(rule)) : NotAuthorized();
        }