private void btnLogin_Click(object sender, EventArgs e) { if (txtPassword.Text == "" || txtUsername.Text == "") { MessageBox.Show("សូមបំពេញពត៏មានឲ្យបានត្រឹមត្រូវ!!!"); } else { DTO.Staff staff = new StaffDAO().Login(txtUsername.Text.Trim().ToLower(), txtPassword.Text.Trim()); if (staff != null) { UserSession.Session.Staff = staff; if (UserSession.Session.Staff.Stafftype.ToLower() == "admin") { Forms.FrmMain frmMain = new Forms.FrmMain(); frmMain.Show(); this.Hide(); } else { Forms.Sale.FrmFrontSaleOffice frmFrontSaleOffice = new Forms.Sale.FrmFrontSaleOffice(); frmFrontSaleOffice.Show(); this.Close(); } } else { MessageBox.Show("សូមបំពេញពត៏មានឲ្យបានត្រឹមត្រូវ!!!"); } } }
private void button1_Click(object sender, EventArgs e) { if (UserSession.Session.Staff.Stafftype.ToLower() == "admin") { Forms.FrmMain frmMain = new Forms.FrmMain(); frmMain.Show(); this.Close(); } else { UserSession.Session.Staff = null; Forms.FrmLogin form = new Forms.FrmLogin(); form.Show(); this.Close(); } }
private void btnBack_Click(object sender, EventArgs e) { Forms.FrmMain frmMain = new Forms.FrmMain(); frmMain.Show(); this.Close(); }