private void saveButton_Click(object sender, EventArgs e) { if (validate()) { if (handle != null) { handle.Name = nameInput.Text; var repo = new TeamRepository(); repo.SaveOrUpdate(handle); DialogResult result = MetroMessageBox.Show(this, "Team updated!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); if (result == DialogResult.OK) { } } else { Team newTeam = new Team(); newTeam.Players = new List<Player>(); newTeam.Name = nameInput.Text; newTeam.Discipline = discipline; var repo = new TeamRepository(); repo.SaveOrUpdate(newTeam); DialogResult result = MetroMessageBox.Show(this, "Team created!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); if (result == DialogResult.OK) { } } } }
public APITeam(Team team) { this.Id = team.Id; this.Name = team.Name; this.Discipline = team.Discipline.Id; this.LogoURI = team.LogoURI; }
public TeamCreate(Discipline _discipline,Team _handle) { discipline = _discipline; handle = _handle; InitializeComponent(); nameInput.Text = handle.Name; MediaTypeNames.Text = "Update Team " + handle.Name; }
internal Team FromTeam(TeamResponse result) { var x = new Team(); var temp = result.Links.Self.Href.Split('/'); x.ApiId = Int32.Parse(temp[temp.Length - 1]); x.Name = result.Name; x.LogoURI = result.CrestUrl; return x; }
internal List<Team> FromLeaguesTeams(LeaguesTeamsResponse apiData) { List<Team> ret = new List<Team>(); foreach(var apiTeam in apiData.Teams) { var x = new Team(); var temp = apiTeam.Links.Self.Href.Split('/'); x.ApiId = Int32.Parse(temp[temp.Length - 1]); x.LogoURI = apiTeam.CrestUrl; x.Name = apiTeam.Name; x.UpdatedAt = new DateTime(2010,1,1); ret.Add(x); } return ret; }
public TeamShow(Team _handler) { handler = _handler; InitializeComponent(); MediaTypeNames.Text = handler.Name; Name = handler.Name; nameLabel.Text = handler.Name; homeMatchesGrid.DataSource = null; bindingSourceHome = new BindingSource(); bindingSourceHome.DataSource = handler.HomeMatches; homeMatchesGrid.DataSource = bindingSourceHome; awayMatchesGrid.DataSource = null; bindingSourceAway = new BindingSource(); bindingSourceAway.DataSource = handler.AwayMatches; awayMatchesGrid.DataSource = bindingSourceAway; playersGrid.DataSource = null; bindingSourcePlayers = new BindingSource(); bindingSourcePlayers.DataSource = handler.Players; playersGrid.DataSource = bindingSourcePlayers; }