Exemple #1
0
 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("សូមបំពេញពត៏មានឲ្យបានត្រឹមត្រូវ!!!");
         }
     }
 }
Exemple #2
0
 private void FrmMain_KeyDown(object sender, KeyEventArgs e)
 {
     
     if (e.KeyCode == Keys.Space)
     {
         Forms.Sale.FrmFrontSaleOffice frmFrontSaleOffice = new Forms.Sale.FrmFrontSaleOffice();
         frmFrontSaleOffice.Show();
         this.Close();
     }
 }
Exemple #3
0
 private void button2_Click(object sender, EventArgs e)
 {
     Forms.Sale.FrmFrontSaleOffice frmFrontSaleOffice = new Forms.Sale.FrmFrontSaleOffice();
     frmFrontSaleOffice.Show();
     this.Close();
 }