CinderellaMGS.SQL_Queries.getGlobalizedSettings C# (CSharp) Method

getGlobalizedSettings() public method

Method will retrieve settings from the database in the ConfigSettings table.
public getGlobalizedSettings ( string appProperty ) : string
appProperty string the appProperty key of the setting you are retreiving from the database
return string
        public string getGlobalizedSettings(string appProperty)
        {
            string sql = "Select appProperty, propertyValue, defaultPropertyValue From ConfigSettings Where appProperty = '" + appProperty + "'";

            DataSet ds = database.getDataSet(sql, "tableName");
            string propertyValue = ds.Tables["tableName"].Rows[0]["propertyValue"].ToString();
            string defaultPropertyValue = ds.Tables["tableName"].Rows[0]["defaultPropertyValue"].ToString();

            if (propertyValue != null)
            {
                return propertyValue;
            }
            else
            {
                return defaultPropertyValue;
            }
        }