private void button4_Click(object sender, EventArgs e) { DataRow rowtp = DTSFTP.Rows[0]; if (textBox5.Text == string.Empty) { HOST = Convert.ToString(rowtp["HOST"]); } else { HOST = textBox5.Text; } if (textBox6.Text == string.Empty) { USER = Convert.ToString(rowtp["USER"]); } else { USER = textBox6.Text; } if (textBox7.Text == string.Empty) { SFTPKEY = Encripter.Encriptar(Convert.ToString(rowtp["SFTPKEY"])); } else { SFTPKEY = Encripter.Encriptar(textBox7.Text); } if (textBox8.Text == string.Empty) { PUERTO = Convert.ToString(rowtp["PUERTO"]); } else { PUERTO = textBox8.Text; } if (checkBox1.Checked) { AUTOMATICO = "YES"; } else { AUTOMATICO = "NO"; } XMLRW.write("SFTP", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", HOST, USER, SFTPKEY, PUERTO, AUTOMATICO); }
private void Log_local() { cont.conectar("DM"); SqlCommand cm4 = new SqlCommand("SELECT [USUARIO],[PASS_LOCAL],[PUESTO] FROM [DM].[CORRECT].[USUARIOS] where usuario ='" + textBox1.Text + "'", cont.condm); SqlDataReader dr = cm4.ExecuteReader(); while (dr.Read()) { usuario = Convert.ToString(dr["USUARIO"]); contraseña = Encripter.Desencriptar(Convert.ToString(dr["PASS_LOCAL"])); // puesto = Convert.ToString(dr["PUESTO"]); } dr.Close(); cont.Desconectar("DM"); if (textBox1.Text.ToUpper() == usuario.ToUpper()) { if (contraseña == "" || contraseña == string.Empty) { MessageBox.Show("Este usuario no cuenta con contraseña Solicitar la Creacion a Soporte Tecnico"); } else if (textBox2.Text == contraseña) { if (Convert.ToInt32(actual) > Convert.ToInt32(nueva)) { UpdateVercion(); } Main_Menu fm6 = new Main_Menu(); this.Visible = false; fm6.ShowDialog(); fm6.Close(); fm6 = null; this.Close(); } else { MessageBox.Show("Error en Contraseña"); } } else { MessageBox.Show("Usuario no Existe"); } }
private void Configuracion_Load(object sender, EventArgs e) { button2.Enabled = false; DataRow rowtp = DTSFTP.Rows[0]; textBox5.Text = Convert.ToString(rowtp["HOST"]); textBox6.Text = Convert.ToString(rowtp["USER"]); textBox7.Text = Encripter.Desencriptar(Convert.ToString(rowtp["SFTPKEY"])); textBox8.Text = Convert.ToString(rowtp["PUERTO"]); string automatico = Convert.ToString(rowtp["AUTOMATICO"]); if (automatico == "YES") { checkBox1.Checked = true; } else { checkBox1.Checked = false; } }
public void credeciales() { DataRow row = DT.Rows[0]; Sqlserver = Convert.ToString(row["SERVIDORSQL"]); PGSQLserver = Convert.ToString(row["SERVIDORPGSQL"]); Sqlserverseg = Convert.ToString(row["SERVIDORSQLSEG"]); UserSQL = Convert.ToString(row["LOGIN"]); UserSQLseg = Convert.ToString(row["LOGINSG"]); pglogin = Convert.ToString(row["LOGINPG"]); DBEXACTUS = Convert.ToString(row["DBSQLEX"]); pgdb = Convert.ToString(row["DBPG"]); Mysqlserver = Convert.ToString(row["SERVIDORWEB"]); UserMysql = Convert.ToString(row["LOGINWEB"]); DBWEB = Convert.ToString(row["DBWEB"]); DBDM = Convert.ToString(row["DBSQLDM"]); DBSEGURIDAD = Convert.ToString(row["DBSQLSG"]); SQLPass = Encripter.Desencriptar(Convert.ToString(row["KEYID"])); MYsqlPass = Encripter.Desencriptar(Convert.ToString(row["KEYIDWEB"])); SQLPSEG = Encripter.Desencriptar(Convert.ToString(row["KEYIDSG"])); pgID = Encripter.Desencriptar(Convert.ToString(row["KEYIDPG"])); }
private void button2_Click(object sender, EventArgs e) { DataRow row = DT.Rows[0]; if (comboBox1.Text == "192.168.1.25 [EXACTUS]") { SSQLserver = textBox1.Text; SWeb = Convert.ToString(row["SERVIDORWEB"]); SDMdatabase = Convert.ToString(row["DBSQLDM"]); SDBExactus = textBox4.Text; SDBWeb = Convert.ToString(row["DBWEB"]); SSQLogin = textBox2.Text; SMyqlogin = Convert.ToString(row["LOGINWEB"]); SSqlID = Encripter.Encriptar(textBox3.Text); SMsqlID = Convert.ToString(row["KEYIDWEB"]); SSQLserverseg = Convert.ToString(row["SERVIDORSQLSEG"]); SDBSeguridad = Convert.ToString(row["DBSQLSG"]); SSQLoginsg = Convert.ToString(row["LOGINSG"]); SSqlIDsg = Convert.ToString(row["KEYIDSG"]); PGSQLserver = Convert.ToString(row["SERVIDORPGSQL"]); pgdb = Convert.ToString(row["DBPG"]); pglogin = Convert.ToString(row["LOGINPG"]); pgID = Convert.ToString(row["KEYIDPG"]); XMLRW.write("CONFIGURACION", SSQLserver, SWeb, SSQLserverseg, PGSQLserver, SDMdatabase, SDBExactus, SDBSeguridad, pgdb, SDBWeb, SSQLogin, SSQLoginsg, SMyqlogin, pglogin, SSqlID, SSqlIDsg, SMsqlID, pgID, "", "", "", "", ""); } else if (comboBox1.Text == "mysql.dismonline") { SSQLserver = Convert.ToString(row["SERVIDORSQL"]); SWeb = textBox1.Text; SDMdatabase = Convert.ToString(row["DBSQLDM"]); SDBExactus = Convert.ToString(row["DBSQLEX"]); SDBWeb = textBox4.Text; SSQLogin = Convert.ToString(row["LOGIN"]); SMyqlogin = textBox2.Text; SSqlID = Convert.ToString(row["KEYID"]); SMsqlID = Encripter.Encriptar(textBox3.Text); SSQLserverseg = Convert.ToString(row["SERVIDORSQLSEG"]); SDBSeguridad = Convert.ToString(row["DBSQLSG"]); SSQLoginsg = Convert.ToString(row["LOGINSG"]); SSqlIDsg = Convert.ToString(row["KEYIDSG"]); PGSQLserver = Convert.ToString(row["SERVIDORPGSQL"]); pgdb = Convert.ToString(row["DBPG"]); pglogin = Convert.ToString(row["LOGINPG"]); pgID = Convert.ToString(row["KEYIDPG"]); XMLRW.write("CONFIGURACION", SSQLserver, SWeb, SSQLserverseg, PGSQLserver, SDMdatabase, SDBExactus, SDBSeguridad, pgdb, SDBWeb, SSQLogin, SSQLoginsg, SMyqlogin, pglogin, SSqlID, SSqlIDsg, SMsqlID, pgID, "", "", "", "", ""); } else if (comboBox1.Text == "192.168.1.25 [DM]") { SSQLserver = textBox1.Text; SWeb = Convert.ToString(row["SERVIDORWEB"]); SDMdatabase = textBox4.Text; SDBExactus = Convert.ToString(row["DBSQLEX"]); SDBWeb = Convert.ToString(row["DBWEB"]); SSQLogin = textBox2.Text; SMyqlogin = Convert.ToString(row["LOGINWEB"]); SSqlID = Encripter.Encriptar(textBox3.Text); SMsqlID = Convert.ToString(row["KEYIDWEB"]); SSQLserverseg = Convert.ToString(row["SERVIDORSQLSEG"]); SDBSeguridad = Convert.ToString(row["DBSQLSG"]); SSQLoginsg = Convert.ToString(row["LOGINSG"]); SSqlIDsg = Convert.ToString(row["KEYIDSG"]); PGSQLserver = Convert.ToString(row["SERVIDORPGSQL"]); pgdb = Convert.ToString(row["DBPG"]); pglogin = Convert.ToString(row["LOGINPG"]); pgID = Convert.ToString(row["KEYIDPG"]); XMLRW.write("CONFIGURACION", SSQLserver, SWeb, SSQLserverseg, PGSQLserver, SDMdatabase, SDBExactus, SDBSeguridad, pgdb, SDBWeb, SSQLogin, SSQLoginsg, SMyqlogin, pglogin, SSqlID, SSqlIDsg, SMsqlID, pgID, "", "", "", "", ""); } else if (comboBox1.Text == "192.168.1.11 [ACCESSCONTROL]") { SSQLserver = Convert.ToString(row["SERVIDORSQL"]); SSQLserverseg = textBox1.Text; SWeb = Convert.ToString(row["SERVIDORWEB"]); SDMdatabase = Convert.ToString(row["DBSQLDM"]); SDBSeguridad = textBox4.Text; SDBExactus = Convert.ToString(row["DBSQLEX"]); SDBWeb = Convert.ToString(row["DBWEB"]); SSQLoginsg = textBox2.Text; SSQLogin = Convert.ToString(row["LOGIN"]); SMyqlogin = Convert.ToString(row["LOGINWEB"]); SSqlID = Convert.ToString(row["KEYID"]); SSqlIDsg = Encripter.Encriptar(textBox3.Text); SMsqlID = Convert.ToString(row["KEYIDWEB"]); PGSQLserver = Convert.ToString(row["SERVIDORPGSQL"]); pgdb = Convert.ToString(row["DBPG"]); pglogin = Convert.ToString(row["LOGINPG"]); pgID = Convert.ToString(row["KEYIDPG"]); XMLRW.write("CONFIGURACION", SSQLserver, SWeb, SSQLserverseg, PGSQLserver, SDMdatabase, SDBExactus, SDBSeguridad, pgdb, SDBWeb, SSQLogin, SSQLoginsg, SMyqlogin, pglogin, SSqlID, SSqlIDsg, SMsqlID, pgID, "", "", "", "", ""); } else if (comboBox1.Text == "18.216.38.163 [ODOO]") { SSQLserver = Convert.ToString(row["SERVIDORSQL"]); SWeb = Convert.ToString(row["SERVIDORWEB"]); SDMdatabase = Convert.ToString(row["DBSQLDM"]); SDBExactus = Convert.ToString(row["DBSQLEX"]); SDBWeb = Convert.ToString(row["DBWEB"]); SSQLogin = Convert.ToString(row["LOGIN"]); SMyqlogin = Convert.ToString(row["LOGINWEB"]); SSqlID = Convert.ToString(row["KEYID"]); SMsqlID = Convert.ToString(row["KEYIDWEB"]); SSQLserverseg = Convert.ToString(row["SERVIDORSQLSEG"]); SDBSeguridad = Convert.ToString(row["DBSQLSG"]); SSQLoginsg = Convert.ToString(row["LOGINSG"]); SSqlIDsg = Convert.ToString(row["KEYIDSG"]); PGSQLserver = textBox1.Text; pgdb = textBox4.Text; pglogin = textBox2.Text; pgID = Encripter.Encriptar(textBox3.Text); XMLRW.write("CONFIGURACION", SSQLserver, SWeb, SSQLserverseg, PGSQLserver, SDMdatabase, SDBExactus, SDBSeguridad, pgdb, SDBWeb, SSQLogin, SSQLoginsg, SMyqlogin, pglogin, SSqlID, SSqlIDsg, SMsqlID, pgID, "", "", "", "", ""); } }