public MatchWIndow(Match _match = null)
        {
            InitializeComponent();

            context = new GAA_Templates_ModelContainer();
            matchViewContext = new MatchView(context);

            match = _match;

            if (match != null)
            {
                update = false;
                //loadMatchDetails();
            }
            else
                update = true;

            homeAndAwayTeamComboboxes = new ComboBox[2];

            homeAndAwayTeamComboboxes[0] = this.homeTeamComboBox;
            homeAndAwayTeamComboboxes[1] = this.awayTeamComboBox;

            bindClassificationsToComboBox(this.classificationComboBox);
            bindCountiesToComboBox(this.countiesComboBox);

            toggleCountyComboBox();
        }
        public CountyWindow(bool _update = false)
        {
            InitializeComponent();

            update = _update;

            context = new GAA_Templates_ModelContainer();
            countyViewContext = new CountyView(context);

            bindProvincesToComboBox();
        }
        public VenueWindow(bool _update = false)
        {
            InitializeComponent();

            update = _update;

            context = new GAA_Templates_ModelContainer();
            venueViewContext = new VenueView(context);

            bindCountiesToComboBox();
        }
        public PlayerWindow(bool _update = false)
        {
            InitializeComponent();

            update = _update;
            context = new GAA_Templates_ModelContainer();
            teamViewContext = new TeamView(context);
            countyViewContext = new CountyView(context);
            playerViewContext = new PlayerView(context);
            loadTestData();
            addEventHandlers();
        }
        static void Main()
        {
            Competition comp;

            using (GAA_Templates_ModelContainer context = new GAA_Templates_ModelContainer())
            {
                comp = context.Competitions
                    .Include("County")
                    .Where(c => c.Name == "Senior Championship")
                    .FirstOrDefault();
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MatchWIndow());
        }
        public CompetitionWindow(Competition _competition = null)
        {
            InitializeComponent();

            competition = _competition;

            if (competition != null)
            {
                update = true;
                loadCompetitionDetails(competition);
            }
            else
                update = false;

            context = new GAA_Templates_ModelContainer();
            competitionViewContext = new CompetitionView(context);

            bindCountiesToComboBox();
        }
 public PlayerView(GAA_Templates_ModelContainer _context)
 {
     context = _context;
 }
 public VenueView(GAA_Templates_ModelContainer _context)
 {
     context = _context;
 }
 public MatchView(GAA_Templates_ModelContainer _context)
 {
     context = _context;
 }
 public CountyView(GAA_Templates_ModelContainer _context)
 {
     context = _context;
 }
 public CompetitionView(GAA_Templates_ModelContainer _context)
 {
     context = _context;
 }
        private void saveButton_Click(object sender, EventArgs e)
        {
            if (checkEntriesAreValid())
            {
                CountyTeam ctyTm;
                ClubTeam club;

                if (this.countyPlayerCheckBox.Checked)
                    ctyTm = GetCountyTeam(this.countyComboBox.Text);
                else
                    ctyTm = null;

                using (GAA_Templates_ModelContainer _context = new GAA_Templates_ModelContainer())
                {
                    club = GetClub(this.clubComboBox.Text, GetCounty(this.countyComboBox.Text));
                }

                if (update)
                {
                    UpdatePlayer(this.firstNameTextBox.Text, this.lastNameTextBox.Text, this.obsoleteCheckBox.Checked,
                        ctyTm, club);
                }
                else
                {
                    CreatePlayer(this.firstNameTextBox.Text, this.lastNameTextBox.Text, this.obsoleteCheckBox.Checked,
                        ctyTm, club);
                }

                this.DialogResult = DialogResult.OK;

                this.Close();
            }
        }