public static bool CheckForValidExtensions(int UserModuleID, string ext, int PortalID) { string extension = ""; List <FileManagerSettingInfo> lstSettings = FileManagerController.GetFileManagerSettings(UserModuleID, PortalID); foreach (FileManagerSettingInfo obj in lstSettings) { switch (obj.SettingKey) { case "FileManagerExtensions": extension = obj.SettingValue; break; } } string[] arrExt = extension.Split(','); if (arrExt.Contains(ext)) { return(true); } else { return(false); } }
/// <summary> /// Obtains valid extensions. /// </summary> /// <param name="UserModuleID">UserModuleID</param> /// <param name="PortalID">PortalID</param> /// <returns>Valid Extension.</returns> public static string GetValidExtensions(int UserModuleID, int PortalID) { string extension = ""; List <FileManagerSettingInfo> lstSettings = FileManagerController.GetFileManagerSettings(UserModuleID, PortalID); foreach (FileManagerSettingInfo obj in lstSettings) { switch (obj.SettingKey) { case "FileManagerExtensions": extension = obj.SettingValue; break; } } return(extension); }