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)); }
public IEnumerable <SalesPersons> GetSalesPersons() { return(_salesPersonRepository.GetAll()); }
public List <SalesPerson> Handle(GetAllSalesPersonsQuery query) { return(_repository.GetAll()); }