public IActionResult Deposit(Deposit deposit) { SFundDb db = new SFundDb(_connectionString); db.AddDeposit(deposit); return(Redirect("/Contributors/Index")); }
public IActionResult New(Simcha simcha) { SFundDb db = new SFundDb(_connectionString); db.AddSimcha(simcha); return(Redirect("/Home/Index")); }
public IActionResult Edit(Contributor contributor) { SFundDb db = new SFundDb(_connectionString); db.EditContributor(contributor); return(Redirect("/Contributors/Index")); }
public IActionResult Index() { SFundDb db = new SFundDb(_connectionString); ContributionsViewModel vm = new ContributionsViewModel(); vm.Contributors = db.GetContributors(); return(View(vm)); }
public IActionResult Contributions(int Id) { SFundDb db = new SFundDb(_connectionString); ContributionsViewModel vm = new ContributionsViewModel(); vm.Simcha = db.GetSimcha(Id); vm.Contributors = db.GetContributors(); vm.SimchaContributions = db.GetContributions().Where(c => c.SimchaId == Id).ToList(); return(View(vm)); }
public IActionResult Index() { SFundDb db = new SFundDb(_connectionString); SimchasViewModel vm = new SimchasViewModel(); vm.Simchas = db.GetSimchas(); vm.ContributorCount = db.GetContributors().Count; vm.Contributions = db.GetContributions(); return(View(vm)); }
public IActionResult History(int id) { SFundDb db = new SFundDb(_connectionString); ContributorHistoryViewModel vm = new ContributorHistoryViewModel(); List <Transaction> transactions = db.GetDeposits(id); if (db.GetContributions(id) != null) { transactions.AddRange(db.GetContributions(id)); } vm.Transactions = transactions; vm.Contributor = db.GetContributor(id); return(View(vm)); }
public IActionResult New(Contributor contributor, int amount, DateTime createdDate) { SFundDb db = new SFundDb(_connectionString); db.AddContributor(contributor); Deposit deposit = new Deposit { ContributorId = contributor.Id, Date = createdDate, Amount = amount }; db.AddDeposit(deposit); return(Redirect("/Contributors/Index")); }
public IActionResult UpdateContributions(List <Contribution> contributions) { SFundDb db = new SFundDb(_connectionString); db.ClearContributions(contributions[0].SimchaId); foreach (var contribution in contributions) { if (contribution.AddContributionId == contribution.ContributorId) { db.AddContribution(contribution); } } return(Redirect("/Home/Index")); }