This is the .Net Framework(C#) Windows Forms App which you can create teams, team colors, players and played/unplayed matches. Also it creates database and tables with Entity Framework Code First. You should just change connection strings for your database.
You can see played matches and matches which will play.
You can create colors in this screen.
You can add teams and edit in this screen. Also see 5 of colors of selected team. If you want to arrange players of team, you should open Team Players screen with button.
You can add players and edit in this screen.
You can create or edit matches in this screen. Creating :
Editing:
if (btnAddTeam.Text == "Add Team")
{
if (!string.IsNullOrEmpty(txtTeamName.Text) && chklstColors.CheckedItems.Count > 0)
{
Team newTeam = new Team { TeamName = txtTeamName.Text };
_db.Teams.Add(newTeam);
foreach (var item in chklstColors.CheckedItems)
{
newTeam.Colors.Add((Models.Color)item);
}
_db.SaveChanges();
lstTeamsUpdate();
FormClean();
}
else
{
MessageBox.Show("You should enter Team Name and check one color at least.");
}
}
if (btnAddTeam.Text == "Save Team")
{
if (!string.IsNullOrEmpty(txtTeamName.Text) && chklstColors.CheckedItems.Count > 0)
{
Team selectedTeam = (Team)lstTeams.SelectedItem;
selectedTeam.TeamName = txtTeamName.Text;
selectedTeam.Colors.Clear();
foreach (var item in chklstColors.CheckedItems)
{
selectedTeam.Colors.Add((Models.Color)item);
}
_db.SaveChanges();
lstTeamsUpdate();
FormClean();
lstTeams.Enabled = true;
groupBox1.Text = "Add Team";
groupBox1.BackColor = System.Drawing.Color.Transparent;
btnAddTeam.Text = "Add Team";
btnDelete.Enabled = true;
btnPlayers.Enabled = true;
}
else
{
MessageBox.Show("You should enter Team Name and check one color at least.");
}
}