示例#1
0
        private void btn_salir_Click(object sender, EventArgs e)
        {
            this.Close();
            Form formulario = new VoBo();

            formulario.Show();
        }
示例#2
0
        private void pictureBox10_Click(object sender, EventArgs e)
        {
            this.Close();
            Form formulario = new VoBo();

            formulario.Show();
        }
示例#3
0
        public void loguear(string user, string pass)
        {
            try
            {
                con.Open();
                MySqlCommand cmd = new MySqlCommand("Select Identificacion,nombre, CE from tf_usuarios where Identificacion=@Identificacion and Contraseña=@Contraseña", con);
                cmd.Parameters.AddWithValue("@Identificacion", user);
                cmd.Parameters.AddWithValue("@Contraseña", pass);
                MySqlDataAdapter sda = new MySqlDataAdapter(cmd);
                DataTable        dt  = new DataTable();
                sda.Fill(dt);

                if (dt.Rows.Count == 1)
                {
                    this.Hide();
                    MessageBox.Show("Bienvenido !! " + dt.Rows[0][1].ToString());
                    usuario.Identificacion = dt.Rows[0][0].ToString();
                    usuario.Nombre         = dt.Rows[0][1].ToString();
                    usuario.CE             = dt.Rows[0][2].ToString();
                    Form formulario = new VoBo();
                    formulario.Show();
                }
                else
                {
                    MessageBox.Show("Usuario y/o Contraseña incorrectos");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                con.Close();
            }
        }