Exemplo n.º 1
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);
            }
        }