public IActionResult Contributors() { var vm = new ContributorViewModel(); var db = new SimchaFundDb(_connectionString); vm.Contributors = db.GetContributors(); return(View(vm)); }
public IActionResult Contributions(int simchaId) { SimchaFundDb db = new SimchaFundDb(_connectionString); ContributionsViewModel vm = new ContributionsViewModel { Contributors = db.GetContributors(), Simcha = db.GetSimcha(simchaId), Counter = 0, contribForSimcha = db.GetIdsForContributed(simchaId) }; return(View(vm)); }
public IActionResult Index() { SimchaFundDb db = new SimchaFundDb(_connectionString); ContributorsViewModel vm = new ContributorsViewModel { Contributors = db.GetContributors() }; if (!string.IsNullOrEmpty((string)TempData["message"])) { ViewBag.Message = (string)TempData["message"]; } return(View(vm)); }
public IActionResult Contributions(int id) { var db = new SimchaFundDb(_connectionString); ContributionsViewModel vm = new ContributionsViewModel { Simcha = db.GetSimchaById(id), Contributors = db.GetContributors() }; foreach (var contributor in vm.Contributors) { db.SetContributionAmountForContributorForSimcha(vm.Simcha.Id, contributor); } return(View(vm)); }