Пример #1
0
        public static UserEventDTO Entity2UserEventDto(this vw_USER_EventsLog entity)
        {
            return(new UserEventDTO
            {
                EventId = entity.EventID
                , SessionId = entity.SessionId
                , UserId = entity.UserID
                , UserName = entity.GetUserName()
                , UserPhotoUrl = entity.Entity2PhotoUrl(Constants.ImageBaseUrl, Constants.DefaultAvatarUrl)
                , AspNetSessionId = entity.NetSessionId
                , IPAddress = entity.IPAddress
                , HostName = entity.HostName
                , HttpHeaders = entity.HttpHeaders
                , SessionDate = entity.SessionDate
                , EventType = entity.TypeName
                , AdditionalData = entity.AdditionalData.TrimString()
                , EventDate = entity.EventDate

                , ItemId = entity.CourseId ?? entity.BundleId
                , ItemName = entity.Entity2ItemName()
                , ItemPageUrl = entity.Entity2ItemPageUrl()
                , ItemAuthorName = entity.Entity2ItemAuthorFullName()

                , StoreId = entity.WebStoreId
                , StoreName = entity.StoreName
                , StoreOwnerName = entity.Entity2StoreOwnerFullName()
                , StoreUrl = entity.WixSiteUrl

                , BcIdentifier = entity.VideoBcIdentifier
                , VideoName = entity.VideoName
                , VideoAuthorName = entity.Entity2VideoAuthorFullName()
            });
        }
Пример #2
0
        private static string Entity2ItemAuthorFullName(this vw_USER_EventsLog entity)
        {
            if (entity.CourseId != null)
            {
                return(entity.Entity2CourseAuthorFullName());
            }

            if (entity.BundleId != null)
            {
                return(entity.Entity2BundleAuthorFullName());
            }

            return(string.Empty);
        }
Пример #3
0
        private static string Entity2ItemName(this vw_USER_EventsLog entity)
        {
            if (entity.CourseId != null)
            {
                return(entity.CourseName);
            }

            if (entity.BundleId != null)
            {
                return(entity.BundleName);
            }

            return(string.Empty);
        }
Пример #4
0
        private static string Entity2ItemPageUrl(this vw_USER_EventsLog entity)
        {
            if (entity.CourseId != null)
            {
                return(entity.GenerateCoursePageUrl(entity.Entity2CourseAuthorFullName(), entity.CourseName, entity.TrackingID));
            }

            if (entity.BundleId != null)
            {
                return(entity.GenerateBundlePageUrl(entity.Entity2BundleAuthorFullName(), entity.BundleName, entity.TrackingID));
            }

            return(string.Empty);
        }
Пример #5
0
 public static string Entity2PhotoUrl(this vw_USER_EventsLog entity, string imageBaseUrl, string defaultAvatarUrl)
 {
     return(GetPhotoUrl(entity.PictureURL, entity.FacebookID, imageBaseUrl, defaultAvatarUrl));
 }
Пример #6
0
 private static string Entity2StoreOwnerFullName(this vw_USER_EventsLog entity)
 {
     return(entity.StoreOwnerUserID == null ? string.Empty : DtoExtensions.CombineFullName(entity.StoreOwnerFirstName, entity.StoreOwnerLastName, entity.StoreOwnerNickname));
 }
Пример #7
0
 private static string Entity2VideoAuthorFullName(this vw_USER_EventsLog entity)
 {
     return(entity.VideoAuthorId == null ? string.Empty : DtoExtensions.CombineFullName(entity.VideoAuthorFirstName, entity.VideoAuthorLastName, entity.VideoAuthorNickname));
 }
Пример #8
0
 private static string GetUserName(this vw_USER_EventsLog entity)
 {
     return(entity.UserID == null ? string.Empty : DtoExtensions.CombineFullName(entity.FirstName, entity.LastName, entity.Nickname));
 }