public static UserEditDTO LoginEntity2UserEditDto(this vw_USER_UserLogins entity) { return(new UserEditDTO { UserProfileId = entity.Id , UserId = entity.UserId , Email = entity.Email , FullName = entity.Entity2FullName() , FirstName = entity.FirstName , LastName = entity.LastName , Nickname = entity.Nickname , LastLogin = entity.LastLogin , IsConfirmed = entity.IsConfirmed , IsSocialLogin = entity.Provider != null // || !String.IsNullOrEmpty(entity.FacebookID) , ProviderName = entity.Provider ?? (!String.IsNullOrEmpty(entity.FacebookID) ? "facebook" : "") , Status = Utils.ParseEnum <UserEnums.eUserStatuses>(entity.StatusType.ToString()) , PictureUrl = entity.Entity2PhotoUrl(Constants.ImageBaseUrl, Constants.DefaultAvatarUrl) , RegistrationSource = Utils.ParseEnum <CommonEnums.eRegistrationSources>(entity.RegistrationTypeId) }); }
public static UserGridViewDto LoginEntity2UserGridViewDto(this vw_USER_UserLogins entity) { return(new UserGridViewDto { UserProfileId = entity.Id , UserId = entity.UserId , Email = entity.Email , FullName = entity.Entity2FullName() , FirstName = entity.FirstName , LastName = entity.LastName , Nickname = entity.Nickname , LastLogin = entity.LastLogin , IsConfirmed = entity.IsConfirmed , IsSocialLogin = entity.Provider != null // || !String.IsNullOrEmpty(entity.FacebookID) , ProviderName = entity.Provider ?? (!String.IsNullOrEmpty(entity.FacebookID) ? "facebook" : "") , RegisterDate = entity.RegisterDate.Date , RegisterTime = entity.RegisterDate , Status = Utils.ParseEnum <UserEnums.eUserStatuses>(entity.StatusType.ToString()) , RegistrationSource = Utils.ParseEnum <CommonEnums.eRegistrationSources>(entity.RegistrationTypeId) , PictureUrl = entity.Entity2PhotoUrl(Constants.ImageBaseUrl, Constants.DefaultAvatarUrl) , ActivityScore = entity.UserId.CalculateActivityScore(entity.courses, entity.bundles, entity.chapters, entity.videos, entity.logins, entity.purchases, entity.stores) , LoginsCount = entity.logins }); }
public static string Entity2PhotoUrl(this vw_USER_UserLogins entity, string imageBaseUrl, string defaultAvatarUrl) { return(GetPhotoUrl(entity.PictureURL, entity.FacebookID, imageBaseUrl, defaultAvatarUrl)); }
public static string Entity2FullName(this vw_USER_UserLogins entity) { return(CombineFullName(entity.FirstName, entity.LastName, entity.Nickname)); }