示例#1
0
        public ActionResult Delete(UserSearchDelete value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            var search = UserSearchService.GetById(value.Id);

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

            var privilege = new UserSearchPrivilege();

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

            if (!ModelState.IsValid)
            {
                return base.View(Views.Update, value);
            }

            this.UserSearchService.Delete(search);

            return base.RedirectToRoute(UsersAdministrationRoutes.SearchCreate);
        }
示例#2
0
        public ActionResult Delete(int id)
        {
            var search = this.UserSearchService.GetById(id);

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

            var privilege = new UserSearchPrivilege();

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