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

            frmStudent.Show();
            this.Hide();
        }
예제 #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            FrmLogin f1 = new FrmLogin();

            Application.Run(f1);
            if (f1.Tag.ToString() == "验证成功")
            {
                FrmStudent f2 = new FrmStudent();
                Application.Run(f2);
            }
            else
            {
                Application.Exit();
            }
        }
예제 #3
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;
         }
     }
 }