Exemplo n.º 1
0
 /// <summary>
 /// 添加用户
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnOK_Click(object sender, EventArgs e)
 {
     ;
     if (this.checkInput())
     {
         int result = SysUserMgr.Add(this.txtUsername.Text, this.txtPass.Text, this.txtName.Text, this.chkDefaultPower.Checked);
         if (result == -2)
         {
             untCommon.InfoMsg("添加用户失败");
             return;
         }
         if (result == -5)//只添加用户
         {
             untCommon.InfoMsg("添加用户成功");
             this.cleartxt(); //清空文本框
             return;
         }
         if (result != -3)//既添加用户又 添加默认权限
         {
             untCommon.InfoMsg("添加用户成功,并成功的设置了默认权限。");
             this.cleartxt(); //清空文本框
         }
         else
         {
             if (untCommon.QuestionMsg("添加用户成功,但自动设置权限失败。是否要手动设置权限?"))
             {
                 frmPowerSet power = new frmPowerSet();
                 power.ShowDialog();
                 return;
             }
         }
     }
 }
Exemplo n.º 2
0
        private void Menu_Sy_PowerSet_Click(object sender, EventArgs e)
        {
            frmPowerSet power = new frmPowerSet();

            power.LoginName = this._loginname;
            power.ShowDialog();
        }
Exemplo n.º 3
0
 /// <summary>
 /// 添加用户
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (this.checkInput())
     {
         int result = SysUserMgr.Add(this.txtUserId.Text, this.txtPass.Text, this.txtName.Text, this.cbxDepart.SelectedValue.ToString()
                                     , this.txtTel.Text, this.txtEmail.Text, this.cbxPower.Text);
         if (result == -1)
         {
             untCommon.InfoMsg("添加用户失败");
             return;
         }
         if (result != -2)//既添加用户又 添加默认权限
         {
             untCommon.InfoMsg("添加用户成功,并成功的设置了权限。");
             this.cleartxt(); //清空文本框
             this.lvwUser.Items.Clear();
             this.InitUser();
         }
         else
         {
             if (untCommon.QuestionMsg("添加用户成功,但自动设置权限失败。是否要手动设置权限?"))
             {
                 this.lvwUser.Items.Clear();
                 this.InitUser();
                 frmPowerSet power = new frmPowerSet();
                 power.ShowDialog();
                 return;
             }
         }
     }
 }