public ActionResult GetBoxesByRouteID(Guid routeID) { try { var boxesVM = _boxService.GetBoxesStockParents(routeID); var boxes = boxesVM.GroupBy(n => n.BoxTypeID) .Select(g => new { DT_RowId = g.Key, BoxType = g.Select(x => x.BoxType.Name).FirstOrDefault(), SrcPicture = g.Select(x => x.BoxType.Picture.SrcBase64Image).FirstOrDefault(), TotalBox = g.Count() } ).ToList(); return(Json(new { aaData = boxes, success = true })); } catch (Exception ex) { throw ex; } }
public IEnumerable <BoxVM> GetBoxesStockParents(Guid routeID) { var boxesVM = _boxApplicationService.GetBoxesStockParents(routeID); return(boxesVM); }