public static string load(string name, Bws bws, StringBuilder errors) { StringBuilder str = new StringBuilder(); str.Append("SELECT "); str.Append(name); str.Append(" FROM Settings"); try { return bws.sql.selectOne(str.ToString()); } catch (OleDbException) { if (errors.Length > 0) errors.Append(", "); errors.Append(name); return ""; } }
public static void save(string name, string value, Bws bws, StringBuilder errors) { StringBuilder str = new StringBuilder(); str.Append("UPDATE Settings SET "); str.Append(name); str.Append("="); str.Append(value); try { bws.sql.query(str.ToString()); } catch (OleDbException) { if (errors.Length > 0) errors.Append(", "); errors.Append(name); } }
private void MainForm_Shown(object sender, EventArgs e) { status2.Text = "Wersja " + this.version; status3.Text = "Data: " + this.date; string filename; string[] args = Environment.GetCommandLineArgs(); if (args.Length > 1) filename = args[1]; else if (open.ShowDialog() == DialogResult.OK) filename = open.FileName; else { Close(); return; } bws = new Bws(filename, this); if (!bws.isBm2()) if (MessageBox.Show("Ten BWS nie jest przygotowany dla BM2. Przekonwertować?", "Konwersja do BM2", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) bws.convert(); labelFilename.Text = filename; bws.initSettings(); bws.loadSettings(); this.WindowState = FormWindowState.Normal; }
public Setting(string name, CheckBox field, Bws bws) { this.name = name; this.field = field; this.bws = bws; }