Exemplo n.º 1
0
        private void UC_Info_Load(object sender, EventArgs e)
        {
            //获取当前用户的特长信息

            this.loginUser = userBll.Query(u => u.ID == Program.loginUserID).FirstOrDefault();
            //展示
            if (loginUser != null)
            {
                this.htmlEditor1.BodyHtml = loginUser.ShowInfo ?? string.Empty;
            }
        }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     var con = Tools.CheckIllegalControls(this.tbxRePwd, this.tbxPwd, this.tbxName, this.cmbRole);
     if (con != null)
     {
         MessageBox.Show("该项不能为空");
         con.Focus();
         return;
     }
     if (this.tbxPwd.Text != this.tbxRePwd.Text)
     {
         MessageBox.Show("输入的密码不一样");
         this.tbxRePwd.Focus();
         return;
     }
     var bll = new BaseBLL<t_User>();
     var urBll = new BaseBLL<t_UserRole>();
     var user = new t_User()
     {
         ID = Guid.NewGuid(),
         Pwd = this.tbxPwd.Text,
         RoleID = new Guid(this.cmbRole.SelectedValue.ToString()),
         User = this.tbxName.Text
     };
     var ur = new t_UserRole()
     {
         RoleID = user.RoleID,
         UserID = user.ID
     };
     if (bll.Query(u => u.User == user.User).Any())
     {
         MessageBox.Show("该用户名已被注册"); return;
     }
     if (bll.Add(user) && urBll.Add(ur))
     {
         if (MessageBox.Show("注册成功", "", MessageBoxButtons.OK) == DialogResult.OK)
         {
             this.Close();
         }
     }
 }