Exemple #1
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     if (cbDepartment.Text != "")
     {
         if (cbDepartment.Text == "Sales" && txtPassword.Text == "Jberger")
         {
             frmSales frmsales = new frmSales();
             frmsales.Show();
         }
         else if (cbDepartment.Text == "Finance" && txtPassword.Text == "Wvortelaars")
         {
             frmFinance frmFinance = new frmFinance();
             frmFinance.Show();
         }
         else if (cbDepartment.Text == "Development" && txtPassword.Text == "Hvanderhoek")
         {
             frmDevelopment frmdevelopment = new frmDevelopment();
             frmdevelopment.Show();
         }
         else if (cbDepartment.Text == "Admin")
         {
         }
         else
         {
             MessageBox.Show("Please enter the correct password. If you have forgotten your departments password ask one of your coworkers.");
         }
     }
     else
     {
         MessageBox.Show("Please choose your department");
     }
 }
Exemple #2
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     if (cbDepartment.Text != "")
     {
         if (cbDepartment.Text == "Sales" && txtPassword.Text == "test" && isActiveSales == false)
         {
             isActiveSales = true;
             frmSales frmsales = new frmSales();
             frmsales.Show();
             txtPassword.Text = "";
         }
         else if (cbDepartment.Text == "Finance" && txtPassword.Text == "test")
         {
             isActiveFinance = true;
             frmFinance frmFinance = new frmFinance();
             frmFinance.Show();
             txtPassword.Text = "";
         }
         else if (cbDepartment.Text == "Development" && txtPassword.Text == "test")
         {
             isActiveDevelopment = true;
             frmDevelopment frmdevelopment = new frmDevelopment();
             frmdevelopment.Show();
             txtPassword.Text = "";
         }
         else if (cbDepartment.Text == "Admin")
         {
         }
         else
         {
             MessageBox.Show("Please enter the correct password. If you have forgotten your departments password ask one of your coworkers.");
         }
     }
     else
     {
         MessageBox.Show("Please choose your department");
     }
 }