private void cerrarX(object sender, EventArgs e) { FrmPrincipal frmPrincipal = new FrmPrincipal(); this.Hide(); frmPrincipal.Show(); }
/* * private void temporizador_Tick(object sender, EventArgs e) * { * TimeSpan ts = new TimeSpan(0, 0, 0, 0, (int)cronometro.ElapsedMilliseconds); * * thora.Text = ts.Hours.ToString().Length < 2 ? "0" + ts.Hours.ToString() : ts.Hours.ToString(); * tminuto.Text = ts.Minutes.ToString().Length < 2 ? "0" + ts.Minutes.ToString() : ts.Minutes.ToString(); * tsegundo.Text = ts.Seconds.ToString().Length < 2 ? "0" + ts.Seconds.ToString() : ts.Seconds.ToString(); * * } */ private void modoAplicacionToolStripMenuItem_Click(object sender, EventArgs e) { FrmPrincipal frmPrincipal = new FrmPrincipal(); this.Close(); frmPrincipal.Show(); }
private void maximizar_Click(object sender, EventArgs e) { FrmPrincipal frmPrincipal = new FrmPrincipal(); this.Close(); frmPrincipal.Show(); }
private void button1_Click(object sender, EventArgs e) { NLogin login = new NLogin(); //sacamos el hostname //String hostName = Dns.GetHostName(); //Console.WriteLine(hostName); try { con.Open(); SqlCommand query = new SqlCommand("select count(*) as existe from tecnicos where usuario=@usuario and password=@password", con); query.Parameters.AddWithValue("@usuario", usuario.Text); query.Parameters.AddWithValue("@password", password.Text); //para el comando String existe = ""; using (SqlDataReader oReader = query.ExecuteReader()) { while (oReader.Read()) { existe = oReader["existe"].ToString(); } } if (existe.Equals("1")) { //Console.WriteLine(usuario.Text); FrmPrincipal principal = new FrmPrincipal(); //principal.prueba(usuario.Text); //DLogin.usuario= usuario.Text; NLogin nl = new NLogin(); nl.informacionLogin(usuario.Text, "aqui ira la base de datos"); //Console.WriteLine(DLogin.tecnico+ "<- estamos en login y este es el tecnico"); this.Hide(); //principal.Login = login.informacionLogin("prueba","basedeprueba"); //principal.Nombreusuario = login.informacionLogin(usuario.Text); // principal.Nombreusuario = "cristobal"; principal.Show(); } con.Close(); } catch (Exception) { Console.WriteLine("ecxcep"); } }
private void button1_Click(object sender, EventArgs e) { NLogin login = new NLogin(); if (login.logueo(usuario.Text, Dns.GetHostName())) { DLoginStatico.sacaTecnico(usuario.Text); FrmPrincipal principal = new FrmPrincipal(); DLoginStatico.usuario = usuario.Text; principal.Show(); this.Hide(); } ; //sacamos el hostname //String hostName = ; //Console.WriteLine(hostName); }
private void button1_Click(object sender, EventArgs e) { //sacamos el hostname String hostName = Dns.GetHostName(); Console.WriteLine(hostName); try { con.Open(); SqlCommand query = new SqlCommand("select count(*) as existe from Empleados where usuario=@usuario and maquina=@hostname", con); query.Parameters.AddWithValue("@usuario", usuario.Text); query.Parameters.AddWithValue("@hostname", hostName); //para el comando String existe = ""; using (SqlDataReader oReader = query.ExecuteReader()) { while (oReader.Read()) { existe = oReader["existe"].ToString(); } } if (existe.Equals("1")) { FrmPrincipal principal = new FrmPrincipal(); this.Hide(); principal.Show(); } con.Close(); } catch (Exception) { } }