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)); }
public IActionResult Index() { var vm = new SimchaViewModel { Simchos = mgr.GetSimchas(), TotalContributors = mgr.GetTotalContributors(), Message = (string)TempData["message"] }; return(View(vm)); }
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)); }