Exemple #1
0
        // If class is selected from list, loads results form, closes current;
        private void ViewResults(object sender, EventArgs e)
        {
            if (showListBox.SelectedItems.Count != 0)
            {
                int showNo = -1;

                if (AbandonChanges())
                {
                    string selectedShow = showListBox.SelectedItems[0].ToString();
                    selectedShow = selectedShow.Substring(15, 10);
                    foreach (ShowItem entry in ActiveClass.ShowList)
                    {
                        string dateString = entry.Date.ToString("MM/dd/yyyy");
                        if (dateString == selectedShow)
                        {
                            showNo = entry.No;
                            break;
                        }
                    }
                }
                if (showNo >= 0)
                {
                    ResultListForm classForm = new ResultListForm(ActiveClass.ClubID, ActiveClass.Year, showNo, ActiveClass.Number);
                    //classForm.FormClosing += new FormClosingEventHandler(this.RefreshOnClose);
                    classForm.Visible = true;
                    this.Close();
                }
            }

            if (showListBox.Items.Count == 0)
            {
                this.viewResultBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.viewResultBtn.ForeColor = System.Drawing.SystemColors.GrayText;
            }
            else
            {
                this.viewResultBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.viewResultBtn.ForeColor = System.Drawing.SystemColors.ControlText;
            }
        }
Exemple #2
0
        private void prevBtn_Click(object sender, EventArgs e)
        {
            if(!IsFirst)
            {
                bool loadNew = true;

                if (IsChanged)
                    loadNew = AbandonChanges();
                if (loadNew)
                {
                    ResultListForm classInstance = new ResultListForm(ActiveResults.ClubID,
                        ActiveResults.Year, ActiveResults.ShowNo, ActiveResults.GetPrev());
                    classInstance.Visible = true;
                    this.Close();
                }
            }
        }
Exemple #3
0
        private void viewClassBtn_Click(object sender, EventArgs e)
        {
            if (classListBox.SelectedItems.Count != 0)
            {
                bool loadNew = true;
                int classNo = -1;

                if (IsChanged)
                    loadNew = AbandonChanges();
                if (loadNew)
                    classNo = Convert.ToInt32(classListBox.SelectedItems[0].Text);

                if (classNo >= 0)
                {
                    ResultListForm classInstance = new ResultListForm(ActiveResults.ClubID,
                        ActiveResults.Year, ActiveResults.ShowNo, classNo);
                    classInstance.Visible = true;
                    this.Close();
                }
            }
        }
Exemple #4
0
        // If class selected, launches results form for current show and selected class.
        private void ViewResults(object sender, EventArgs e)
        {
            if (classListBox.SelectedItems.Count != 0)
            {
                int selectedClass = -1;

                if (AbandonChanges())
                    selectedClass = Convert.ToInt32(classListBox.SelectedItems[0].Text);

                if (selectedClass >= 0)
                {
                    ResultListForm classForm = new ResultListForm(ActiveShow.ClubID, ActiveShow.Year, ActiveShow.Number, selectedClass);
                    classForm.Visible = true;
                    this.Close();
                }
            }
        }