private void PopulateAndSetMaintenanceMode() { try { // populate the dropdown values dropdown_maintenance_mode.Items.Insert(0, new ListItem("Disabled", "0")); dropdown_maintenance_mode.Items.Insert(1, new ListItem("Enabled", "1")); string MaintenanceValue = "0"; // set the dropdown values foreach (Settings SettingObj in ListOfSettings.GetSettingsList()) { if (SettingObj.GetSettingsKey() == "MAINTENANCE") { MaintenanceValue = SettingObj.GetSettingsValue(); break; } } dropdown_maintenance_mode.SelectedValue = MaintenanceValue; TextStatus.Visible = false; dropdown_maintenance_mode.Visible = true; } catch (Exception ex) { Logger.Instance().Log(Warn.Instance(), ex); dropdown_maintenance_mode.Visible = false; TextStatus.Visible = true; TextStatus.BackColor = System.Drawing.Color.FromArgb(Int32.Parse("FF6E6E", NumberStyles.HexNumber)); TextStatus.ForeColor = System.Drawing.Color.White; } }
private string ReturnDBValue(string Key) { string Value = ""; foreach (Settings SettingObj in ListOfSettings.GetSettingsList()) { if (SettingObj.GetSettingsKey() == Key) { return(SettingObj.GetSettingsValue()); } } return(Value); }