private void Encuentra() { if (Rutinas.EncuentraUsuario(txtUser.Text, txtPass.Text)) { string txtIP = ConfigurationManager.AppSettings["IP"].ToString(); VariablesGlobales.Usuario = txtUser.Text; Parametros(); string sBase = VariablesGlobales.NombreBase; sBase = VariablesGlobales.NombreBase; cambiarDatosServer(txtIP, "root", "Mapuch33", sBase); CambiaDatosImpre(txtIP, "root", "Mapuch33", sBase); //Database.ConnectionString= ConfigurationManager.ConnectionStrings["cnx"].ConnectionString; VariablesGlobales.NombreBase = sBase; FormPrincipal Princ = new FormPrincipal(); Princ.Show(); this.Hide(); //Formularios.frmElijeBase eBase = new frmElijeBase(); //eBase.Show(); //this.Hide(); //Formularios.frmMain Principal = new frmMain(); //Principal.Show(); } else { MessageBox.Show("Usuario o Password Incorectos, Reintente..!"); } }
private void btnChevrolet_Click(object sender, EventArgs e) { string key = "Chevrolet"; string value = ((Hashtable)ConfigurationManager.GetSection("DBDatos"))[key].ToString(); sBase = value; cambiarDatosServer(txtIP.Text, "root", "Mapuch33", sBase); CambiaDatosImpre(txtIP.Text, "root", "Mapuch33", sBase); VariablesGlobales.NombreBase = sBase; FormPrincipal Princ = new FormPrincipal(); Princ.Show(); this.Hide(); }
private void cboBase_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { e.Handled = true; string key = Convert.ToString(cboBase.SelectedValue); string value = ((Hashtable)ConfigurationManager.GetSection("DBDatos"))[key].ToString(); sBase = value; cambiarDatosServer(txtIP.Text, "root", "Mapuch33", sBase); CambiaDatosImpre(txtIP.Text, "root", "Mapuch33", sBase); //Database.ConnectionString= ConfigurationManager.ConnectionStrings["cnx"].ConnectionString; VariablesGlobales.NombreBase = sBase; FormPrincipal Princ = new FormPrincipal(); Princ.Show(); this.Hide(); } }