public static string get_icon_url(Guid applicationId, Guid ownerId,
                                          DefaultIconTypes defaultIcon = DefaultIconTypes.Node, Guid?alternateOwnerId = null, bool networkAddress = false)
        {
            if (ownerId == Guid.Empty)
            {
                return(string.Empty);
            }

            DocFileInfo fi = new DocFileInfo()
            {
                FileID     = ownerId,
                OwnerID    = ownerId,
                Extension  = "jpg",
                FolderName = FolderNames.Icons
            };

            string retUrl = fi.exists(applicationId) ? fi.url(applicationId) : string.Empty;

            if (string.IsNullOrEmpty(retUrl) && alternateOwnerId.HasValue)
            {
                fi.FileID = alternateOwnerId;
                retUrl    = fi.exists(applicationId) ? fi.url(applicationId) : string.Empty;
            }

            if (string.IsNullOrEmpty(retUrl) && defaultIcon != DefaultIconTypes.None)
            {
                retUrl = get_icon_url(applicationId, defaultIcon);
            }

            return(networkAddress ? retUrl.Replace("../..", RaaiVanSettings.RaaiVanURL(applicationId)) : retUrl);
        }
        public static string get_cover_photo_url(Guid?applicationId,
                                                 Guid?ownerId, bool networkAddress = false, bool highQuality = false)
        {
            if (RaaiVanSettings.SAASBasedMultiTenancy)
            {
                applicationId = null;
            }

            if (!ownerId.HasValue || ownerId == Guid.Empty)
            {
                string addr = PublicConsts.DefaultCoverPhotoURL;

                return(highQuality ? string.Empty :
                       (networkAddress ? addr.Replace("../..", RaaiVanSettings.RaaiVanURL(applicationId)) : addr));
            }

            FolderNames folderName = highQuality ? FolderNames.HighQualityCoverPhoto : FolderNames.CoverPhoto;

            DocFileInfo fi = new DocFileInfo()
            {
                FileID     = ownerId,
                OwnerID    = ownerId,
                Extension  = "jpg",
                FolderName = folderName
            };

            string retUrl = fi.exists(applicationId) ? fi.url(applicationId) : string.Empty;

            return(networkAddress ? retUrl.Replace("../..", RaaiVanSettings.RaaiVanURL(applicationId)) : retUrl);
        }
        public static string get_application_icon_url(Guid?applicationId, bool highQuality = false, bool networkAddress = false)
        {
            FolderNames folderName = highQuality ? FolderNames.HighQualityApplicationIcon : FolderNames.ApplicationIcons;

            if (!applicationId.HasValue || applicationId == Guid.Empty)
            {
                string addr = RaaiVanSettings.LogoMiniURL;

                return(highQuality ? string.Empty :
                       (networkAddress ? addr.Replace("../..", RaaiVanSettings.RaaiVanURL(applicationId)) : addr));
            }

            DocFileInfo fi = new DocFileInfo()
            {
                FileID     = applicationId,
                OwnerID    = applicationId,
                Extension  = "jpg",
                FolderName = folderName
            };

            string retUrl = fi.exists(applicationId) ? fi.url(applicationId) : string.Empty;

            if (string.IsNullOrEmpty(retUrl) && !highQuality)
            {
                retUrl = RaaiVanSettings.LogoMiniURL;
            }

            return(networkAddress ? retUrl.Replace("../..", RaaiVanSettings.RaaiVanURL(applicationId)) : retUrl);
        }
        public static string get_personal_image_address(Guid?applicationId,
                                                        Guid?userId, bool networkAddress = false, bool highQuality = false)
        {
            if (RaaiVanSettings.SAASBasedMultiTenancy)
            {
                applicationId = null;
            }

            if (!userId.HasValue || userId == Guid.Empty)
            {
                string addr = PublicConsts.DefaultProfileImageURL;

                return(highQuality ? string.Empty :
                       (networkAddress ? addr.Replace("../..", RaaiVanSettings.RaaiVanURL(applicationId)) : addr));
            }

            FolderNames folderName = highQuality ? FolderNames.HighQualityProfileImage : FolderNames.ProfileImages;

            DocFileInfo fi = new DocFileInfo()
            {
                FileID     = userId,
                Extension  = "jpg",
                FolderName = folderName
            };

            string address = !fi.exists(applicationId) ?
                             (highQuality ? string.Empty : PublicConsts.DefaultProfileImageURL) : fi.url(applicationId);

            return(networkAddress ? address.Replace("../..", RaaiVanSettings.RaaiVanURL(applicationId)) : address);
        }
        public static bool picture_exists(Guid applicationId, Guid pictureId)
        {
            if (pictureId == Guid.Empty)
            {
                return(false);
            }

            DocFileInfo fi = new DocFileInfo()
            {
                FileID     = pictureId,
                Extension  = "jpg",
                FolderName = FolderNames.Pictures
            };

            return(fi.exists(applicationId));
        }
        public static bool icon_exists(Guid applicationId, Guid ownerId)
        {
            if (ownerId == Guid.Empty)
            {
                return(false);
            }

            DocFileInfo fi = new DocFileInfo()
            {
                FileID     = ownerId,
                OwnerID    = ownerId,
                Extension  = "jpg",
                FolderName = FolderNames.Icons
            };

            return(fi.exists(applicationId));
        }
示例#7
0
        private static string _get_email_template(Guid?applicationId, string templateType)
        {
            if (RaaiVanSettings.SAASBasedMultiTenancy)
            {
                applicationId = null;
            }

            DocFileInfo fi = new DocFileInfo()
            {
                FileName   = templateType,
                Extension  = "txt",
                FolderName = FolderNames.EmailTemplates
            };

            return(fi.exists(applicationId) ? fi.get_text_content(applicationId) :
                   (applicationId.HasValue ? _get_email_template(null, templateType) : string.Empty));
        }
        public static string get_icon_url(Guid applicationId, Guid ownerId, string extension,
                                          bool highQuality = false, bool networkAddress = false)
        {
            if (ownerId == Guid.Empty)
            {
                return(string.Empty);
            }

            FolderNames folderName = highQuality ? FolderNames.HighQualityIcon : FolderNames.Icons;

            DocFileInfo fi = new DocFileInfo()
            {
                FileID     = ownerId,
                OwnerID    = ownerId,
                Extension  = "jpg",
                FolderName = folderName
            };

            string retUrl = fi.exists(applicationId) ? fi.url(applicationId) :
                            (highQuality ? string.Empty : get_icon_url(applicationId, DefaultIconTypes.Extension, extension));

            return(networkAddress ? retUrl.Replace("../..", RaaiVanSettings.RaaiVanURL(applicationId)) : retUrl);
        }