Esempio n. 1
0
        private void lastloginBtn_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            managerMainScreen.Visibility       = Visibility.Hidden;
            managerMainScreenShadow.Visibility = Visibility.Hidden;

            actionPanelLabel.Content         = "Last Login";
            LastLoginScreen.Visibility       = Visibility.Visible;
            LastLoginScreenShadow.Visibility = Visibility.Visible;

            ManagerDAFactory me = new ManagerDAFactory();

            lastLoginBGTxt.Content = me.findMe(myName, myPassword);

            btnBack.Visibility = Visibility.Visible;
        }
Esempio n. 2
0
        private void viewChangeBtn_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            //view all events, only show events in dataGrid

            managerMainScreen.Visibility       = Visibility.Hidden;
            managerMainScreenShadow.Visibility = Visibility.Hidden;

            actionPanelLabel.Content          = "View Events";
            viewEventsScreen.Visibility       = Visibility.Visible;
            viewEventsScreenShadow.Visibility = Visibility.Visible;

            ManagerDAFactory man = new ManagerDAFactory();

            //dataGrid.ItemsSource = man.viewEvents();
            eventList.ItemsSource = man.viewEvents();
            btnBack.Visibility    = Visibility.Visible;
        }
Esempio n. 3
0
        private void fab_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (currentFabTask == fabTasks.addAdmin)
            {
                AdminDAFactory admin = new AdminDAFactory();

                bool check = admin.addAdmin(addAdminName.Text, hiddenPassword, long.Parse(addAdminCell.Text), addAdminEmail.Text);
                if (check)
                {
                    currentFabTask                  = fabTasks.nul;
                    addAdminScreen.Visibility       = Visibility.Hidden;
                    addAdminScreenShadow.Visibility = Visibility.Hidden;

                    actionPanelLabel.Content    = "Admin";
                    mainScreen.Visibility       = Visibility.Visible;
                    mainScreenShadow.Visibility = Visibility.Visible;
                    fnSetFabVisible(Visibility.Hidden);
                    btnBack.Visibility = Visibility.Hidden;
                }
                else
                {
                    currentFabTask = fabTasks.nul;
                }
            }
            else if (currentFabTask == fabTasks.addGuard)
            {
                AdminDAFactory admin = new AdminDAFactory();

                bool check = admin.addGuard(addGuardName.Text, long.Parse(addGuardCell.Text));
                if (check)
                {
                    currentFabTask                  = fabTasks.nul;
                    addAdminScreen.Visibility       = Visibility.Hidden;
                    addAdminScreenShadow.Visibility = Visibility.Hidden;

                    actionPanelLabel.Content    = "Admin";
                    mainScreen.Visibility       = Visibility.Visible;
                    mainScreenShadow.Visibility = Visibility.Visible;
                    fnSetFabVisible(Visibility.Hidden);
                    btnBack.Visibility = Visibility.Hidden;
                }
                else
                {
                    currentFabTask = fabTasks.addAdmin;
                }
            }
            else if (currentFabTask == fabTasks.addRoute)
            {
                AdminDAFactory admin = new AdminDAFactory();

                bool check = admin.addRoute(addRouteName.Text);
                if (check)
                {
                    currentFabTask                  = fabTasks.nul;
                    addAdminScreen.Visibility       = Visibility.Hidden;
                    addAdminScreenShadow.Visibility = Visibility.Hidden;

                    actionPanelLabel.Content    = "Admin";
                    mainScreen.Visibility       = Visibility.Visible;
                    mainScreenShadow.Visibility = Visibility.Visible;
                    fnSetFabVisible(Visibility.Hidden);
                    btnBack.Visibility = Visibility.Hidden;
                }
                else
                {
                    currentFabTask = fabTasks.addAdmin;
                }
            }
            else if (currentFabTask == fabTasks.addBus)
            {
                AdminDAFactory admin = new AdminDAFactory();

                bool check = admin.addDriver(addDriverName.Text, long.Parse(addDriverCell.Text));
                if (check)
                {
                    currentFabTask                  = fabTasks.nul;
                    addAdminScreen.Visibility       = Visibility.Hidden;
                    addAdminScreenShadow.Visibility = Visibility.Hidden;

                    actionPanelLabel.Content    = "Admin";
                    mainScreen.Visibility       = Visibility.Visible;
                    mainScreenShadow.Visibility = Visibility.Visible;
                    fnSetFabVisible(Visibility.Hidden);
                    btnBack.Visibility = Visibility.Hidden;
                }
                else
                {
                    currentFabTask = fabTasks.addAdmin;
                }
            }
            else if (currentFabTask == fabTasks.addManager)
            {
                ManagerDAFactory admin = new ManagerDAFactory();
                bool             check = admin.addManager(addManagerName.Text, hiddenPassword, long.Parse(addManagerCell.Text), addManagerEmail.Text);
                if (check)
                {
                    currentFabTask = fabTasks.nul;
                    addManagerScreen.Visibility       = Visibility.Hidden;
                    addManagerScreenShadow.Visibility = Visibility.Hidden;

                    actionPanelLabel.Content    = "Admin";
                    mainScreen.Visibility       = Visibility.Visible;
                    mainScreenShadow.Visibility = Visibility.Visible;
                    fnSetFabVisible(Visibility.Hidden);
                    btnBack.Visibility = Visibility.Hidden;
                }
                else
                {
                    currentFabTask = fabTasks.addManager;
                }
            }
            else if (currentFabTask == fabTasks.makeUserAdmin)
            {
            }
        }
