From 68b73444035103941c45e24a96b05f6cf40334c9 Mon Sep 17 00:00:00 2001 From: emkael Date: Wed, 24 Oct 2018 14:56:47 +0200 Subject: Extending Setting.load to read settings from other BWS tables --- Aktywator/Setting.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Aktywator/Setting.cs b/Aktywator/Setting.cs index 802e92a..2cf1120 100644 --- a/Aktywator/Setting.cs +++ b/Aktywator/Setting.cs @@ -42,15 +42,18 @@ namespace Aktywator field.Checked = a.ToUpper() == "TRUE" ? true : false; } - public static string load(string name, Bws bws, StringBuilder errors, string section = null) + public static string load(string name, Bws bws, StringBuilder errors, string section = null, string table = "Settings", string sectionField = "`Section`") { StringBuilder str = new StringBuilder(); str.Append("SELECT "); str.Append(name); - str.Append(" FROM Settings"); + str.Append(" FROM "); + str.Append(table); if (section != null) { - str.Append(" WHERE `Section` = "); + str.Append(" WHERE "); + str.Append(sectionField); + str.Append(" = "); str.Append(section); } try -- cgit v1.2.3