Пример #1
0
    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();
    }
Пример #2
0
        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());
        }
Пример #3
0
        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);
        }
Пример #4
0
        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;
        }