public IActionResult GetAjaxHandlerBoxes() { try { var boxesVM = _boxApplicationService.GetAll(); return(Json(new { aaData = boxesVM, success = true })); } catch (Exception ex) { throw ex; } }
public IActionResult Create() { var boxes = _boxApplicationService.GetAll() .Select(box => new SelectListItem { Value = box.DT_RowId, Text = $"{box.BoxBarcode.BarcodeEAN13} - {box.Description }" }).ToList(); var productsItems = _productApplicationService.GetProductsItems() .Select(prod => new SelectListItem { Value = prod.DT_RowId, Text = $"{prod.Barcode} - {prod.Product.Name }" }).ToList(); var trackingsTypes = _boxTrackingApplicationService.GetAllTrackingsTypes() .Select(trace => new SelectListItem { Value = trace.DT_RowId, Text = trace.Description }).ToList(); var clients = _clientApplicationService.GetAll() .Select(client => new SelectListItem { Value = client.DT_RowId, Text = client.Name }).ToList(); ViewData["Clients"] = clients; ViewData["Boxes"] = boxes; ViewData["ProductsItems"] = productsItems; ViewData["TrackingTypes"] = trackingsTypes; return(View()); }