Example #1
0
        private MP_TeraPeakOrderItem CreateOrderItem(MP_TeraPeakOrder order, TeraPeakDatabaseSellerDataItem orderItem)
        {
            var mpTeraPeakOrderItem = new MP_TeraPeakOrderItem {
                Order                = order,
                Bids                 = orderItem.Bids,
                ItemsOffered         = orderItem.ItemsOffered,
                ItemsSold            = orderItem.ItemsSold,
                Listings             = orderItem.Listings,
                Revenue              = orderItem.Revenue,
                SuccessRate          = orderItem.SuccessRate,
                Successful           = orderItem.Successful,
                AverageSellersPerDay = orderItem.AverageSellersPerDay,
                Transactions         = orderItem.Transactions,
                StartDate            = orderItem.StartDate,
                EndDate              = orderItem.EndDate,
                RangeMarker          = orderItem.RangeMarker
            };

            CreateCategoryStatistics(mpTeraPeakOrderItem, orderItem);

            return(mpTeraPeakOrderItem);
        }
Example #2
0
 private void CreateCategoryStatistics(MP_TeraPeakOrderItem mpTeraPeakOrderItem, TeraPeakDatabaseSellerDataItem orderItem)
 {
     foreach (var category in orderItem.Categories)
     {
         var tpCategory = GetOrCreateCategory(category.Category);
         var stat       = new MP_TeraPeakCategoryStatistics()
         {
             Category    = tpCategory,
             OrderItem   = mpTeraPeakOrderItem,
             ItemsSold   = category.ItemsSold,
             Listings    = category.Listings,
             Revenue     = category.Revenue,
             SuccessRate = category.SuccessRate,
             Successful  = category.Successful
         };
         mpTeraPeakOrderItem.CategoryStatistics.Add(stat);
     }
 }