summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-10-24 14:56:47 +0200
committeremkael <emkael@tlen.pl>2018-10-24 14:56:47 +0200
commit68b73444035103941c45e24a96b05f6cf40334c9 (patch)
tree97338fd8c4514baeb26d3504993fbc9838e78900
parentfe71701968627f6ee3e1066dbb1ee6d2ab08afcc (diff)
Extending Setting.load to read settings from other BWS tables
-rw-r--r--Aktywator/Setting.cs9
1 files 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