public ActionResult Delete(string loginProvider, string providerKey, string userId, string masterUserId = null)
        {
            UserLoginItemModel userLoginItemModel = new UserLoginItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                UserLogin            = new UserLoginViewModel(),
                ControllerAction     = "Delete",
                MasterUserId         = masterUserId
            };

            try
            {
                if (IsDelete(userLoginItemModel.OperationResult))
                {
                    UserLogin userLogin = Repository.GetById(new object[] { loginProvider, providerKey, userId });
                    if (userLogin != null)
                    {
                        userLoginItemModel.UserLogin = new UserLoginViewModel(userLogin);
                    }
                }
            }
            catch (Exception exception)
            {
                userLoginItemModel.OperationResult.ParseException(exception);
            }

            return(View(userLoginItemModel));
        }
        public ActionResult Update(UserLoginItemModel userLoginItemModel)
        {
            try
            {
                if (IsUpdate(userLoginItemModel.OperationResult))
                {
                    if (ValidateModelState(Repository))
                    {
                        if (Repository.Update(userLoginItemModel.OperationResult, (UserLogin)userLoginItemModel.UserLogin.ToData()))
                        {
                            if (UnitOfWork.Save(userLoginItemModel.OperationResult))
                            {
                                return(RedirectToUrlDictionary());
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                userLoginItemModel.OperationResult.ParseException(exception);
            }

            userLoginItemModel.IsSecurityOperations = IsSecurityOperations;

            return(View(userLoginItemModel));
        }
示例#3
0
        public ActionResult Update(UserLoginItemModel userLoginItemModel)
        {
            try
            {
                if (IsUpdate(userLoginItemModel.OperationResult))
                {
                    if (ValidateModelState(Repository))
                    {
                        if (Repository.Update(userLoginItemModel.OperationResult, (UserLogin)userLoginItemModel.UserLogin.ToData()))
                        {
                            if (UnitOfWork.Save(userLoginItemModel.OperationResult))
                            {
                                return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                userLoginItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(userLoginItemModel.OperationResult));
        }
        public ActionResult Create(string masterUserId = null)
        {
            UserLoginItemModel userLoginItemModel = new UserLoginItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                UserLogin            = new UserLoginViewModel(),
                ControllerAction     = "Create",
                MasterUserId         = masterUserId
            };

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

            return(View(userLoginItemModel));
        }