public ActionResult Create() { OrderListViewModel model = new OrderListViewModel() { Customers = new SelectList(_customerService.GetAll(), "CustomerID", "FirstName").ToList(), Payments = new SelectList(_paymentService.GetAll(), "PaymentID", "PaymentType").ToList(), Shippers = new SelectList(_shipperService.GetAll(), "ShipperID", "CompanyName").ToList(), Order = new Order() }; return(View(model)); }
// GET: Shipper public ActionResult Index() { ShipperListViewModel model = new ShipperListViewModel() { Shippers = _shipperService.GetAll() }; return(View(model)); }
public async Task <ActionResult <ShipperModel[]> > GetShippers() { var shippers = await _shipperService.GetAll(); if (shippers == null) { return(NotFound()); } return(_mapper.Map <ShipperModel[]>(shippers)); }
private List <SelectListItem> CreateSelectList(string[] selectedShipper = null) { var shippers = _shipperService.GetAll(); var list = new SelectList(shippers, "CompanyName", "CompanyName").ToList(); if (selectedShipper != null) { var select = list.Where(rol => selectedShipper.Contains(rol.Value)); foreach (var item in select) { item.Selected = true; } } return(list); }
public ActionResult <IEnumerable <ShipperQueryDto> > Get() { return(Ok(ShipperService.GetAll())); }
public ActionResult ShipperList() { return(View(_shipperService.GetAll())); }
public IActionResult GetAll() { var query = _shipperService.GetAll(); return(new OkObjectResult(query)); }
// GET: Shippers public async Task <IActionResult> Index() { return(View(await _shipperService.GetAll())); }
// GET: Orders/Create public async Task <IActionResult> Create() { ViewData["ShipperID"] = new SelectList(await _shippersService.GetAll(), "ShipperID", "CompanyName"); return(View()); }