Esempio n. 1
0
        private void button4_Click(object sender, EventArgs e)
        {
            Menucs s = new Menucs();

            s.Show();
            this.Hide();
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            txtUsuario.Text.ToUpper();

            if (txtUsuario.Text == "" && txtContra.Text == "")
            {
                MessageBox.Show("Debe ingresar Usuario y Contraseña");
                txtUsuario.Focus();
            }
            else
            {
                try
                {
                    cn.Open();
                    SqlCommand cmd = new SqlCommand("SELECT * FROM MAEPASSWORD WITH (NOLOCK) WHERE LOGIN='******' AND CLAVE = '" + txtContra.Text + "';", cn);
                    // SqlCommand cmd = new SqlCommand("select * from med_atencion  where fol_ate ='" + txtCargo.Text + "' and num_suc= '" + txtRut.Text + "';", cn);
                    SqlDataReader dr = cmd.ExecuteReader();

                    if (dr.Read())
                    {
                        Globales.gbUsuario = Convert.ToString(dr["LOGIN"]);
                        MessageBox.Show("Bienvenido(a) " + Convert.ToString(dr["NOMBRE"]));


                        Menucs men = new Menucs();
                        men.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Usuario MK no encontrado");
                    }

                    cn.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("error" + ex);

                    cn.Close();
                }
            }
        }