Exemple #1
0
 public static WidgetItemListDTO Entity2WidgetItemListDto(this USER_ItemToken entity, bool isItemOwner, List <PriceLineDTO> itemPrices)
 {
     return(new WidgetItemListDTO
     {
         ItemID = entity.ItemId
         , ItemName = entity.ItemName
         , ItemType = (BillingEnums.ePurchaseItemTypes)entity.ItemTypeId
         , AuthorName = entity.Entity2AuthorFullName()
         , AuthorID = entity.AuthorId
         , ImageURL = entity.ImageURL.ToThumbUrl(Constants.ImageBaseUrl)
         , NumSubscribers = entity.NumSubscribers
         , Rating = entity.Rating
         , IsFree = entity.IsFreeCourse ?? false
         , ItemUrlName = entity.UrlName
         , IsItemOwner = isItemOwner
         , CoursesCnt = entity.CoursesCnt
         , ItemPrices = itemPrices
     });
 }
Exemple #2
0
        public static ItemListDTO UserItemEntity2ItemListDto(this USER_ItemToken entity)
        {
            var type = Utils.ParseEnum <BillingEnums.ePurchaseItemTypes>(entity.ItemTypeId.ToString());

            return(new ItemListDTO
            {
                ItemId = entity.ItemId
                , ItemName = entity.ItemName
                , ItemType = type
                , Description = entity.ItemDescription
                , AuthorName = entity.Entity2AuthorFullName()
                , AuthorId = entity.AuthorId
                , Price = entity.Price
                , MonthlySubscriptionPrice = entity.MonthlySubscriptionPrice
                , AffiliateCommission = entity.AffiliateCommission
                , Status = Utils.ParseEnum <CourseEnums.CourseStatus>(entity.StatusId)
                , ItemPageUrl = type == BillingEnums.ePurchaseItemTypes.COURSE ? entity.GenerateCoursePageUrl(entity.Entity2AuthorFullName(), entity.ItemName, null) : entity.GenerateBundlePageUrl(entity.Entity2AuthorFullName(), entity.ItemName, null)
                , SubscribersCount = entity.NumSubscribers
                , AddOn = entity.Created
                , IsFree = entity.IsFreeCourse ?? true
            });
        }
Exemple #3
0
 public static string Entity2AuthorFullName(this USER_ItemToken entity)
 {
     return(CombineFullName(entity.AuthorFirstName, entity.AuthorLastName, entity.AuthorNickname));
 }