Before implementing save to textfiles
This commit is contained in:
@ -41,7 +41,7 @@ namespace TrackerUI
|
||||
private void addTeamButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
TeamModel t = (TeamModel)selectTeamDropDown.SelectedItem;
|
||||
if(t != null)
|
||||
if (t != null)
|
||||
{
|
||||
availableTeams.Remove(t);
|
||||
selectedTeams.Add(t);
|
||||
@ -104,6 +104,32 @@ namespace TrackerUI
|
||||
|
||||
private void createTournamentButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
//Validate data
|
||||
decimal fee = 0;
|
||||
bool feeAcceptable = decimal.TryParse(entryFeeValue.Text, out fee);
|
||||
if (!feeAcceptable)
|
||||
{
|
||||
MessageBox.Show("You need to enter a valid Entry Fee.",
|
||||
"Invalid Fee",
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
// Create our tournament model
|
||||
TournamentModel tm = new TournamentModel();
|
||||
|
||||
tm.TournamentName = tournamentNameValue.Text;
|
||||
tm.EntryFee = fee;
|
||||
tm.Prizes = selectedPrizes;
|
||||
tm.EnteredTeams = selectedTeams;
|
||||
|
||||
// Wireup our matchups
|
||||
|
||||
// Finally create the tournament entry
|
||||
// Create all of the prizes entries
|
||||
// Create all of team entries
|
||||
GlobalConfig.Connection.CreateTournament(tm);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ namespace TrackerUI
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
// Initialize the database connections
|
||||
GlobalConfig.InitializeConnections(DatabaseType.TextFile);
|
||||
GlobalConfig.InitializeConnections(DatabaseType.Sql);
|
||||
Application.Run(new CreateTournamentForm());
|
||||
|
||||
//Application.Run(new TournamentDashboardForm());
|
||||
|
||||
Reference in New Issue
Block a user