Example #1
0
        public static FileInterfaceLogDTO LogToken2FileInterfaceLogDto(this LOG_FileInterfaceToken token)
        {
            string status;

            try
            {
                status = Utils.GetEnumDescription(Utils.ParseEnum <ImportJobsEnums.eFileInterfaceStatus>(token.Status));
            }
            catch (Exception)
            {
                status = token.Status;
            }

            return(new FileInterfaceLogDTO
            {
                FileId = token.FileId
                , BcIdentifier = token.BcIdentifier
                , ETag = token.ETag
                , ContentType = token.ContentType
                , FilePath = token.FilePath
                , FileSize = token.FileSize
                , UpdateOn = token.UpdateOn
                , AddOn = token.AddOn
                , Status = status
                , User = new UserLogDTO
                {
                    id = token.UserId
                    , name = token.Entity2FullName()
                    , url = token.Entity2PhotoUrl(Constants.ImageBaseUrl, Constants.DefaultAvatarUrl)
                }
            });
        }
Example #2
0
 public static string Entity2PhotoUrl(this LOG_FileInterfaceToken entity, string imageBaseUrl, string defaultAvatarUrl)
 {
     return(GetPhotoUrl(entity.PictureURL, entity.FacebookID, imageBaseUrl, defaultAvatarUrl));
 }
Example #3
0
 public static string Entity2FullName(this LOG_FileInterfaceToken entity)
 {
     return(CombineFullName(entity.FirstName, entity.LastName, entity.Nickname));
 }