Пример #1
0
        //----------------------------------------------------------------------------------------------
        //----------------------- Employee Login -------------------------------------------------------

        private void buttonLogin_Click(object sender, EventArgs e)
        {
            User objUser = null;

            if (comboBoxUser.Text == string.Empty || textBoxUsername.Text == string.Empty || textBoxPassword.Text == string.Empty)
            {
                labelLoginMessage.Text = "Enter Valid Input !!";
            }
            else
            {
                objUser             = new User();
                objUser.Email       = textBoxUsername.Text;
                objUser.Password    = textBoxPassword.Text;
                objUser.Designation = comboBoxUser.Text;
                bool validUser = FinTrustBL.CheckEmployeeUser(objUser);
                if (validUser)
                {
                    if (objUser.Designation == "Branch Manager")
                    {
                        this.Hide();
                        Branch_Manager BMHomeForm = new Branch_Manager();
                        BMHomeForm.Show();
                    }
                    else if (objUser.Designation == "Probationary Officer")
                    {
                        this.Hide();
                        Probationary_Officer POHomeForm = new Probationary_Officer();
                        POHomeForm.Show();
                    }
                    else if (objUser.Designation == "Cashier")
                    {
                        this.Hide();
                        FinTrust_Cashier CashierHomeForm = new FinTrust_Cashier();
                        CashierHomeForm.Show();
                    }
                    else if (objUser.Designation == "Clerk")
                    {
                        this.Hide();
                        Clerk ClerkHomeForm = new Clerk();
                        ClerkHomeForm.Show();
                    }
                }
                else
                {
                    labelLoginMessage.Text = "Invalid Login Credentials!";
                }
            }
        }
Пример #2
0
 public static void GetLastPage()
 {
     if (LoginInfo.designation == "Branch Manager")
     {
         Branch_Manager BMHomeForm = new Branch_Manager();
         BMHomeForm.Show();
     }
     else if (LoginInfo.designation == "Probationary Officer")
     {
         Probationary_Officer POHomeForm = new Probationary_Officer();
         POHomeForm.Show();
     }
     else if (LoginInfo.designation == "Clerk")
     {
         Clerk clerkHomeForm = new Clerk();
         clerkHomeForm.Show();
     }
     else if (LoginInfo.designation == "Cashier")
     {
         FinTrust_Cashier cashierHomeForm = new FinTrust_Cashier();
         cashierHomeForm.Show();
     }
 }