public MeetingImpl()
 {
     connectionManager = new ConnectionManager();
 }
示例#2
0
        private void selectedTabChanged(object sender, TabControlEventArgs e)
        {
            connectionManager = new ConnectionManager();
            if (this.tabManager.SelectedTab == this.tabPageOptions)
            {
                Dictionary<string, string> smtpSetting = connectionManager.readSmtpSettings();
                if (smtpSetting != null)
                {
                    if (smtpSetting["hostName"].Contains("gmail"))
                    {
                        this.cbxEmailType.SelectedIndex = 0;
                    }
                    else if (smtpSetting["hostName"].Contains("yahoo"))
                    {
                        this.cbxEmailType.SelectedIndex = 1;
                    }
                    this.txtSenderNames.Text = smtpSetting["senderName"];
                    this.txtSenderEmail.Text = smtpSetting["senderEmail"];
                    this.txtSenderPassword.Text = smtpSetting["senderPassword"];
                }
            }
            else if (this.tabManager.SelectedTab == this.tabPageStatistics)
            {
                this.rdbGeneral.Checked = true;
                this.rdbPeriod.Checked = true;
                this.clbxMembers.Items.Clear();

                //Populate members checkListBox
                List<Member> allMembers = memberImpl.getAllMembers();

                if (allMembers != null && allMembers.Count != 0)
                {
                    foreach (Member member in memberImpl.getAllMembers())
                    {
                        this.clbxMembers.Items.Add(member.Lastname + " " + member.Firstname);
                    }
                }

                //Populate sex checkListBox
                Array sex = Enum.GetValues(typeof(Gender));
                foreach (Gender g in sex)
                {
                    if (!g.ToString().Equals(Gender.Unspecified.ToString()))
                    {
                        this.clbxSex.Items.Add(g.ToString());
                    }
                }

                //Populate meetings checkListBox
                List<Meeting> allMeetings = meetingImpl.getAllMeetings();
                if (allMeetings != null && allMeetings.Count != 0)
                {
                    foreach (Meeting meeting in allMeetings)
                    {
                        this.clbxMeetings.Items.Add(meeting.Date.ToString("dd MMM yyyy"));
                    }
                }
            }
        }