// GET: Profile/FinancialSummary public ActionResult Index() { var summary = FinancialSummary.GetFinancialSummary(CPProfile.Cid, CPProfile.ElectionCycle); var candidate = CPProfile.ActiveCandidate; var election = CPProfile.Election; return(View(ProfileViewModelFactory.FinancialSummaryFrom(summary, candidate, election))); }
public void GetFinancialSummaryTest() { string candidateID = string.Empty; // TODO: Initialize to an appropriate value string electionCycle = string.Empty; // TODO: Initialize to an appropriate value FinancialSummary expected = null; // TODO: Initialize to an appropriate value FinancialSummary actual; actual = FinancialSummary.GetFinancialSummary(candidateID, electionCycle); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!Page.IsPostBack) { ActiveCandidate ac = CPProfile.ActiveCandidate; if (ac != null) { // general candidate information this.CandidateName.Text = string.Format("{0} (ID: {1})", ac.Name, ac.ID); if (ac.Office != null) { this.OfficeLabel.Text = ac.Office.ToString(); } this.ClassificationLabel.Text = CPConvert.ToString(ac.Classification); Election ec = CPApplication.Elections[CPProfile.ElectionCycle]; if (ec != null) { FinancialSummary fs = FinancialSummary.GetFinancialSummary(CPProfile.Cid, CPProfile.ElectionCycle); if (fs != null) { Statement lastStatement; if (ec.Statements.TryGetValue(fs.LastStatementSubmitted, out lastStatement)) { // receipts this.NetContributionsLabel.Text = FormatCurrency(fs.NetContributions); } this.NumberOfContributorsLabel.Text = string.Format("{0:N0}", fs.ContributorCount); this.MiscellaneousReceiptsLabel.Text = FormatCurrency(fs.MiscellaneousReceipts); this.MatchingClaimsLabel.Text = FormatCurrency(fs.MatchingClaims); this.LoansReceivedLabel.Text = FormatCurrency(fs.LoansReceived); // disbursements this.NetExpendituresLabel.Text = FormatCurrency(fs.NetExpenditures); this.LoansPaidLabel.Text = FormatCurrency(fs.LoansPaid); this.OustandingBillsLabel.Text = FormatCurrency(fs.OutstandingBills); if (!_isTIE) { this.PublicFundsReceivedLabel.Text = FormatCurrency(fs.PublicFundsReceived); this.PublicFundsReturnedLabel.Text = FormatCurrency(fs.PublicFundsReturned); } } if (_isTIE) { FSClassificationCol.Visible = FSClassificationHeader.Visible = FSClassificationCell.Visible = false; ContributorsPanel.CssClass = null; } } } } }