| | |
| | | return this.LoadUserMenuList(context); |
| | | case "updatePermission": |
| | | return this.UpdatePermission(context); |
| | | case "updateStatus": |
| | | return this.UpdateStatus(context); |
| | | |
| | | default: |
| | | throw new Exception("Invalid Action=" + @string); |
| | | } |
| | |
| | | int int1 = context.GetInt("userid"); |
| | | string string1 = context.GetString("account"); |
| | | string string2 = context.GetString("password"); |
| | | string userName = context.GetString("userName"); |
| | | string string3 = context.GetString("email"); |
| | | string string4 = context.GetString("mobile"); |
| | | int int2 = context.GetInt("emailFlag"); |
| | |
| | | throw new ArgumentException("账户至少3位可见字符,请重新输入!"); |
| | | if (string.IsNullOrEmpty(string2) || string2.Length < 6) |
| | | throw new ArgumentException("账户密码至少6位,请重新输入!"); |
| | | if (string.IsNullOrEmpty(userName)) |
| | | throw new ArgumentException("账号名称不能为空,请输入!"); |
| | | if (context.GetBoolean("isVerification")) |
| | | num = 1; |
| | | string string5 = context.GetString("clientIp"); |
| | |
| | | SysUser sysUser = new SysUser(); |
| | | sysUser.UserID = int1; |
| | | sysUser.Account = string1; |
| | | |
| | | if (this._Dao.UserNameExists(userName, int1)) |
| | | throw new ArgumentException("账户名称已经存在,请重新输入!"); |
| | | |
| | | sysUser.UserName = userName; |
| | | sysUser.CreateTime = DateTime.Now; |
| | | if (int1 > 0) |
| | | { |
| | |
| | | } |
| | | return new JsonPageResult(true, (object) "账户保存成功!"); |
| | | } |
| | | |
| | | |
| | | //更新信息启用或停用 |
| | | private JsonPageResult UpdateStatus(PageContext<SysUser> context) |
| | | { |
| | | int userId = context.GetInt("userId"); |
| | | int status = context.GetInt("status"); |
| | | |
| | | SysUser sysUser = new SysUser(); |
| | | sysUser.UserID = userId; |
| | | sysUser.Status = status; |
| | | this._Dao.UpdateStatus(sysUser); |
| | | return new JsonPageResult(true, "更新信息状态成功!"); |
| | | |
| | | } |
| | | } |