public static WebStoreAffiliateItemDTO Entity2AffiliateItemDto(this WS_AffiliateItemToken entity) { var type = Utils.ParseEnum <BillingEnums.ePurchaseItemTypes>(entity.LineType); var token = new WebStoreAffiliateItemDTO { ItemId = entity.ItemId , WebStoreItemId = entity.WebstoreItemId , ItemName = entity.ItemName , ItemType = type , ItemTypeName = Utils.GetEnumDescription(type) , Price = entity.Price , MonthlySubscriptionPrice = entity.MonthlySubscriptionPrice , StoreOwner = new BaseUserInfoDTO { UserId = entity.OwnerUserID , FullName = entity.Entity2StoreOwnerFullName() } , Author = new BaseUserInfoDTO { UserId = entity.AuthorId , FullName = entity.Entity2AuthorFullName() } , WebStore = new BaseWebStoreDTO { StoreId = entity.StoreID , TrackingID = entity.TrackingID , Name = entity.StoreName } , WebStoreCategory = new BaseWebStoreCategoryDTO { WebStoreCategoryId = entity.WebStoreCategoryID , CategoryName = entity.CategoryName } }; token.ItemUrl = Utils.GetKeyValue("baseUrl") + entity.GenerateStoreItemPageUrl(token.Author.FullName, token.ItemName.OptimizedUrl(), token.WebStoreCategory.CategoryName.OptimizedUrl(), token.WebStore.TrackingID).Remove(0, 1); return(token); }
public static string Entity2AuthorFullName(this WS_AffiliateItemToken entity) { return(CombineFullName(entity.AuthorFirstName, entity.AuthorLastName, entity.AuthorNickName)); }
public static string Entity2StoreOwnerFullName(this WS_AffiliateItemToken entity) { return(CombineFullName(entity.OwnerFirstName, entity.OwnerLastName, entity.OwnerNickName)); }