public async Task <ActionResult> Create()
        {
            var vm = new CreateOrderViewModel()
            {
                Products = (await _productRepo.GetAll())
                           .Select(p => new SelectListItem()
                {
                    Text = $"{p.ProductName} - {p.Variety}", Value = p.ProductCode
                }).ToList(),
                Customers = (await _customerRepo.GetAll())
                            .Select(c => new SelectListItem()
                {
                    Text = $"{c.FirstName} {c.LastName}", Value = c.Id.ToString()
                }).ToList(),
                SalesPeople = (await _salesRepo.GetAll())
                              .Select(s => new SelectListItem()
                {
                    Text = $"{s.FirstName} {s.LastName}", Value = s.Id.ToString()
                }).ToList()
            };

            return(View(vm));
        }
Exemple #2
0
 public IEnumerable <SalesPersons> GetSalesPersons()
 {
     return(_salesPersonRepository.GetAll());
 }
Exemple #3
0
 public List <SalesPerson> Handle(GetAllSalesPersonsQuery query)
 {
     return(_repository.GetAll());
 }