private void button3_Click(object sender, EventArgs e)
        {
            Boolean validConf = false;
            if (listBox1.SelectedIndex == -1)
            {
                MessageBox.Show("Please Choose a conference to enter");
            }
            else
            {
                validConf = Program.MainSystem.validateConference(SearchResults[listBox1.SelectedIndex]);
                if (validConf)
                {
                   currentCon = SearchResults[listBox1.SelectedIndex];
                   currentCon.Participant.Add(Program.MainSystem.LoggedIn);
                   currentCon.Participant = currentCon.Participant.Distinct().ToList();
                   ConferenceForm startConference = new ConferenceForm(currentCon);

                    startConference.Show();

                }
                else
                {
                    MessageBox.Show("You do not have the skills to enter this conference");
                }
            }
        }
        public ConferenceForm(Conference selectedConf)
        {
            this.selectedConf = selectedConf;
            InitializeComponent();

            label1.Text = this.selectedConf.name;
            for (int i = 0; i < this.selectedConf.Participant.Count(); i++)
            {
                listBox1.Items.Add(this.selectedConf.Participant[i].name);
            }

            Timer T = new Timer();
            T.Tick +=  new EventHandler(refreshMsg);
            T.Interval = 1000;
            T.Start();
        }
Beispiel #3
0
 public System()
 {
     U1 = new User(1,23,"Liam","password",U1SkillsList,tempProfile);
     U2 = new User(2, 23, "Sam", "password", U2SkillsList, tempProfile);
     U3 = new User(3, 23, "Joe", "password", U3SkillsList, tempProfile);
     U4 = new User(4, 23, "Aaron", "password", U4SkillsList, tempProfile);
     U5 = new User(5, 23, "Ignas", "password", U5SkillsList, tempProfile);
     U6 = new User(6, 23, "Dovydas", "password", U6SkillsList, tempProfile);
     LoggedIn = U1;
     ConUserList1.Add(U2);
     C1 = new Conference(1, "Sql Conference", U1, Convert.ToDateTime("10/10/2014"), ConUserList1, ConSkillList1);
     C2 = new Conference(2, "test conference", U2, Convert.ToDateTime("10/10/2015"), ConUserList2, ConSkillList2);
     C3 = new Conference(3, "Java conference", U3, Convert.ToDateTime("10/10/2014"), ConUserList1, ConSkillList3);
     C4 = new Conference(4, "Business management",U4, Convert.ToDateTime("10/10/2014"), ConUserList1, ConSkillList4);
     C5 = new Conference(5,"Business management", U5, Convert.ToDateTime("10/10/2014"), ConUserList1, ConSkillList5);
     ConArray.Add(C1);
     ConArray.Add(C2);
     ConArray.Add(C3);
     ConArray.Add(C4);
     ConArray.Add(C5);
 }
Beispiel #4
0
 public List<Messages> refreshMessages(Conference selectedConf)
 {
     List<Messages> MsgFees = new List<Messages>();
     MsgFees = selectedConf.getConferenceMessages();
     return MsgFees;
 }
Beispiel #5
0
 public Boolean validateConference(Conference selectedConf)
 {
     Boolean isValid= false;
     //Checks the skills of the logged on user against the choosen conference
     for (int i = 0; i < LoggedIn.skills.Count(); i++)
     {
         if (selectedConf.skills.Contains(LoggedIn.skills[i]))
         {
             isValid = true;
             break;
         }
     }
         return isValid;
 }
Beispiel #6
0
 public void sendMessage(string messageText, Conference selectedConf)
 {
     string userName = LoggedIn.name;
     DateTime CurrentDateTime = DateTime.Now;
     selectedConf.sendMessage(messageText, userName, CurrentDateTime);
 }