static public string GetDeptPhotoByFileId(int fileId)
 {
     // fileId may be 0 if no photo defined, then theFile would be null
     DotNetNuke.Services.FileSystem.IFileInfo theFile = DotNetNuke.Services.FileSystem.FileManager.Instance.GetFile((int)fileId);
     if (theFile != null)
     {
         return(DotNetNuke.Services.FileSystem.FileManager.Instance.GetUrl(theFile));
     }
     return("/images/no_avatar.gif");
 }
Пример #2
0
 public string GetFilePath(string strFile, int portalId)
 {
     if (strFile != "")
     {
         DotNetNuke.Services.FileSystem.IFileInfo objXSLFile = FileManager.Instance.GetFile((int.Parse(strFile.Replace("FileID=", ""))));
         return(string.Format("{0}{1}", objXSLFile.Folder, objXSLFile.FileName));
     }
     else
     {
         return("");
     }
 }
 static public string GetStaffJointPhotoByFileId(int staffID, int fileId)
 {
     if (GetStaffProfileProperty(staffID, "UnNamedStaff") != "True")
     {
         // fileId may be 0 if no photo defined, then theFile would be null
         DotNetNuke.Services.FileSystem.IFileInfo theFile = DotNetNuke.Services.FileSystem.FileManager.Instance.GetFile(fileId);
         if (theFile != null)
         {
             return(DotNetNuke.Services.FileSystem.FileManager.Instance.GetUrl(theFile));
         }
     }
     return("/images/no_avatar.gif");
 }
    static public string GetStaffJointPhoto(int staffID)
    {
        String fileId = GetStaffProfileProperty(staffID, "JointPhoto");

        if (fileId == null || fileId.Equals("") || (GetStaffProfileProperty(staffID, "UnNamedStaff") == "True"))
        {
            return("/images/no_avatar.gif");
        }
        else
        {
            DotNetNuke.Services.FileSystem.IFileInfo theFile = DotNetNuke.Services.FileSystem.FileManager.Instance.GetFile(Convert.ToInt32(fileId));
            return(DotNetNuke.Services.FileSystem.FileManager.Instance.GetUrl(theFile));
        }
    }
    static public string GetDeptPhoto(int deptID)
    {
        StaffBrokerDataContext d = new StaffBrokerDataContext();
        var    cc     = from c in d.AP_StaffBroker_Departments where c.CostCenterId == deptID select c.PhotoId;
        String fileId = cc.First().ToString();

        if (fileId == null || fileId.Equals(""))
        {
            return("/images/no_avatar.gif");
        }
        else
        {
            DotNetNuke.Services.FileSystem.IFileInfo theFile = DotNetNuke.Services.FileSystem.FileManager.Instance.GetFile(Convert.ToInt32(fileId));
            return(DotNetNuke.Services.FileSystem.FileManager.Instance.GetUrl(theFile));
        }
    }