Exemplo n.º 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("សូមបំពេញពត៏មានឲ្យបានត្រឹមត្រូវ!!!");
         }
     }
 }
Exemplo n.º 2
0
 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();
     }
 }
Exemplo n.º 3
0
 private void btnBack_Click(object sender, EventArgs e)
 {
     Forms.FrmMain frmMain = new Forms.FrmMain();
     frmMain.Show();
     this.Close();
 }