예제 #1
0
        public ActionResult Update(UserClaimItemModel userClaimItemModel)
        {
            try
            {
                if (IsUpdate(userClaimItemModel.OperationResult))
                {
                    if (IsValid(userClaimItemModel.OperationResult, userClaimItemModel.UserClaim))
                    {
                        UserClaim userClaim = (UserClaim)userClaimItemModel.UserClaim.ToData();
                        if (Application.Update(userClaimItemModel.OperationResult, userClaim))
                        {
                            if (userClaimItemModel.IsSave)
                            {
                                return(JsonResultSuccess(userClaimItemModel.OperationResult,
                                                         Url.Action("Update", "UserClaim", new { Id = userClaim.Id }, Request.Url.Scheme)));
                            }
                            else
                            {
                                return(JsonResultSuccess(userClaimItemModel.OperationResult));
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                userClaimItemModel.OperationResult.ParseException(exception);
            }

            userClaimItemModel.ActivityOperations = ActivityOperations;

            return(JsonResultOperationResult(userClaimItemModel.OperationResult));
        }
예제 #2
0
        public ActionResult Create(string masterEntity = null, string masterKey = null)
        {
            UserClaimItemModel userClaimItemModel = new UserClaimItemModel(ActivityOperations, "Create", masterEntity, masterKey);

            try
            {
                if (IsCreate(userClaimItemModel.OperationResult))
                {
                    return(ZPartialView("CRUD", userClaimItemModel));
                }
            }
            catch (Exception exception)
            {
                userClaimItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(userClaimItemModel.OperationResult));
        }
예제 #3
0
        public ActionResult Delete(UserClaimItemModel userClaimItemModel)
        {
            try
            {
                if (IsDelete(userClaimItemModel.OperationResult))
                {
                    if (Application.Delete(userClaimItemModel.OperationResult, (UserClaim)userClaimItemModel.UserClaim.ToData()))
                    {
                        return(JsonResultSuccess(userClaimItemModel.OperationResult));
                    }
                }
            }
            catch (Exception exception)
            {
                userClaimItemModel.OperationResult.ParseException(exception);
            }

            userClaimItemModel.ActivityOperations = ActivityOperations;

            return(JsonResultOperationResult(userClaimItemModel.OperationResult));
        }
예제 #4
0
        public ActionResult Delete(int id, string masterEntity = null, string masterKey = null)
        {
            UserClaimItemModel userClaimItemModel = new UserClaimItemModel(ActivityOperations, "Delete", masterEntity, masterKey);

            try
            {
                if (IsDelete(userClaimItemModel.OperationResult))
                {
                    UserClaim userClaim = Application.GetById(userClaimItemModel.OperationResult, new object[] { id });
                    if (userClaim != null)
                    {
                        userClaimItemModel.UserClaim = new UserClaimViewModel(userClaim);

                        return(ZPartialView("CRUD", userClaimItemModel));
                    }
                }
            }
            catch (Exception exception)
            {
                userClaimItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(userClaimItemModel.OperationResult));
        }