Exemple #1
0
        private void GetReturnCounts(WorkDay workDay)
        {
            DateTime lowLimit  = workDay.Date;
            DateTime highLimit = workDay.Date.AddDays(1);

            var transactions = _dataContext.Transactions.Where(p => p.Time >= lowLimit && p.Time <= highLimit);

            var returns = transactions.Where(p => p.Customer.LastName.Equals("INTERNET RETURNS")).SelectMany(p => p.TransactionEntries);

            if (returns.Count() > 0)
            {
                workDay.ItemReturned = returns.GroupBy(p => p.ItemID).Count();
                workDay.QtyReturned  = returns.Sum(p => p.Quantity) * -1;
            }
        }
Exemple #2
0
        private void GetReceivedCounts(WorkDay workDay)
        {
            DateTime lowLimit  = workDay.Date;
            DateTime highLimit = workDay.Date.AddDays(1);

            var entryGroups = _dataContext.PurchaseOrderEntries
                              .Where(p => p.LastReceivedDate.HasValue && p.LastReceivedDate.Value >= lowLimit && p.LastReceivedDate.Value <= highLimit)
                              .GroupBy(p => p.ItemID);

            if (entryGroups.Count() > 0)
            {
                workDay.ItemReceived = entryGroups.Count();
                workDay.QtyReceived  = entryGroups.Sum(p => p.Sum(s => s.LastQuantityReceived));
            }
        }
Exemple #3
0
        private void GetPictureCounts(WorkDay workDay)
        {
            double pictureCount = 0;
            double productCount = 0;

            foreach (DirectoryInfo dirInfo in _dirs)
            {
                if (dirInfo.LastWriteTime > workDay.Date)
                {
                    var fileGroups = dirInfo.GetFiles().Where(p => p.LastWriteTime.Date.Equals(workDay.Date)).GroupBy(p => p.Name.Split(new Char[1] {
                        '-'
                    })[0].Replace(".jpg", ""));

                    productCount += fileGroups.Count();
                    pictureCount += fileGroups.Sum(s => s.Count());
                }
            }

            workDay.QtyPhotographed   = pictureCount;
            workDay.ModelPhotographed = productCount;
        }
Exemple #4
0
        private void GetShippingCounts(WorkDay workDay)
        {
            DateTime lowLimit  = workDay.Date;
            DateTime highLimit = workDay.Date.AddDays(1);

            var transactions = _dataContext.Transactions.Where(p => p.Time >= lowLimit && p.Time <= highLimit);

            var onlineTransactions = transactions.Where(p =>
                                                        p.Customer.LastName.Equals("ONE MILLION SHOES") ||
                                                        p.Customer.LastName.Equals("SMALL AVENUE") ||
                                                        p.Customer.LastName.Equals("SHOESTOGO24/7") ||
                                                        p.Customer.LastName.Equals("AMAZON US")).SelectMany(p => p.TransactionEntries);


            var entryGroups = onlineTransactions.GroupBy(p => p.ItemID);

            if (onlineTransactions.Count() > 0)
            {
                workDay.ItemShipped = onlineTransactions.GroupBy(p => p.ItemID).Count();
                workDay.QtyShipped  = onlineTransactions.Sum(p => p.Quantity);
            }
        }
Exemple #5
0
 private void GetPublishedCounts(WorkDay workDay)
 {
     DateTime lowLimit  = workDay.Date;
     DateTime highLimit = workDay.Date.AddDays(1);
 }