Esempio n. 1
0
        public IActionResult OnGet(int?visitid)
        {
            if (visitid == null)
            {
                return(RedirectToPage("/NotFound"));
            }

            Visit      = visitRepository.GetVisitById(visitid.Value);
            Visit.User = userManager.Users.SingleOrDefault();

            return(Page());
        }
Esempio n. 2
0
        public IActionResult OnGet()
        {
            Products = shopItemData.Products(SearchItem);
            Services = shopItemData.Services(SearchItem);

            Visit = new Core.Visit();

            if (Visit == null)
            {
                return(RedirectToPage("/NotFound"));
            }

            var list = userManager.Users.ToList().Select(x => new { Id = x.Id, Name = $"{x.FirstName} {x.LastName}" });

            Users = new SelectList(list, "Id", "Name");

            return(Page());
        }
Esempio n. 3
0
        public IActionResult OnPost(int?visitid)
        {
            if (ModelState.IsValid)
            {
                if (visitid.HasValue)
                {
                    Visit = visitRepository.GetVisitById(visitid.Value);
                }

                Visit = visitRepository.Update(Visit);

                visitRepository.Commit();
                return(RedirectToPage("./ShopList"));
            }

            Message = Visit.UserId == null ? "No customer selected!" : $"Total pay: {calc.TotalPerVisit(Visit)}";
            return(Page());
        }
Esempio n. 4
0
 public double TotalPerVisit(Core.Visit visit)
 {
     return(calc.TotalPerVisit(visit));
 }