Пример #1
0
 //单击登陆事件
 private void ButLogin_Click(object sender, EventArgs e)
 {
     if (!CheckInput())
     {
         return;
     }
     if (this.cbSelect.SelectedIndex == 0)//管理员
     {
         if (am.CheckUserLogin(textFormId.Text.Trim(), textFormPwd.Text.Trim()))
         {
             //MessageBox.Show("管理员登陆成功");
             //跳转到indexForm页面,隐藏登陆页面
             indexForm indexForm = new indexForm();
             indexForm.Show();
             this.Hide();
         }
         else
         {
             MessageBox.Show(INPUTNOEXIST, INPUTWARN, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else
     {
         if (ss.CheckStudentsLogin(textFormId.Text.Trim(), textFormPwd.Text.Trim()))
         {
             //MessageBox.Show("登陆成功");
             //跳转到图书管理系统-读者页面
             indexFormStu indexFormStu = new indexFormStu();
             indexFormStu.Show();
             this.Hide();
             //获取登陆人id
             Students.value = this.textFormId.Text.Trim();
         }
         else
         {
             MessageBox.Show(INPUTNOEXIST, INPUTWARN, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }