Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Intro i = new Intro();

            this.Hide();
            i.ShowDialog();
        }
Example #2
0
 private void BtnEntrar_Click(object sender, EventArgs e)
 {
     LblInfo.Text = "";
     try {
         MySqlConnection con = conectarBD();
         con.Open();
         MySqlCommand cmd = con.CreateCommand();
         cmd.CommandText = "select * from infoInquilino where curp='" + TxtUsuario.Text.Trim() + "' and pass='******'";
         MySqlDataReader dr = cmd.ExecuteReader();
         if (dr.HasRows == false)
         {
             LblInfo.Text = "No exite el usuario, VERIFICAR los datos.";
             con.Close();
             return;
         }
         else
         {
             dr.Read();
             int    rol    = Convert.ToInt32(dr["rol_idrol"]);
             string nombre = dr["nombre"].ToString();
             dr.Close();
             con.Close();
             LblInfo.Text = "BIENVENIDO " + nombre;
             curp         = TxtUsuario.Text;
             if (rol == 1)
             {
                 InicioAdmin ia = new InicioAdmin();
                 this.Hide();
                 ia.ShowDialog();
             }
             if (rol == 2)
             {
                 Intro ia = new Intro();
                 this.Hide();
                 ia.ShowDialog();
             }
         }
     } catch (MySqlException ex) {
         LblInfo.Text = "Se produjo un problema por : " + ex.Message;
     }
 }