Exemplo 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";
            }
        }
Exemplo n.º 2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     try
     {
         ObjectManipulation.JSON_Deserialized();
     }
     catch (Exception)
     {
         ObjectManipulation.JSON_Serialized(null);
     }
 }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
0
        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";
            }
        }