Exemple #1
0
        public IActionResult Index()
        {
            var        pendingDeliveries    = deliveryService.PendingDeliveryList().GroupBy(q => q.Order.HiddenPKId);
            var        successfulDeliveries = deliveryService.CountDeliveries().GroupBy(q => q.Order.HiddenPKId);
            var        pendingReturnRefunds = orderService.PendingReturnRefundList().GroupBy(q => q.Order.HiddenPKId);
            var        cancelledOrders      = deliveryService.CountCancelledfromDeliverables().GroupBy(q => q.Order.HiddenPKId);
            DeliveryVM deliveryVM           = new DeliveryVM()
            {
                TotalPendingDeliveryVMCount     = pendingDeliveries.Count(),
                TotalDeliveryVMCount            = successfulDeliveries.Count(),
                TotalPendingReturnRefundVMCount = pendingReturnRefunds.Count(),
                TotalCancelledOrderVMCount      = cancelledOrders.Count()
            };

            return(View(deliveryVM));
        }