Beispiel #1
0
        /// <summary>
        /// Opens up a AddDiveView form and waits for the result
        /// </summary>
        private void AddDive()
        {
            SubContestBranch subContestBranch = GetSelectedSubContest();

            Contestant contestant = GetSelectedContestant();

            AddDiveView addDiveView = new AddDiveView();

            AddDivePresenter addDivePresenter = new AddDivePresenter(addDiveView, window, subContestBranch, contestant);

            if (subContestBranch != null && contestant != null)
            {
                if (addDiveView.ShowDialog() == DialogResult.OK)
                {
                    UpdateDivesListView();
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Updates a existing dive with new information
        /// </summary>
        private void ModifyDive()
        {
            SubContestBranch subContestBranch = GetSelectedSubContest();

            Contestant contestant = GetSelectedContestant();

            Dive dive = GetSelectedDive();

            AddDiveView modifyView = new AddDiveView();

            AddDivePresenter presenter = new AddDivePresenter(modifyView, window, subContestBranch, contestant, dive);

            if (subContestBranch != null && contestant != null && dive != null)
            {
                if (modifyView.ShowDialog() == DialogResult.OK)
                {
                    subContestBranch.RemoveExistingDive(contestant, dive);

                    UpdateDivesListView();
                }
            }
        }