Exemple #1
0
        public IActionResult AddDeposit(Deposit deposit)
        {
            var db = new SimchaFundDb(_connectionString);

            db.AddDeposit(deposit);
            return(Redirect("/home/contributors"));
        }
Exemple #2
0
        public IActionResult AddContributorAndDeposit(Contributor contributor, int amount)
        {
            var db            = new SimchaFundDb(_connectionString);
            int contributorId = db.AddContributor(contributor);
            var deposit       = new Deposit
            {
                ContributorId = contributorId,
                Amount        = amount,
                Date          = DateTime.Today
            };

            db.AddDeposit(deposit);
            return(Redirect("/home/contributors"));
        }