Exemple #1
0
        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));
        }
Exemple #4
0
        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);
        }
Exemple #5
0
 public ActionResult <IEnumerable <ShipperQueryDto> > Get()
 {
     return(Ok(ShipperService.GetAll()));
 }
Exemple #6
0
 public ActionResult ShipperList()
 {
     return(View(_shipperService.GetAll()));
 }
Exemple #7
0
        public IActionResult GetAll()
        {
            var query = _shipperService.GetAll();

            return(new OkObjectResult(query));
        }
Exemple #8
0
 // GET: Shippers
 public async Task <IActionResult> Index()
 {
     return(View(await _shipperService.GetAll()));
 }
Exemple #9
0
 // GET: Orders/Create
 public async Task <IActionResult> Create()
 {
     ViewData["ShipperID"] = new SelectList(await _shippersService.GetAll(), "ShipperID", "CompanyName");
     return(View());
 }