Ejemplo n.º 1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (txtUsername.Text == "")
            {
                txtUsername.Focus(); return;
            }
            if (txtPassword.Text == "")
            {
                txtPassword.Focus(); return;
            }

            User u = new User();

            string un = txtUsername.Text;
            string up = txtPassword.Text;

            if (!u.LoginUser(un, up))
            {
                Interaction.MsgBox("Invalid Username and password", MsgBoxStyle.Critical);
                txtPassword.Clear();
                txtUsername.Clear();
                return;
            }

            if (u.Userrule != "Admin")
            {
                Interaction.MsgBox("Your not authorized in this module!", MsgBoxStyle.Critical);
                return;
            }

            frmOrderHistory frm = new frmOrderHistory();

            frm.Show();
            this.Close();
        }
Ejemplo n.º 2
0
 private void btnHistory_Click(object sender, EventArgs e)
 {
     if (mod_system.ORuser.Userrule == "Admin")
     {
         frmOrderHistory frm = new frmOrderHistory();
         frm.Show();
     }
     else
     {
         MessageBox.Show("You don't have access in this module!", "Verification", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return;
     }
 }
Ejemplo n.º 3
0
        private void btnVoid_Click(object sender, EventArgs e)
        {
            if (mod_system.ORuser.Userrule == "Admin")
            {
                frmOrderHistory frm1 = new frmOrderHistory();
                frm1.Show();
                return;
            }

            frmAutorize frm = new frmAutorize();

            frm.ShowDialog();
        }