/// <summary> /// Initializes the component. /// Sets the cap hit to the team cap hit. /// </summary> /// <param name="team"></param> public CapEditor(FranchiseDto franchise) { InitializeComponent(); lblCapData.Text = @"Cap Hit"; lblTeamName.Text = franchise.Name; uxCapHit.Value = Convert.ToDecimal(franchise.CapHit); }
/// <summary> /// Edits the cap hit of the current team. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void uxEditCapHit_Click(object sender, EventArgs e) { FranchiseDto franchise = _mflController.GetFranchiseInformation(FranchiseId); if (franchise != null) { CapEditor capEditor = new CapEditor(franchise); if (capEditor.ShowDialog() == DialogResult.OK) { franchise.CapHit = capEditor.CapData; SetTeam(); } } else { MessageBox.Show(@"Error - Invalid NFLTeam"); } }
/// <summary> /// Updates the cap information to reflect /// the information stored in the player database. /// </summary> private void SetTeam() { FranchiseDto franchise = _mflController.GetFranchiseInformation(FranchiseId); double capAvailable = _mflController.GetCapInformation() - franchise.Salary - franchise.CapHit; lblSalary.Text = $@"{franchise.Salary:C}"; lblCapHit.Text = $@"{franchise.CapHit:C}"; lblCapRoom.ForeColor = capAvailable < 0 ? Color.Red : SystemColors.ControlText; lblCapRoom.Text = $@"{_mflController.GetCapInformation() - franchise.Salary - franchise.CapHit:C}"; lblTeamName.Text = franchise.Name; franchise.Players.Sort(); uxCurrentRoster.DataSource = null; uxCurrentRoster.DataSource = franchise.Players; uxPlayers.ClearSelected(); uxCurrentRoster.ClearSelected(); }
public Task <FranchiseDto> Update(FranchiseDto franchise) { throw new NotImplementedException(); }
public Task <FranchiseDto> Insert(FranchiseDto franchise) { throw new NotImplementedException(); }