public static bool OpenDBConnection() { if (myConn != null) { return(true); } if (myConn == null) { string cs = string.Format("server={0};userid={1};password={2};database=pck", settings.DBServer, settings.DBUser, CryptoSystem.Decrypt(settings.DBPassword)); try { myConn = new MySqlConnection(cs); myConn.Open(); //MySqlCommand cmd = myConn.CreateCommand(); //cmd.CommandText = "SET autocommit = 0"; //cmd.ExecuteNonQuery(); } catch (MySqlException ex) { MessageLogger.Add("Error opening DB connection " + ex.ToString(), MessageLogger.MsgLevel.error); return(false); } } return(true); }
private void UpdateComponents(SAPSettings s) { txtSAPHost.Text = s.hostname; txtSAPUser.Text = s.user; txtSAPPassword.Text = CryptoSystem.Decrypt(s.password); txtSAPClient.Text = s.client; txtDevice.Text = s.device; }
public bool SaveSettings() { var settings = new DBSettings(); settings.DBServer = txtDBHost.Text; settings.DBUser = txtDBUser.Text; settings.DBPassword = CryptoSystem.Encrypt(txtDBPassword.Text); return(XMLConfigHandler.SaveConfig(settings)); }
public bool SaveSettings() { var s = new SAPSettings(); s.hostname = txtSAPHost.Text; s.user = txtSAPUser.Text; s.password = CryptoSystem.Encrypt(txtSAPPassword.Text); s.client = txtSAPClient.Text; s.device = txtDevice.Text; return(XMLConfigHandler.SaveConfig(s)); }
public DBSettingsCntrl() { InitializeComponent(); DBSettings s = (DBSettings)XMLConfigHandler.ReadConfig(typeof(DBSettings)); if (s != null) { txtDBHost.Text = s.DBServer; txtDBUser.Text = s.DBUser; txtDBPassword.Text = CryptoSystem.Decrypt(s.DBPassword); } }