/// <summary> /// Updates the Users Database /// </summary> public void UpdateUsers() { try { ado.SaveTable(users, userfilepath, 0, "--"); ado.SaveTimeDateinfo(userfilepath); } catch (Exception e) { program.errorreport(e); } }
private void btnChange_Click(object sender, EventArgs ev) { try { int i; string tmp; hbADO.AttachDataBaseinDataSet(Data, Dabasepath + "\\" + tablename); //MessageBox.Show(cmboCells.Text + "\n" + txtCellName.Text + "\n" + Convert.ToString(Data.Tables.Count)); if ((cmboCells.Text != null) && (this.cboCellsTarget.Text != null) && (Data != null) && (Data.Tables.Count > 0)) { // hydrobaseADO hbAdo = new hydrobaseADO(); i = cmboCells.SelectedIndex; //tmp = checkandfixcellname(this.cboCellsTarget.Text); hbADO.MovePositionBetweenTwoCollumns(Data.Tables[0], this.cmboCells.Text, cboCellsTarget.Text); hbADO.SaveTable(Data, Dabasepath + "\\" + tablename, 0, ProductName + " - " + ProductVersion); hbADO.CloseDataBase(Data); MessageBox.Show("Please Reload the Table to see the changes."); } this.Close(); } catch (Exception e) { Program.errorreport(e); } }
/// <summary> /// Creates config file /// </summary> public void CreateFile() { try { if (File.Exists(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase).Replace(@"file:\", "") + "\\" + confile) != true) { ado.TableCreation(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase).Replace(@"file:\", "") + "\\" + confile, cells, "ffff"); object[] vals = new object[cells.Length]; vals[0] = false; vals[1] = defaultusername; vals[2] = defaultpass; vals[3] = false; vals[4] = false; vals[5] = false; vals[6] = true; vals[7] = false; ado.AttachDataBaseinDataSet(set, Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase).Replace(@"file:\", "") + "\\" + confile); if (set.Tables[0] != null) { set.Tables[0].Rows[0].ItemArray = vals; ado.SaveTable(set, Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase).Replace(@"file:\", "") + "\\" + confile, 0, ""); } } } catch (Exception e) { program.errorreport(e); } }
public void AddAlliaces(string allias, string command) { try { if ((ApplicationsFolder != null) && (allias != null) && (command != null)) { this.LoadAlliaces(); object [] vals = new object[2]; vals[0] = allias; vals[1] = command; alliasset.Tables[0].Rows.Add(vals); ado.SaveTable(alliasset, ApplicationsFolder + "\\" + alliasfile, 0, Application.ProductName + " - " + Application.ProductVersion); } } catch (Exception ex) { Program.errorreporting(ex); } }