protected void OnActionDeleteClicked(object sender, EventArgs e) { LinkButton lnkItem = (LinkButton)sender; int actionID = int.Parse(lnkItem.CommandArgument); Neos.Data.Action deleteItem = new Neos.Data.Action(actionID); ActionRepository repo = new ActionRepository(); repo.Delete(deleteItem); BindGridData(null); gridActions.DataBind(); }
public IActionResult Delete(int id) { var user = GetCurrentUserProfile(); var action = _actionRepository.GetById(id); if (user.Id != action.Goal.UserProfileId) { return(Forbid()); } _actionRepository.Delete(id); return(NoContent()); }
private static int DeleteRecordsByControllerAction(Server.Models.Action action) { int ret = 0; if (null != action) { using (TransactionalDbClient tc = ionixFactory.CreateTransactionalDbClient()) { ActionRepository actionRepository = new ActionRepository(tc.Cmd); //RoleControllerAction Siliniyor. RoleActionRepository roleActionRepository = new RoleActionRepository(tc.Cmd); ret += roleActionRepository.DeleteByControllerActionIds(action.Id.ToSingleItemList()); //controllerAction Siliniyor. ret += actionRepository.Delete(action); tc.Commit(); } } return(ret); }
private static int DeleteRecordsByControllerAction(Models.Action action) { int ret = 0; if (null != action) { using (TransactionalDbClient tc = DataFactory.CreateTransactionalDbClient()) { ActionRepository actionRepository = new ActionRepository(tc.Cmd); //RoleControllerAction Siliniyor. RoleActionRepository roleActionRepository = new RoleActionRepository(tc.Cmd); ret += roleActionRepository.DeleteByControllerActionIds(action.Id.ToSingleItemList()); //controllerAction Siliniyor. ret += actionRepository.Delete(action); tc.Commit(); } } return ret; }