Beispiel #1
0
        private void LbExit_Click(object sender, EventArgs e)
        {
            MenuAdmin menuAdmin = new MenuAdmin(selectedConn, maCS);

            this.Hide();
            menuAdmin.ShowDialog();
        }
Beispiel #2
0
        private void Label1_Click(object sender, EventArgs e)
        {
            MenuAdmin ma = new MenuAdmin(selectedConn, maCS);

            this.Hide();
            ma.ShowDialog();
        }
Beispiel #3
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            if (checkAccountExist())
            {
                getTag();
                if (tag == 0) //role TRUONG, thì set conntion tùy thuộc cái comboBox người ta chọn
                {
                    if (check.Checked == true)
                    {
                        AddAccount addAccount = new AddAccount(selectedConn, maCoSo);
                        this.Hide();
                        addAccount.ShowDialog();

                        /*
                         * Info adc = new Info(selectedConn,maCoSo);
                         * this.Hide();
                         * adc.ShowDialog();
                         */
                    }
                    else
                    {
                        MessageBox.Show("Chọn cơ sở để đăng nhập.");
                    }
                }
                if (tag == 1) //role CS1, set conn = conn1
                {
                    selectedConn = conn1;
                    maCoSo       = "CS1";
                    MenuAdmin ma = new MenuAdmin(selectedConn, maCoSo);
                    this.Hide();
                    ma.ShowDialog();
                }
                if (tag == 2) //role CS2, set conn = conn2
                {
                    selectedConn = conn2;
                    maCoSo       = "CS2";
                    MenuAdmin ma = new MenuAdmin(selectedConn, maCoSo);
                    this.Hide();
                    ma.ShowDialog();
                }
                if (tag == 3 || tag == 4)
                {
                    getMaCoSo();
                    if (maCoSo.Equals("CS1"))
                    {
                        selectedConn = conn1;
                    }
                    else if (maCoSo.Equals("CS2"))
                    {
                        selectedConn = conn2;
                    }
                    if (tag == 3) //role SinhVien
                    {
                    }
                    if (tag == 4) //role GiaoVien
                    {
                    }
                }
            }
            else
            {
                MessageBox.Show("Sai thông tin!");
            }
        }