/// <summary> Decrypts. </summary> /// /// <remarks> Asim Naeem, 7/20/2017. </remarks> /// /// <param name="text"> . </param> /// /// <returns> A string. </returns> internal static string Decrypt(string text) { string result = string.Empty; try { result = WebSecurityUtility.Decrypt(text, true); } catch { result = string.Empty; } return(result); }
/// <summary> Gets connection string. </summary> /// /// <remarks> Asim Naeem, 7/20/2017. </remarks> /// /// <param name="connectionName"> . </param> /// /// <returns> The connection string. </returns> internal string GetConnectionString(string connectionName) { string connectionValue = GetAppSetting(connectionName); if (string.IsNullOrEmpty(connectionValue)) { return(WebSecurityUtility.Decrypt(DataAccess.Properties.DataAccess.Default[connectionName.ToLower()].ToString(), true)); } else { if (DataAccess.Properties.DataAccess.Default.SettingsKey.Equals(connectionValue)) { return(WebSecurityUtility.Decrypt(DataAccess.Properties.DataAccess.Default[connectionValue.ToLower()].ToString(), true)); } else { return(Decrypt(connectionValue)); } } }