From 7b2f2c9e74a0e00f1fb12cba23fb218e470998eb Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 13 Apr 2018 16:55:18 +0200 Subject: Section group setting saved in a uniform way --- Aktywator/Bws.cs | 10 +--------- Aktywator/Setting.cs | 8 ++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'Aktywator') diff --git a/Aktywator/Bws.cs b/Aktywator/Bws.cs index 1af237f..5695a00 100644 --- a/Aktywator/Bws.cs +++ b/Aktywator/Bws.cs @@ -552,15 +552,7 @@ namespace Aktywator Setting.save("BM2NameSource", "2", this, errors, section); Setting.save("BM2PINcode", "'" + main.xPINcode.Text + "'", this, errors, section); Setting.save("BM2ResultsOverview", main.xResultsOverview.SelectedIndex.ToString(), this, errors, section); - if (main.xGroupSections.Checked) - { - sql.query("UPDATE Tables SET `Group` = 1;"); - } - else - { - sql.query("UPDATE Tables SET `Group` = `Section`;"); - } - + Setting.saveSectionGroups(this.sql, main.xGroupSections.Checked); this.loadSettings(); } diff --git a/Aktywator/Setting.cs b/Aktywator/Setting.cs index 613065f..bde6fd1 100644 --- a/Aktywator/Setting.cs +++ b/Aktywator/Setting.cs @@ -170,5 +170,13 @@ namespace Aktywator { } } + + public static void saveSectionGroups(Sql sql, bool value) + { + StringBuilder sb = new StringBuilder("UPDATE Tables SET `Group` = "); + sb.Append(value ? "1" : "`Section`"); + sb.Append(";"); + sql.query(sb.ToString()); + } } } -- cgit v1.2.3