Exemple #1
0
        public ActionResult BuyerList(string term)
        {
            var buyers = _buyerService.GetBuyers(new GetBuyersRequest
            {
                Skip = 0,
                Take = 20,
                Term = term,
            }).Buyers;

            return(Json(new { results = buyers }, JsonRequestBehavior.AllowGet));
        }
Exemple #2
0
        public IActionResult GetBuyer(int id, [FromServices] IBuyerService service)
        {
            Dto foundBuyer        = Wrapper.GetMapper.Map <Dto>(service.GetBuyer(id));
            var listOfAllBuyers   = service.GetBuyers();
            var fixedListOfBuyers = listOfAllBuyers
                                    .Except(foundBuyer.ElementAsList());

            foundBuyer.Buyers          = fixedListOfBuyers.ToList();
            foundBuyer.buyerInDropdown = $"{foundBuyer.Name} {foundBuyer.Surname}";
            return(View("Index", foundBuyer));
        }
Exemple #3
0
 public IActionResult Index([FromServices] IBuyerService service) =>
 View(new Dto {
     Buyers = service.GetBuyers()
 });