Пример #1
0
        public ActionResult Index()
        {
            Manager         mgr = new Manager(Properties.Settings.Default.ConStr);
            SimchaViewModel vm  = new SimchaViewModel();

            vm.Simchas = mgr.GetAllSimchas();
            vm.Count   = mgr.GetContributorCount();
            vm.Message = (string)TempData["Message"];
            return(View(vm));
        }
Пример #2
0
        public IActionResult Index()
        {
            var vm = new SimchaViewModel
            {
                Simchos           = mgr.GetSimchas(),
                TotalContributors = mgr.GetTotalContributors(),
                Message           = (string)TempData["message"]
            };

            return(View(vm));
        }
Пример #3
0
        public ActionResult Index()
        {
            var simchas         = DB.GetAllSimchas();
            var simchaViewModel = new List <SimchaViewModel>();

            foreach (Simcha s in simchas)
            {
                SimchaViewModel svm = new SimchaViewModel();
                svm.Simcha           = s;
                svm.Simcha.Total     = DB.Total(s.Id);
                svm.ContributorCount = DB.GetContibutorsCountForSimcha(s.Id);
                simchaViewModel.Add(svm);
            }
            IndexViewModel VM = new IndexViewModel
            {
                Count = DB.GetContibutorsCount(),
                svm   = simchaViewModel
            };

            return(View(VM));
        }