Example #1
0
        private void ViewBt_Click(object sender, EventArgs e)
        {
            if (AllUserDataGridView.SelectedRows.Count == 0)
            {
                MessageBox.Show("请选中要查看的行。");
                return;
            }
            string          userCode    = AllUserDataGridView.SelectedRows[0].Cells[0].Value.ToString(); //获取到选中行的userCode
            StudentMainForm stuMainForm = new StudentMainForm(userCode, true, "view");                   //以管理员查看方式打开界面

            stuMainForm.ShowDialog();
        }
Example #2
0
        private void EditBt_Click(object sender, EventArgs e)
        {
            if (AllUserDataGridView.SelectedRows.Count == 0)
            {
                MessageBox.Show("请选中要编辑的行。");
                return;
            }
            string          userCode    = AllUserDataGridView.SelectedRows[0].Cells[0].Value.ToString(); //获取到选中行的userCode
            StudentMainForm stuMainForm = new StudentMainForm(userCode, true, "edit");                   //以管理员编辑方式打开界面

            stuMainForm.ShowDialog();
            AdminStuForm_Load(null, null);
        }
Example #3
0
 private void LoginBt_Click(object sender, EventArgs e)
 {
     bool[] signInResult = presenter.SignIn(userCodeTB.Text, pswTB.Text);
     if (signInResult[0])
     {
         if (signInResult[1])//管理员
         {
             LoginForm.adminMainForm = new AdminMainForm();
             this.Close();
         }
         else//普通用户
         {
             LoginForm.stuMainForm = new StudentMainForm(userCodeTB.Text);
             this.Close();
         }
     }
     else
     {
         MessageBox.Show("用户名或密码错误,\n请检查输入!");
     }
 }