Exemple #1
0
        private void Menu_Click(object sender, RoutedEventArgs e)
        {
            NavigationService navService = NavigationService.GetNavigationService(this);
            Groups_Page       nextPage   = new Groups_Page();

            navService.Navigate(nextPage);
        }
Exemple #2
0
        private void Confirm_CreateGroup_Click(object sender, RoutedEventArgs e)
        {
            // Add a colour wheel or something
            if (Group_Name.Text == "")
            {
                MessageBox.Show("A group name is required");
            }
            else if (Group_Description.Text == "")
            {
                MessageBox.Show("A description is required");
            }
            else
            {
                GlobalGroupStorage.TOTAL_GROUPS++;
                GlobalGroupStorage.GroupNames.Add(Group_Name.Text);
                GlobalGroupStorage.GroupIDs.Add(Group_ID.Text);
                GlobalGroupStorage.GroupDescriptions.Add(Group_Description.Text);

                GlobalVariables.insertIntoGroup(Group_Name.Text, "#FFAA20", Group_Description.Text);

                int groupID = GlobalVariables.returnAmountOfGroups();

                foreach (string email in DisplayUsernamesData.NAMES_IN)
                {
                    GlobalVariables.insertPersonIntoGroup(GlobalVariables.emailToID(email), groupID);
                }

                NavigationService navService = NavigationService.GetNavigationService(this);
                Groups_Page       nextPage   = new Groups_Page();
                navService.Navigate(nextPage);
            }
        }
Exemple #3
0
        private void LoginDown(object sender, RoutedEventArgs e)
        {
            var canContinue = true;
            var userPass    = true;
            var studentPass = true;
            var password    = PasswordBox.Password;

            var user = UserName.Text;

            //Check user in database//// Idk How XD

            if (GlobalVariables.isUsernameInPeople(user) == false)
            {
                ErrorBox.Foreground = new BrushConverter().ConvertFromString("#3dff11") as SolidColorBrush;
                ErrorBox.Text       = "User not found";
                userPass            = false;
            }
            if (GlobalVariables.isEmailInPeople(user) == false)
            {
                ErrorBox.Foreground = new BrushConverter().ConvertFromString("#3dff11") as SolidColorBrush;
                ErrorBox.Text       = "Student Code not found";
                studentPass         = false;
            }

            if (GlobalVariables.IsDigitsOnly(user))
            {
                if (GlobalVariables.isCorrectPasswordEmail(password, int.Parse(user)) == false)
                {
                    ErrorBox.Foreground = new BrushConverter().ConvertFromString("#3dff11") as SolidColorBrush;
                    ErrorBox.Text       = "Incorrect Password";
                    canContinue         = false;
                }
            }
            else
            {
                if (GlobalVariables.isCorrectPasswordUsername(password, user) == false)
                {
                    ErrorBox.Foreground = new BrushConverter().ConvertFromString("#3dff11") as SolidColorBrush;
                    ErrorBox.Text       = "Incorrect Password";
                    canContinue         = false;
                }
            }



            if (canContinue == true && (userPass || studentPass))
            {
                NavigationService navService = NavigationService.GetNavigationService(this);
                Groups_Page       nextPage   = new Groups_Page();
                navService.Navigate(nextPage);
            }
        }
        private void Leave_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Are you sure you want to leave this group?", "Leave Confirmation", System.Windows.MessageBoxButton.YesNo);

            if (messageBoxResult == MessageBoxResult.Yes)
            {
                GlobalVariables.leaveGroup();

                NavigationService navService = NavigationService.GetNavigationService(this);
                Groups_Page       nextPage   = new Groups_Page();
                navService.Navigate(nextPage);
            }
        }