示例#1
0
        public IActionResult Contributors()
        {
            var vm = new ContributorViewModel();
            var db = new SimchaFundDb(_connectionString);

            vm.Contributors = db.GetContributors();
            return(View(vm));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }
示例#4
0
        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));
        }