Esempio n. 4
0
 private void logInValidation()
 {
     //check login
     if ((bool)loginAdminRb.IsChecked)
     {
         AdminDAFactory adminFac = new AdminDAFactory();
         if (loginPassword.Text != "Enter Password" && loginPassword.Text != "Password Hidden")
         {
             hiddenPassword = loginPassword.Text;
         }
         if (adminFac.logIn(loginName.Text, hiddenPassword))
         {
             Window loggedIn = new Admin();
             loggedIn.WindowStartupLocation = WindowStartupLocation.CenterScreen;
             loggedIn.SourceInitialized    += (s, a) => loggedIn.WindowState = WindowState.Normal;
             Admin.WhoAmI(loginName.Text, loginPassword.Text);
             loggedIn.Show();
             this.Hide();
         }
         else
         {
             MessageBox.Show("Admin does not exist with this name or password");
             fnSetFabTask(fabTasks.logInCredentials);
         }
     }
     else if ((bool)loginManagerRb.IsChecked)
     {
         ManagerDAFactory managerFac = new ManagerDAFactory();
         if (loginPassword.Text != "Enter Password" && loginPassword.Text != "Password Hidden")
         {
             hiddenPassword = loginPassword.Text;
         }
         if (managerFac.logIn(loginName.Text, hiddenPassword))
         {
             Window loggedIn = new Manager();
             loggedIn.WindowStartupLocation = WindowStartupLocation.CenterScreen;
             loggedIn.SourceInitialized    += (s, a) => loggedIn.WindowState = WindowState.Normal;
             loggedIn.Show();
             Manager.WhoAmI(loginName.Text, loginPassword.Text);
             this.Hide();
         }
         else
         {
             MessageBox.Show("Manager does not exist with this name or password");
             fnSetFabTask(fabTasks.logInCredentials);
         }
     }
     else if ((bool)loginUserRb.IsChecked)
     {
         UserDAFactory userFac = new UserDAFactory();
         if (loginPassword.Text != "Enter Password" && loginPassword.Text != "Password Hidden")
         {
             hiddenPassword = loginPassword.Text;
         }
         if (userFac.logIn(loginName.Text, hiddenPassword))
         {
             Window loggedIn = new User();
             loggedIn.WindowStartupLocation = WindowStartupLocation.CenterScreen;
             loggedIn.SourceInitialized    += (s, a) => loggedIn.WindowState = WindowState.Normal;
             loggedIn.Show();
             User.WhoAmI(userFac.findMe(loginName.Text, loginPassword.Text));
             this.Hide();
         }
         else
         {
             MessageBox.Show("User does not exist with this name or password");
             fnSetFabTask(fabTasks.logInCredentials);
         }
     }
 }
Esempio n. 5
0
        public void checkOut()
        {
            ManagerDAFactory me = new ManagerDAFactory();

            me.updateLastLogin(me.findMyObj(myName, myPassword));
        }