private void AddMeeting3() { List <string> slots = new List <string>(); List <Participant> requestAttendee = new List <Participant>(); List <Participant> meetingAttendee = new List <Participant>(); slots.Add("S1"); slots.Add("S2"); slots.Add("S3"); slots.Add("S4"); requestAttendee.Add(p5); requestAttendee.Add(p6); Meeting m3 = new Meeting(p7.GetName(), "North Pole", "Rudolf's Nose Surgery", "Pending", slots, meetingAttendee, requestAttendee); p5.AddToMeetingListInvited(m3); p6.AddToMeetingListInvited(m3); }
private void AddMeeting1() { List <String> slot = new List <string>(); List <Participant> requestAttendee = new List <Participant>(); List <Participant> meetingAttendee = new List <Participant>(); slot.Add("S1"); slot.Add("S2"); slot.Add("S3"); slot.Add("S4"); slot.Add("S5"); requestAttendee.Add(p2); requestAttendee.Add(p4); requestAttendee.Add(p5); Meeting meet1 = new Meeting(p1.GetName(), "Owen 225", "Reindeer Route Planning", "Pending", slot, meetingAttendee, requestAttendee); p2.AddToMeetingListInvited(meet1); p4.AddToMeetingListInvited(meet1); p5.AddToMeetingListInvited(meet1); }
public void InitializeMeetings() { UpdateLists(); //disable Accept buttons button1.Enabled = false; button3.Enabled = false; button5.Enabled = false; button7.Enabled = false; button9.Enabled = false; //disable decline buttons button2.Enabled = false; button4.Enabled = false; button6.Enabled = false; button8.Enabled = false; button10.Enabled = false; label52.Text = User.GetName(); label14.Text = User.GetPsType(); Meeting m1 = new Meeting(); Participant p = new Participant(); for (int i = 0; i <= this.tableLayoutPanel2.ColumnCount; i++) { for (int j = 0; j <= this.tableLayoutPanel2.RowCount; j++) { Control c = this.tableLayoutPanel2.GetControlFromPosition(i, j); //ROW ONE if (i < 4 && j == 0) { if (0 < InvitedMeeting.Count) { button1.Enabled = true; button2.Enabled = true; if (InvitedMeeting[0] != null) { m1 = InvitedMeeting[0]; if (i == 0) { c.Text = m1.GetInitiator(); } if (i == 1) { c.Text = m1.GetTitle(); } if (i == 2) { c.Text = CheckStatus(m1); } if (i == 3) { c.Text = m1.GetLocation(); } } } else { if (i == 0) { c.Text = "N/A"; } if (i == 1) { c.Text = "N/A"; } if (i == 2) { c.Text = "N/A"; } if (i == 3) { c.Text = "N/A"; } } } if (i == 4 && j == 0) { if (0 < InvitedMeeting.Count) { if (InvitedMeeting[0] != null) { m1 = InvitedMeeting[0]; for (int k = 0; k < m1.GetSlot().Count; k++) { listBox1.Items.Add(m1.GetSlot()[k]); } } } else { listBox1.Items.Clear(); } } if (i == 5 && j == 0) { if (0 < InvitedMeeting.Count) { List <string> p1 = new List <string>(); List <string> s1 = new List <string>(); p1 = User.GetPreferredSlots(); s1 = m1.GetSlot(); for (int k = 0; k < p1.Count; k++) { for (int t = 0; t < s1.Count; t++) { if (p1[k] == s1[t]) { listBox2.Items.Add(p1[k]); } } } } else { listBox2.Items.Clear(); } } //ROW 2 if (i < 4 && j == 1) { if (1 < InvitedMeeting.Count) { button3.Enabled = true; button4.Enabled = true; if (InvitedMeeting[1] != null) { m1 = InvitedMeeting[1]; if (i == 0) { c.Text = m1.GetInitiator(); } if (i == 1) { c.Text = m1.GetTitle(); } if (i == 2) { c.Text = m1.GetStatus().ToString(); } if (i == 3) { c.Text = m1.GetLocation(); } } } else { if (i == 0) { c.Text = "N/A"; } if (i == 1) { c.Text = "N/A"; } if (i == 2) { c.Text = "N/A"; } if (i == 3) { c.Text = "N/A"; } } } if (i == 4 && j == 1) { if (1 < InvitedMeeting.Count) { if (InvitedMeeting[1] != null) { m1 = InvitedMeeting[1]; for (int k = 0; k < m1.GetSlot().Count; k++) { listBox5.Items.Add(m1.GetSlot()[k]); } } } else { listBox5.Items.Clear(); } } if (i == 5 && j == 1) { if (1 < InvitedMeeting.Count) { List <string> p1 = new List <string>(); List <string> s1 = new List <string>(); p1 = User.GetPreferredSlots(); s1 = m1.GetSlot(); for (int k = 0; k < p1.Count; k++) { for (int t = 0; t < s1.Count; t++) { if (p1[k] == s1[t]) { listBox3.Items.Add(p1[k]); } } } } else { listBox3.Items.Clear(); } } //ROW 3 if (i < 4 && j == 2) { if (2 < InvitedMeeting.Count) { button5.Enabled = true; button6.Enabled = true; if (InvitedMeeting[2] != null) { m1 = InvitedMeeting[2]; if (i == 0) { c.Text = m1.GetInitiator(); } if (i == 1) { c.Text = m1.GetTitle(); } if (i == 2) { c.Text = m1.GetStatus().ToString(); } if (i == 3) { c.Text = m1.GetLocation(); } } } else { if (i == 0) { c.Text = "N/A"; } if (i == 1) { c.Text = "N/A"; } if (i == 2) { c.Text = "N/A"; } if (i == 3) { c.Text = "N/A"; } } } if (i == 4 && j == 2) { if (2 < InvitedMeeting.Count) { if (InvitedMeeting[2] != null) { m1 = InvitedMeeting[2]; for (int k = 0; k < m1.GetSlot().Count; k++) { listBox4.Items.Add(m1.GetSlot()[k]); } } } else { listBox4.Items.Clear(); } } if (i == 5 && j == 2) { if (2 < InvitedMeeting.Count) { List <string> p1 = new List <string>(); List <string> s1 = new List <string>(); p1 = User.GetPreferredSlots(); s1 = m1.GetSlot(); for (int k = 0; k < p1.Count; k++) { for (int t = 0; t < s1.Count; t++) { if (p1[k] == s1[t]) { listBox8.Items.Add(p1[k]); } } } } else { listBox8.Items.Clear(); } } //ROW 4 if (i < 4 && j == 3) { if (3 < InvitedMeeting.Count) { button7.Enabled = true; button8.Enabled = true; if (InvitedMeeting[3] != null) { m1 = InvitedMeeting[3]; if (i == 0) { c.Text = m1.GetInitiator(); } if (i == 1) { c.Text = m1.GetTitle(); } if (i == 2) { c.Text = m1.GetStatus().ToString(); } if (i == 3) { c.Text = m1.GetLocation(); } } } else { if (i == 0) { c.Text = "N/A"; } if (i == 1) { c.Text = "N/A"; } if (i == 2) { c.Text = "N/A"; } if (i == 3) { c.Text = "N/A"; } } } if (i == 4 && j == 3) { if (3 < InvitedMeeting.Count) { if (InvitedMeeting[3] != null) { m1 = InvitedMeeting[3]; for (int k = 0; k < m1.GetSlot().Count; k++) { listBox6.Items.Add(m1.GetSlot()[k]); } } } else { listBox6.Items.Clear(); } } if (i == 5 && j == 3) { if (3 < InvitedMeeting.Count) { List <string> p1 = new List <string>(); List <string> s1 = new List <string>(); p1 = User.GetPreferredSlots(); s1 = m1.GetSlot(); for (int k = 0; k < p1.Count; k++) { for (int t = 0; t < s1.Count; t++) { if (p1[k] == s1[t]) { listBox7.Items.Add(p1[k]); } } } } else { listBox7.Items.Clear(); } } //ROW 5 if (i < 4 && j == 4) { if (4 < InvitedMeeting.Count) { button9.Enabled = true; button10.Enabled = true; if (InvitedMeeting[4] != null) { m1 = InvitedMeeting[4]; if (i == 0) { c.Text = m1.GetInitiator(); } if (i == 1) { c.Text = m1.GetTitle(); } if (i == 2) { c.Text = m1.GetStatus().ToString(); } if (i == 3) { c.Text = m1.GetLocation(); } } } else { if (i == 0) { c.Text = "N/A"; } if (i == 1) { c.Text = "N/A"; } if (i == 2) { c.Text = "N/A"; } if (i == 3) { c.Text = "N/A"; } } } if (i == 4 && j == 4) { if (4 < InvitedMeeting.Count) { if (InvitedMeeting[4] != null) { m1 = InvitedMeeting[4]; for (int k = 0; k < m1.GetSlot().Count; k++) { listBox10.Items.Add(m1.GetSlot()[k]); } } } else { listBox10.Items.Clear(); } } if (i == 5 && j == 4) { if (4 < InvitedMeeting.Count) { List <string> p1 = new List <string>(); List <string> s1 = new List <string>(); p1 = User.GetPreferredSlots(); s1 = m1.GetSlot(); for (int k = 0; k < p1.Count; k++) { for (int t = 0; t < s1.Count; t++) { if (p1[k] == s1[t]) { listBox11.Items.Add(p1[k]); } } } } else { listBox11.Items.Clear(); } } } } listBox9.Items.Clear(); foreach (Meeting m in User.GetPending()) { listBox9.Items.Add(m.GetTitle() + ", " + m.GetStatus() + ", " + m.GetLocation()); } }