public static WidgetItemListDTO Entity2CourseListDto(this vw_WS_Items entity, bool isItemOwner, List <PriceLineDTO> itemPrices) { return(new WidgetItemListDTO { ItemID = entity.ItemId , ItemName = entity.ItemName , ItemType = (BillingEnums.ePurchaseItemTypes)entity.ItemTypeId , AuthorName = entity.AuthorName , AuthorID = entity.AuthorID , ImageURL = entity.ImageURL , NumSubscribers = entity.NumSubscribers , Rating = entity.Rating , IsFree = entity.IsFreeCourse ?? false , ItemUrlName = entity.UrlName , IsItemOwner = isItemOwner , CoursesCnt = entity.CoursesCnt , ItemPrices = itemPrices }); }
public static WebStoreItemListDTO ItemEntity2WebStoreItemListDto(this vw_WS_Items entity, decimal?price, decimal?monthlySubscriptionPrice) { var type = Utils.ParseEnum <BillingEnums.ePurchaseItemTypes>(entity.ItemTypeId); return(new WebStoreItemListDTO { WebstoreItemId = entity.WebstoreItemId , WebStoreCategoryId = entity.WebStoreCategoryID , ItemId = entity.ItemId , ItemName = entity.ItemName.StoreItemName2DisplayName(type) , ItemType = type , Index = entity.Ordinal , AuthorName = entity.AuthorName , AuthorId = entity.AuthorID , Price = price , MonthlySubscriptionPrice = monthlySubscriptionPrice , AffiliateCommission = entity.AffiliateCommission , Description = entity.ItemDescription , Status = Utils.ParseEnum <CourseEnums.CourseStatus>(entity.ItemStatusId) , ItemPageUrl = type == BillingEnums.ePurchaseItemTypes.COURSE ? entity.GenerateCourseFullPageUrl(entity.AuthorName, entity.ItemName, entity.TrackingID) : entity.GenerateBundleFullPageUrl(entity.AuthorName, entity.ItemName, entity.TrackingID) }); }