public JsonResult Edit(EditViewModel model)
        {
            var          identiy = new AspNetIdentiyAuthorizeRelay <SysStaffUser>();
            SysStaffUser user    = identiy.GetUser(model.SysStaffUser.Id);

            user.FullName       = model.SysStaffUser.FullName;
            user.Email          = model.SysStaffUser.Email;
            user.PhoneNumber    = model.SysStaffUser.PhoneNumber;
            user.Mender         = this.CurrentUserId;
            user.LastUpdateTime = DateTime.Now;
            int[] userRoleIds = model.UserRoleIds;

            bool r = identiy.UpdateUser(this.CurrentUserId, user, model.SysStaffUser.PasswordHash, model.UserRoleIds);

            if (!r)
            {
                return(Json(ResultType.Failure, WebBackOperateTipUtils.UPDATE_FAILURE));
            }
            return(Json(ResultType.Success, WebBackOperateTipUtils.UPDATE_SUCCESS));
        }
示例#2
0
        public JsonResult Update(StaffUserModel model)
        {
            var          identiy = new AspNetIdentiyAuthorizeRelay <SysStaffUser>(CurrentDb);
            SysStaffUser user    = identiy.GetUser(model.Id);

            //user.FullName = model.FullName;
            user.FirstName      = model.FirstName;
            user.LastName       = model.LastName;
            user.Email          = model.Email;
            user.PhoneNumber    = model.PhoneNumber;
            user.Mender         = User.Identity.GetUserId <int>();
            user.LastUpdateTime = DateTime.Now;
            int[] userRoleIds = model.UserRoleIds;

            bool r = identiy.UpdateUser(user, model.Password, model.UserRoleIds);

            if (!r)
            {
                return(Json(ResultType.Failure, ManagerOperateTipUtils.UPDATE_FAILURE));
            }
            return(Json(ResultType.Success, ManagerOperateTipUtils.UPDATE_SUCCESS));
        }