Esempio n. 1
0
        public ActionResult Delete(int?id, string masterUserId = null)
        {
            UserClaimItemModel userClaimItemModel = new UserClaimItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                UserClaim            = new UserClaimViewModel(),
                ControllerAction     = "Delete",
                MasterUserId         = masterUserId
            };

            try
            {
                if (IsDelete(userClaimItemModel.OperationResult))
                {
                    UserClaim userClaim = Repository.GetById(new object[] { id });
                    if (userClaim != null)
                    {
                        userClaimItemModel.UserClaim = new UserClaimViewModel(userClaim);
                    }
                }
            }
            catch (Exception exception)
            {
                userClaimItemModel.OperationResult.ParseException(exception);
            }

            return(View(userClaimItemModel));
        }
Esempio n. 2
0
        public ActionResult Update(UserClaimItemModel userClaimItemModel)
        {
            try
            {
                if (IsUpdate(userClaimItemModel.OperationResult))
                {
                    if (ValidateModelState(Repository))
                    {
                        if (Repository.Update(userClaimItemModel.OperationResult, (UserClaim)userClaimItemModel.UserClaim.ToData()))
                        {
                            if (UnitOfWork.Save(userClaimItemModel.OperationResult))
                            {
                                return(RedirectToUrlDictionary());
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                userClaimItemModel.OperationResult.ParseException(exception);
            }

            userClaimItemModel.IsSecurityOperations = IsSecurityOperations;

            return(View(userClaimItemModel));
        }
        public ActionResult Update(UserClaimItemModel userClaimItemModel)
        {
            try
            {
                if (IsUpdate(userClaimItemModel.OperationResult))
                {
                    if (ValidateModelState(Repository))
                    {
                        if (Repository.Update(userClaimItemModel.OperationResult, (UserClaim)userClaimItemModel.UserClaim.ToData()))
                        {
                            if (UnitOfWork.Save(userClaimItemModel.OperationResult))
                            {
                                return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                userClaimItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(userClaimItemModel.OperationResult));
        }
Esempio n. 4
0
        public ActionResult Create(string masterUserId = null)
        {
            UserClaimItemModel userClaimItemModel = new UserClaimItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                UserClaim            = new UserClaimViewModel(),
                ControllerAction     = "Create",
                MasterUserId         = masterUserId
            };

            try
            {
                IsCreate(userClaimItemModel.OperationResult);
            }
            catch (Exception exception)
            {
                userClaimItemModel.OperationResult.ParseException(exception);
            }

            return(View(userClaimItemModel));
        }