private void btnAzurirajStudenta_Click(object sender, EventArgs e)
        {
            FrmStudent frmStudent = new FrmStudent();

            frmStudent.Show();
            this.Hide();
        }
示例#2
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     if (CheckInput())
     {
         if (Login())
         {
             string Name;
             Name = this.txtUserName.Text.Trim();
             if (this.cboLoginType.Text == "学员")
             {
                 //打开BookManagementSysForm窗体
                 this.Hide();
                 FrmStudent frmStudent = new FrmStudent();
                 frmStudent.SetUserName(Name);
                 frmStudent.Show();
             }
             else if (this.cboLoginType.Text == "管理员")
             {
                 //打开BookManagementSysForm窗体
                 this.Hide();
                 BookManagementSysForm from2 = new BookManagementSysForm();
                 from2.SetUserName(Name);
                 from2.Show();
             }
         }
         else
         {
             MessageBox.Show("登录失败,用户名或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             txtUserName.Clear();
             txtPwd.Clear();
             txtUserName.Focus();
             //选中下拉列表的第一项
             this.cboLoginType.SelectedIndex = 0;
         }
     }
 }