Beispiel #1
0
        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();
        }
Beispiel #2
0
        private void 学生档案查询ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (FrmStu == null || FrmStu.IsDisposed)
            {
                FrmStu = new FrmStudent();
            }
            Size OldSize = FrmStu.Size;

            this.Size        = new Size(OldSize.Width + 20, OldSize.Height + 70);
            FrmStu.MdiParent = this;
            FrmStu.Location  = new Point(0, 0);;
            FrmStu.Show();
        }
Beispiel #3
0
        private void btmLogin_Click(object sender, EventArgs e)
        {
            string  sql = string.Format("select * from tbluser where username='******' and userpwd='{1}'", txtName.Text, txtPwd.Text);
            DataSet ds  = Common.QuerySql(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                FrmStudent f = new FrmStudent();
                f.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("账号或密码错误");
            }
        }
Beispiel #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            string id, pwd;

            id  = textBox1.Text;
            pwd = textBox1.Text;
            if (id == "123")
            {
                FrmStudent f = new FrmStudent();
                f.Show();
            }
            else
            {
                MessageBox.Show("账号或密码错误");
            }
        }
Beispiel #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            FrmStudent frm = new FrmStudent();

            frm.Show();
        }