Esempio n. 1
0
 public ActionResult Info(AccountDetailsDto account)
 {
     account.AccountId = CurrentUser.AccountId;
     account.RoleId    = CurrentUser.RoleId;
     account.UserName  = CurrentUser.UserName;
     return(Json(_sysAccountService.Save(account, CurrentUser.UserId)));
 }
Esempio n. 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.txtCode.Text.Trim().Length < 6 || this.txtCode.Text.Trim().Length > 16)
                {
                    Warning("登录名验证错误!");
                    return;
                }
                if (this.txtpassword.Text.Trim().Length < 6 || this.txtpassword.Text.Trim().Length > 16)
                {
                    Warning("登录密码验证错误!");
                    return;
                }

                if (!userService.IsUnique(this.txtCode.Text.Trim()))
                {
                    Warning("登录名已经存在!");
                    return;
                }

                SysAccount account = userService.Get(this.userId);
                account.Code      = this.txtCode.Text.Trim();
                account.Name      = this.txtName.Text.Trim();
                account.PassWord  = this.txtpassword.Text.Trim();
                account.IsEnabled = this.drpUserType.SelectedValue == "1" ? true : false;

                userService.Save();

                JsAlert("保存成功!", true);
                this.txtCode.Text = string.Empty;
            }
            catch (Exception ex)
            {
                JsAlert("保存失败,请稍后再试!");
            }
        }
Esempio n. 3
0
 public ActionResult Form(AccountDetailsDto account)
 {
     return(Json(_sysAccountService.Save(account, CurrentUser.UserId)));
 }