Beispiel #1
0
 public ActionResult ShowHistory(int contributorId, int? simchaId)
 {
     SimchaFundManager manager = new SimchaFundManager(Properties.Settings.Default.ConStr);
     ShowHistoryViewModel model = new ShowHistoryViewModel();
     string firstName = manager.GetContributors(contributorId).FirstOrDefault(c => c.Id == contributorId).FirstName;
     string lastName = manager.GetContributors(contributorId).FirstOrDefault(c => c.Id == contributorId).LastName;
     model.ContributorName = firstName + " " + lastName;
     model.Balance = manager.GetBalance(contributorId);
     model.History = manager.GetDeposits(contributorId).Select(d => new ShowHistoryProperties
     {
         Name = "Deposit",
         Date = d.Date,
         Amount = d.Amount,
     }).Concat(manager.GetSimchaAndContributors(contributorId, simchaId).Select(s => new ShowHistoryProperties
      {
          Name = "Contribution To The " + manager.GetASimchas(s.SimchaId).Name + " Simcha",
          Date = s.Date,
          Amount = s.Contribution,
      })).OrderByDescending(h => h.Date);
     return View(model);
 }