Exemplo n.º 1
0
 public void btnProfile_Click(object sender, EventArgs e)
 {
     Form listofmembers = new MemberList(false);
     Application.DoEvents();
     if (Properties.Settings.Default.playSounds)
         Sound.Click.Play();
     listofmembers.ShowDialog();
 }
Exemplo n.º 2
0
        private void btnAddMembers_Click(object sender, EventArgs e)
        {
            int iTerm = cbTerm.SelectedIndex;
            if (iTerm == -1)
            {
                if (Properties.Settings.Default.playSounds)
                    Sound.Error.Play();
                MessageBox.Show("Please select a term to add members to.");
            }
            else
            {
                if (Properties.Settings.Default.playSounds)
                    Sound.Click.Play();

                ClsStorage.selectedMembersList.Clear();

                /* this gets a bunch of member indices into clsStorage.selectedMembersList */
                /* the MemberList load function clears selectedMembersList for us, so we don't need to worry about it */
                MemberList tmp = new MemberList(true);
                tmp.ShowDialog();
                tmp.Dispose();

                List<int> addedList = new List<int>();
                foreach (int i in ClsStorage.selectedMembersList)
                {
                    if (!ClsStorage.currentClub.listTerms[iTerm].addMember((short)i))
                    {
                        MessageBox.Show("Too many members in the given term. Please add fewer members.");
                        MessageBox.Show("Now reverting...");
                        foreach (int j in addedList)
                        {
                            ClsStorage.currentClub.listTerms[iTerm].removeMember((short)j);
                        }
                        MessageBox.Show("Finished reverting...");
                        return;
                    }
                    addedList.Add(i);
                }

                foreach (int i in ClsStorage.selectedMembersList)
                {
                    string name = ClsStorage.currentClub.GetFormattedName(i);
                    string selectedTermName = cbTerm.Text;
                    ClsStorage.currentClub.AddHistory(String.Format("{0}@{1}", name, selectedTermName), ChangeType.AddToTerm);
                }

                /* display our additions on the form */
                lvAttendance.BeginUpdate();

                List<ListViewItem> attendanceList = new List<ListViewItem>();
                int lastRehearsal = ClsStorage.currentClub.listTerms[iTerm].recentRehearsal(DateTime.Today);
                foreach (int i in ClsStorage.selectedMembersList) {
                    int memberTermID = ClsStorage.currentClub.listTerms[iTerm].memberSearch((short)i);
                    loadMemberToAttendanceList(attendanceList, iTerm, memberTermID, lastRehearsal);
                }
                lvAttendance.Items.AddRange(attendanceList.ToArray());
                lvAttendance.EndUpdate();

                if (Properties.Settings.Default.playSounds)
                    Sound.Success.Play();
            }
        }
Exemplo n.º 3
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            MemberList temp = new MemberList(true);
            switch(cbTo.SelectedIndex)
            {
                //To Individual Member
                case 0:
                    temp.ShowDialog();
                    //check if something was selected
                    if (ClsStorage.selectedMembersList.Count > 0)
                    {
                        if (Properties.Settings.Default.playSounds)
                            Sound.Click.Play();
                        EmailForm webDesign = new EmailForm(EmailPurpose.Send, -1, ClsStorage.selectedMembersList);
                        webDesign.ShowDialog();
                    }

                    break;
                //BCC Individual Member
                case 1:
                    temp.ShowDialog();
                    //check if something was selected
                    if (ClsStorage.selectedMembersList.Count > 0)
                    {
                        if (Properties.Settings.Default.playSounds)
                            Sound.Click.Play();
                        EmailForm webDesign = new EmailForm(EmailPurpose.Bcc, -1, ClsStorage.selectedMembersList);
                        webDesign.ShowDialog();
                    }
                    break;
                //all active members in current term
                case 2:
                    //clear the list
                    ClsStorage.selectedMembersList.Clear();

                    //now, add everyone in the term to it
                    for(int i = 0; i < ClsStorage.currentClub.listTerms[ClsStorage.currentClub.listTerms.Count-1].numMembers; i++)
                        if (!ClsStorage.currentClub.listTerms[ClsStorage.currentClub.listTerms.Count - 1].checkLimbo(i))
                            ClsStorage.selectedMembersList.Add(ClsStorage.currentClub.listTerms[ClsStorage.currentClub.listTerms.Count - 1].members[i]);

                    //check if something was selected
                    if (ClsStorage.selectedMembersList.Count > 0)
                    {
                        if (Properties.Settings.Default.playSounds)
                            Sound.Click.Play();
                        EmailForm webDesign = new EmailForm(EmailPurpose.Bcc, -1, ClsStorage.selectedMembersList);
                        webDesign.ShowDialog();
                    }

                    break;
                //all members in current term
                //similar idea to case 1 without the check
                case 3:
                    //clear the list
                    ClsStorage.selectedMembersList.Clear();

                    //now, add everyone in the term to it
                    for (int i = 0; i < ClsStorage.currentClub.listTerms[ClsStorage.currentClub.listTerms.Count - 1].numMembers; i++)
                        ClsStorage.selectedMembersList.Add(ClsStorage.currentClub.listTerms[ClsStorage.currentClub.listTerms.Count - 1].members[i]);

                    //check if something was selected
                    if (ClsStorage.selectedMembersList.Count > 0)
                    {
                        if (Properties.Settings.Default.playSounds)
                            Sound.Click.Play();
                        EmailForm webDesign = new EmailForm(EmailPurpose.Bcc, -1, ClsStorage.selectedMembersList);
                        webDesign.ShowDialog();
                    }

                    break;
                //To Entire Mailing List
                case 4:
                    //check if something was selected
                    if (Properties.Settings.Default.playSounds)
                        Sound.Click.Play();
                    EmailForm massEmailMaker = new EmailForm(EmailPurpose.MassEmail);
                    massEmailMaker.ShowDialog();
                    break;
            }
        }