Esempio n. 1
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            List <string> selectedParticipants = new List <string>();

            foreach (string item in checkedListParticipants.CheckedItems)
            {
                selectedParticipants.Add(item);
            }

            (bool, DateTime)validBoolTime = ObjectManipulation.isLocationValid(checkedListLocations.CheckedItems[0].ToString(), slots);
            if (validBoolTime.Item1)
            {
                string  selectedLocation = (checkedListLocations.CheckedItems[0]).ToString();
                Meeting newMeeting       = new Meeting(txtTitle.Text, txtDesc.Text,
                                                       ObjectManipulation.UserCollection.listOfUsers[ObjectManipulation.CurrentUserIndex].userName,
                                                       selectedParticipants, slots, selectedLocation, txtEquipment.Text);

                ObjectManipulation.UserCollection.listOfUsers[ObjectManipulation.CurrentUserIndex].addMeeting(newMeeting);
                ObjectManipulation.updateProposedMeetings(selectedParticipants, newMeeting);
                ObjectManipulation.JSON_Serialized(ObjectManipulation.UserCollection);
                this.Hide();
                home f1 = new home();
                f1.Show();
            }
            else
            {
                locationErrorLabel.Text = "location is not available at time '" + validBoolTime.Item2 + "' please re-enter";
            }
        }
Esempio n. 2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     try
     {
         ObjectManipulation.JSON_Deserialized();
     }
     catch (Exception)
     {
         ObjectManipulation.JSON_Serialized(null);
     }
 }
Esempio n. 3
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (ObjectManipulation.timeIsAvailable(dataTimePicker.Value))
     {
         timeSlotError.Text = "";
         checkedListSlots.Items.Add(dataTimePicker.Value);
         slots.Add(dataTimePicker.Value);
     }
     else
     {
         timeSlotError.Text = "time slot taken";
     }
 }
Esempio n. 4
0
        private void newMeeting_Load(object sender, EventArgs e)
        {
            participants = ObjectManipulation.getParticipantsList();
            foreach (string user in participants)
            {
                checkedListParticipants.Items.Add(user);
            }

            foreach (string place in locations)
            {
                checkedListLocations.Items.Add(place);
            }
        }
Esempio n. 5
0
        private void btnAcceptProposal_Click(object sender, EventArgs e)
        {
            foreach (string item in checkedListProposedM.CheckedItems)
            {
                string[] splitter = item.Split('-');
                ObjectManipulation.UserCollection.listOfUsers[ObjectManipulation.CurrentUserIndex].acceptSheduledMeeting(splitter[0]);
                ObjectManipulation.JSON_Serialized(ObjectManipulation.UserCollection);
            }
            this.Close();
            home f1 = new home();

            f1.Show();
        }
        private void SubmitButton_Click(object sender, EventArgs e)
        {
            if (txtPassword.Text != "" && txtUsername.Text != "")
            {
                submitErrorLabel.Text = "";
                List <Meeting> yourM     = new List <Meeting>();
                List <Meeting> proposedM = new List <Meeting>();
                List <Meeting> sheduledM = new List <Meeting>();

                User newUser = new User(txtUsername.Text, txtPassword.Text, yourM, proposedM, sheduledM);
                ObjectManipulation.UserCollection.listOfUsers.Add(newUser);
                ObjectManipulation.JSON_Serialized(ObjectManipulation.UserCollection);
                this.Close();
            }
            else
            {
                submitErrorLabel.Text = "error with submit";
            }
        }