コード例 #1
0
ファイル: FrmLogin.cs プロジェクト: chenjx56/CAMS
        private void OpenForm(string sql, string type)
        {
            SqlDataReader sqlData = YRHelper.GetDataReader(sql);

            if (sqlData.HasRows)
            {
                switch (type)
                {
                case "student":
                    FrmStudent stu = new FrmStudent(txtAccount.Text);
                    stu.Show();
                    this.Hide();
                    break;

                case "teacher":
                    FrmTeacher tea = new FrmTeacher(txtAccount.Text);
                    tea.Show();
                    this.Hide();
                    break;

                case "admin":
                    FrmAdmin admin = new FrmAdmin(txtAccount.Text);
                    admin.Show();
                    this.Hide();
                    break;
                }
            }
            else
            {
                MessageBox.Show("登录失败,请检查账号或密码!");
            }
            sqlData.Close();
        }
コード例 #2
0
        private void 教师查询ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (frmteacher == null || frmteacher.IsDisposed)
            {
                frmteacher = new FrmTeacher(jumpinfo);
            }
            Size OldSize = frmteacher.Size;

            this.Size            = new Size(OldSize.Width + 20, OldSize.Height + 70);
            frmteacher.MdiParent = this;
            frmteacher.Location  = new Point(0, 0);;
            frmteacher.Show();
        }