Пример #1
0
        public IActionResult Index()
        {
            var homeViewModel = new HomeViewModel();

            homeViewModel.Doctors = _doctorRepository.AllDoctors;
            ViewBag.Title         = "Healthy Tooth";
            _visitSummary.ClearSummary();
            return(View(homeViewModel));
        }
Пример #2
0
        public IActionResult CheckVisit(Visit visit)
        {
            var items = _visitSummary.GetVisitSummaryItems();

            _visitSummary.VisitSummaryItems = items;

            if (_visitSummary.VisitSummaryItems.Count == 0)
            {
                ModelState.AddModelError("", "Add visit first!");
            }

            if (ModelState.IsValid)
            {
                _visitRepository.CreateVisit(visit);
                _visitSummary.ClearSummary();
                return(RedirectToAction("CheckVisitComplete"));
            }

            return(View(visit));
        }