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); } }
private void CboSort_SelectedIndexChanged(object sender, EventArgs e) { if (cboSort.Text == "defauft") { LogTrailBLL bll = new LogTrailBLL(); gvLogTrail.DataSource = bll.GetTblLogTrails(); } }
private void btnRemoveAll_Click(object sender, EventArgs e) { if (MessageBox.Show("You want to delete all record?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { LogTrailBLL bll = new LogTrailBLL(); gvLogTrail.DataSource = bll.GetTblLogTrails(); //lblTotal.Text = Total().ToString("#,###,##0"); MessageBox.Show("All record have delete"); } }
private void BtnBack_Click(object sender, EventArgs e) { tblLogTrail log = new tblLogTrail(); LogTrailBLL bll = new LogTrailBLL(); log.Dater = DateTime.Now.ToString(); log.Descrip = "User: "******" has successfully logged Out!"; log.Authority = "Cashier"; bll.Insert(log); this.Close(); frmStart frmStart = new frmStart(); frmStart.Show(); }
private void LblUser_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show("Are you sure? ", "Log Out", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dialogResult == DialogResult.Yes) { tblLogTrail log = new tblLogTrail(); LogTrailBLL bll = new LogTrailBLL(); log.Dater = DateTime.Now.ToString(); log.Descrip = "User: "******" has successfully logged Out!"; log.Authority = "Admin"; bll.Insert(log); this.Close(); frmStart frmStart = new frmStart(); frmStart.Show(); frmLogAdmin frmLogAdmin = new frmLogAdmin(); frmLogAdmin.Show(); } }
private void FrmLogTrail_Load(object sender, EventArgs e) { LogTrailBLL bll = new LogTrailBLL(); gvLogTrail.DataSource = bll.GetTblLogTrails(); }