Exemplo n.º 1
0
 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 "";
     }
 }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
 public Setting(string name, CheckBox field, Bws bws)
 {
     this.name = name;
     this.field = field;
     this.bws = bws;
 }