Beispiel #1
0
        private void mostrardatos()
        {
            Registros registro = new Registros();
            registro  reg      = registro.obtenerPorid(this.textidCliente.Text);

            if (reg.id != "")
            {
                this.textNombre.Text    = reg.Nombre;
                this.textApell_p.Text   = reg.Apell_P;
                this.textApell_m.Text   = reg.Apell_M;
                this.textEstado.Text    = reg.Estado;
                this.textMunicipio.Text = reg.Municipio;
                this.textColonia.Text   = reg.Colonia;
                this.textCalle.Text     = reg.Calle;
                this.textNumExt.Text    = reg.NumExt;
                this.textNumInt.Text    = reg.NumInt;
                this.textCP.Text        = reg.CP;
                this.textTelefono.Text  = reg.Telefono;
                this.textCorreo.Text    = reg.Correo;
                this.textRFC.Text       = reg.RFC;
            }
        }
 public registro obtenerPorId(string id)
 {
     this.abrirConexion();
     MySqlCommand myCommand = new MySqlCommand("SELECT * FROM alumno WHERE id = '" + id + "'",
                                               this.myConnection);
     MySqlDataReader myReader = myCommand.ExecuteReader();
     registro registro = new registro();
     if (myReader.HasRows)
     {
         myReader.Read();
         registro.id = myReader["id"].ToString();
         registro.nombre = myReader["nobre"].ToString();
         registro.apellp = myReader["apellp"].ToString();
         registro.apellm = myReader["apellm"].ToString();
         registro.telefono = myReader["telefono"].ToString();
         registro.correo = myReader["correo"].ToString();
         registro.calle = myReader["calle"].ToString();
         registro.numInt = myReader["numint"].ToString();
         registro.numExt = myReader["numInt"].ToString();
         registro.codigoPos = myReader["codigoPos"].ToString();
         registro.colonia = myReader["colonia"].ToString();
         registro.estado = myReader["estado"].ToString();
         registro.municipio = myReader["municipio"].ToString();
     }
     myReader.Close();
     myReader = null;
     myCommand.Dispose();
     myCommand = null;
     this.cerrarConexion();
     return registro;
 }
Beispiel #3
0
        public registro obtenerPorid(string id)
        {
            this.abrirConexion();
            MySqlCommand myCommand = new MySqlCommand("SELECT * FROM cliente WHERE id_Cliente = '" + id + "'",
                                                      this.myConnection);
            MySqlDataReader myReader = myCommand.ExecuteReader();
            registro registro = new registro();
            if (myReader.HasRows)
            {
                myReader.Read();

                registro.id = myReader["id_Cliente"].ToString();
                registro.Nombre = myReader["Nombre"].ToString();
                registro.Apell_P = myReader["Apell_P"].ToString();
                registro.Apell_M = myReader["Apell_M"].ToString();
                registro.Estado = myReader["Estado"].ToString();
                registro.Municipio = myReader["Municipio"].ToString();
                registro.Colonia = myReader["Colonia"].ToString();
                registro.Calle = myReader["Calle"].ToString();
                registro.NumExt = myReader["NumExt"].ToString();
                registro.NumInt = myReader["numInt"].ToString();
                registro.CP = myReader["CP"].ToString();
                registro.Telefono = myReader["Telefono"].ToString();
                registro.Correo = myReader["Correo"].ToString();
                registro.RFC = myReader["RFC"].ToString();
            }

            myReader.Close();
            myReader = null;
            myCommand.Dispose();
            myCommand = null;
            this.cerrarConexion();
            return registro;
        }
        public ArrayList Mostrar()
        {
            this.abrirConexion();
            MySqlCommand myCommand = new MySqlCommand(this.querySelect(), this.myConnection);

            MySqlDataReader myReader = myCommand.ExecuteReader();

            ArrayList registros = new ArrayList();
            while (myReader.Read())
            {

                registro registro = new registro();
                registro.id = myReader["id"].ToString();
                registro.nombre = myReader["nombre"].ToString();
                registro.apellp = myReader["apellp"].ToString();
                registro.apellm = myReader["apellm"].ToString();
                registro.telefono = myReader["telefono"].ToString();
                registro.correo = myReader["correo"].ToString();
                registro.calle = myReader["calle"].ToString();
                registro.numInt = myReader["numint"].ToString();
                registro.numExt = myReader["numInt"].ToString();
                registro.codigoPos = myReader["codigoPos"].ToString();
                registro.colonia = myReader["colonia"].ToString();
                registro.estado = myReader["estado"].ToString();
                registro.municipio = myReader["municipio"].ToString();
                registros.Add(registro);

            }
            myReader.Close();
            myReader = null;
            myCommand.Dispose();
            myCommand = null;
            this.cerrarConexion();
            return registros;
        }
Beispiel #5
0
        public ArrayList Mostrar()
        {
            this.abrirConexion();
            MySqlCommand myCommand = new MySqlCommand(this.querySelect(), this.myConnection);

            MySqlDataReader myReader = myCommand.ExecuteReader();

            ArrayList registros = new ArrayList();
            while (myReader.Read())
            {

                registro registro = new registro();
                registro.id = myReader["id"].ToString();
                registro.Nombre = myReader["Nombre"].ToString();
                registro.Apell_P = myReader["Apellp"].ToString();
                registro.Apell_M = myReader["Apellm"].ToString();
                registro.Estado = myReader["Estado"].ToString();
                registro.Municipio = myReader["Nunicipio"].ToString();
                registro.Colonia = myReader["Colonia"].ToString();
                registro.Calle = myReader["Calle"].ToString();
                registro.NumExt = myReader["NumExt"].ToString();
                registro.NumInt = myReader["NumInt"].ToString();
                registro.Telefono = myReader["Telefono"].ToString();
                registro.Correo = myReader["Correo"].ToString();
                registro.CP = myReader["CP"].ToString();
                registros.Add(registro);

            }
            myReader.Close();
            myReader = null;
            myCommand.Dispose();
            myCommand = null;
            this.cerrarConexion();
            return registros;
        }