示例#1
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            LogAdminBLL logAdminBLL = new LogAdminBLL();
            tblAdmin    admin       = new tblAdmin();

            admin.Username = txtUserName.Text;
            admin.Password = txtPassword.Text;
            if (logAdminBLL.getLogin(admin).HasRows)
            {
                tblLogTrail log = new tblLogTrail();
                LogTrailBLL bll = new LogTrailBLL();
                log.Dater     = lblDateTime.Text;
                log.Descrip   = "User: "******" has successfully Logged In!";
                log.Authority = "Admin";
                bll.Insert(log);
                frmStart frmStart = (frmStart)Application.OpenForms["frmStart"];
                frmStart.Hide();
                frmAdminMenu frmAdminMenu = new frmAdminMenu();
                frmAdminMenu.Show();
                this.Hide();
            }
            else
            {
                DialogResult = MessageBox.Show("Không được phép truy cập! ", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
示例#2
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            LogAdminBLL logAdminBLL = new LogAdminBLL();
            tblAdmin    admin       = new tblAdmin();

            admin.Username = txtUserName.Text;
            admin.Password = txtPassword.Text;
            if (logAdminBLL.getLogin(admin).HasRows)
            {
                MessageBox.Show("Welcome", "Susscess", MessageBoxButtons.OK, MessageBoxIcon.None);
                frmStart frmStart = (frmStart)Application.OpenForms["frmStart"];
                frmStart.Hide();
                frmAdminMenu frmAdminMenu = new frmAdminMenu();
                frmAdminMenu.Show();
                this.Hide();
            }
            else
            {
                DialogResult = MessageBox.Show("Không được phép truy cập! ", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }