Example #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            loginEnt login = new loginEnt();

            login.username      = tbUser.Text;
            login.password      = tbPassword.Text;
            login.userTypeAdmin = a;
            login.userTypeUser  = z;
            login.userTypeExe   = y;


            CurrentUserValue currentUser = new CurrentUserValue();

            currentUser.currentUser = tbUser.Text;

            username = tbUser.Text;


            if (tbUser.Text == "")
            {
                MessageBox.Show("Username required!", "Login Validation", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (tbPassword.Text == "")
            {
                MessageBox.Show("Password required!", "Login validation", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                bool b = loginRepo.LoginAdmin(login);
                bool c = userRepo.UserLogin(login);
                bool f = exeRepo.ExLogin(login);
                bool d = cUser.CurrentUserStore(currentUser);


                if (c == true && d == true)
                {
                    MessageBox.Show("Login Successful admin");
                    this.Hide();
                    DashboardAdmin management = new DashboardAdmin();
                    management.Show();
                    this.Hide();
                }
                else if (b == true && d == true)
                {
                    MessageBox.Show("Login Successful User");
                    this.Hide();
                    UserDash dashboard = new UserDash();
                    dashboard.Show();
                }
                else if (f == true && d == true)
                {
                    MessageBox.Show("Login Successful Exe");
                    this.Hide();
                    ExeDash exedashboard = new ExeDash();
                    exedashboard.Show();
                }
                else
                {
                    MessageBox.Show("Login Failed!", "Login Validation", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
Example #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            AdminLogin aLogin = new AdminLogin();

            aLogin.username = tbUser.Text;
            aLogin.password = tbPassword.Text;

            Patient patient = new Patient();

            patient.username = tbUser.Text;
            patient.password = tbPassword.Text;

            Coordinator coordinator = new Coordinator();

            coordinator.username = tbUser.Text;
            coordinator.password = tbPassword.Text;

            CurrentUserValue currentUser = new CurrentUserValue();

            currentUser.currentUser = tbUser.Text;

            username = tbUser.Text;

            if (tbUser.Text == "")
            {
                MessageBox.Show("Username required!", "Login Validation", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (tbPassword.Text == "")
            {
                MessageBox.Show("Password required!", "Login validation", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                bool b  = loginRepo.LoginAdmin(aLogin);
                bool bp = patientRepo.PatientLogin(patient);
                bool bc = coordinatorRepo.CoordinatorLogin(coordinator);
                bool c  = userRepo.CurrentUserStore(currentUser);



                if (b == true && c == true)
                {
                    MessageBox.Show("Login Successful admin");
                    this.Hide();
                    ManagementDashboard management = new ManagementDashboard();
                    management.Show();
                    this.Hide();
                }
                else if (bp == true && c == true)
                {
                    MessageBox.Show("Login Successful Patient");

                    this.Hide();
                    Dashboard dashboard = new Dashboard();
                    dashboard.Show();
                }
                else if (bc == true && c == true)
                {
                    MessageBox.Show("Login Successful Coordinator");
                    this.Hide();
                    DashboardCoordinator dashboardCoordinator = new DashboardCoordinator();
                    dashboardCoordinator.Show();
                }
                else
                {
                    MessageBox.Show("Login Failed!", "Login Validation", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }