Exemplo n.º 1
0
        public Lista_Curso buscaLista_Curso(string IdListaCurso)
        {
            Lista_Curso auxLista_Curso = new Lista_Curso();

            this.configurarConexion();
            this.Conec1.CadenaSQL = "SELECT * FROM Lista_Curso " +
                                    " WHERE IdListaCurso = '" + IdListaCurso + "';";
            this.Conec1.EsSelect = true;
            this.Conec1.conectar();
            DataTable dt = new DataTable();

            dt = this.Conec1.DbDataSet.Tables[this.Conec1.NombreTabla];

            try
            {
                auxLista_Curso.IdListaCurso = (String)dt.Rows[0]["IdListaCurso"];
                auxLista_Curso.Rut          = (String)dt.Rows[0]["Rut"];
                auxLista_Curso.Cod_Curso    = (String)dt.Rows[0]["Cod_Curso"];
                auxLista_Curso.Ano          = (int)dt.Rows[0]["Año"];
                auxLista_Curso.Semestre     = (String)dt.Rows[0]["Semestre"];
            }
            catch (Exception ex)
            {
                auxLista_Curso.IdListaCurso = String.Empty;
                auxLista_Curso.Rut          = String.Empty;

                auxLista_Curso.Cod_Curso = String.Empty;
                auxLista_Curso.Ano       = 0;
                auxLista_Curso.Semestre  = "";
            }

            return(auxLista_Curso);
        }
Exemplo n.º 2
0
 public void ingresaLista_Curso(Lista_Curso lista_Curso)
 {
     this.configurarConexion();
     this.Conec1.CadenaSQL = "INSERT INTO Lista_Curso (IdListaCurso, Rut, Cod_Curso, Año, Semestre) " +
                             " VALUES ('" + lista_Curso.IdListaCurso + "','" + lista_Curso.Rut + "','" + lista_Curso.Cod_Curso + "','" + lista_Curso.Ano + "','" + lista_Curso.Semestre + "');";
     this.Conec1.EsSelect = false;
     this.Conec1.conectar();
 }
Exemplo n.º 3
0
 public void actualizarLista_Curso(Lista_Curso lista_Curso)
 {
     this.configurarConexion();
     this.Conec1.CadenaSQL = "UPDATE Lista_Curso set Rut = '" +
                             lista_Curso.Rut +
                             "', Cod_Curso = '" + lista_Curso.Cod_Curso +
                             "', Año = '" + lista_Curso.Ano +
                             "', Semestre = '" + lista_Curso.Semestre +
                             "' WHERE IdListaCurso = '" + lista_Curso.IdListaCurso + "';";
     this.Conec1.EsSelect = false;
     this.Conec1.conectar();
 }
Exemplo n.º 4
0
        private void txtIdListaCurso_Leave(object sender, EventArgs e)
        {
            ngLista_Curso ncar  = new ngLista_Curso();
            Lista_Curso   ncar2 = new Lista_Curso();

            ncar2 = ncar.buscaLista_Curso(txtIdListaCurso.Text);
            if (String.IsNullOrEmpty(Convert.ToString(ncar2.IdListaCurso)))
            {
                return;
            }
            else
            {
                txtIdListaCurso.Text       = Convert.ToString(ncar2.IdListaCurso);
                txtAno.Text                = Convert.ToString(ncar2.Ano);
                txtSemestre.Text           = ncar2.Semestre;
                cmbAlumno.SelectedValue    = ncar2.Rut;
                cmbCod_Curso.SelectedValue = ncar2.Cod_Curso;
            }
        }
Exemplo n.º 5
0
        public List <Lista_Curso> retornaLista_Curso()
        {
            List <Lista_Curso> auxListadoLista_Curso = new List <Lista_Curso>();

            this.configurarConexion();
            this.Conec1.CadenaSQL = "SELECT * FROM Lista_Curso";
            this.Conec1.EsSelect  = true;
            this.Conec1.conectar();

            foreach (DataRow dr in this.Conec1.DbDataSet.Tables[this.Conec1.NombreTabla].Rows)
            {
                Lista_Curso auxLista_Curso = new Lista_Curso();
                auxLista_Curso.IdListaCurso = (String)dr["IdListaCurso"];
                auxLista_Curso.Rut          = (String)dr["Rut"];

                auxLista_Curso.Cod_Curso = (String)dr["Cod_Curso"];
                auxLista_Curso.Ano       = (int)dr["Ano"];
                auxLista_Curso.Semestre  = (String)dr["Semestre"];
                auxListadoLista_Curso.Add(auxLista_Curso);
            } //Fin for


            return(auxListadoLista_Curso);
        }