Example #1
0
        private void btnTroVe_Click(object sender, EventArgs e)
        {
            frmTrangChu fTr = new frmTrangChu();

            this.Hide();
            fTr.Show();
        }
Example #2
0
        //public static string ID = "";
        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            string sName = txtTenDangNhap.Text;
            string sPass = txtMatKhau.Text;
            string sId   = "";

            if (rdbAdmin.Checked == true)
            {
                sId = xlCSDL.getAllId(txtTenDangNhap.Text, txtMatKhau.Text);
                if (sName != string.Empty && sPass != string.Empty)
                {
                    if (sId != String.Empty)
                    {
                        frmTrangChu fIn = new frmTrangChu();
                        fIn.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Tài Khoản không tồn tại ! ");
                    }
                }
                else
                {
                    MessageBox.Show("Không được để trống các trường ! ");
                }
            }
            if (rdbUser.Checked == true)
            {
                sId = xlCSDL.getAllIdUser(txtTenDangNhap.Text, txtMatKhau.Text);
                if (sName != string.Empty && sPass != string.Empty)
                {
                    if (sId != String.Empty)
                    {
                        frmQuanLyXeMayUser fIn = new frmQuanLyXeMayUser();
                        fIn.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Tài Khoản không tồn tại ! ");
                    }
                }
                else
                {
                    MessageBox.Show("Không được để trống các trường ! ");
                }
            }
        }