Ejemplo 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());
        }
Ejemplo 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());
        }
Ejemplo 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());
        }
Ejemplo n.º 4
0
 public double TotalPerVisit(Core.Visit visit)
 {
     return(calc.TotalPerVisit(visit));
 }