示例#1
0
        public void CompletarCombobox()
        {
            try
            {
                List <String>          cursos         = new List <string>();
                Docente_CursoLogic     dcLog          = new Docente_CursoLogic();
                List <Docentes_Cursos> docentesCursos = new List <Docentes_Cursos>();
                docentesCursos = dcLog.GetCursosPorDocente(Docente.ID);

                foreach (Docentes_Cursos dc in docentesCursos)
                {
                    string curso;

                    CursoLogic cl  = new CursoLogic();
                    Curso      cur = cl.GetOne(dc.IDCurso);

                    ComisionLogic col = new ComisionLogic();
                    Comision      com = col.GetOne(cur.IDComision);

                    MateriaLogic mat     = new MateriaLogic();
                    Materia      materia = mat.GetOne(cur.IDMateria);

                    PlanLogic pl   = new PlanLogic();
                    Plan      plan = pl.GetOne(materia.IDPlan);

                    EspecialidadLogic el           = new EspecialidadLogic();
                    Especialidad      especialidad = el.GetOne(plan.IDEspecialidad);


                    curso = com.Descripcion + " - " + materia.Descripcion + " - " + especialidad.Descripcion + " - " + cur.AnioCalendario.ToString() + " - " + dc.IDCurso.ToString();

                    cursos.Add(curso);
                }

                this.ddlCurso.DataSource = cursos;
                ddlCurso.DataBind();
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('" + ex.Message + "')", true);
            }
        }
示例#2
0
        public void CompletarCombobox()
        {
            try
            {
                List <String>          cursos         = new List <string>();
                Docente_CursoLogic     dcLog          = new Docente_CursoLogic();
                List <Docentes_Cursos> docentesCursos = new List <Docentes_Cursos>();
                docentesCursos = dcLog.GetCursosPorDocente(Docente.ID);

                foreach (Docentes_Cursos dc in docentesCursos)
                {
                    string curso;

                    CursoLogic cl  = new CursoLogic();
                    Curso      cur = cl.GetOne(dc.IDCurso);

                    ComisionLogic col = new ComisionLogic();
                    Comision      com = col.GetOne(cur.IDComision);

                    MateriaLogic mat     = new MateriaLogic();
                    Materia      materia = mat.GetOne(cur.IDMateria);

                    PlanLogic pl   = new PlanLogic();
                    Plan      plan = pl.GetOne(materia.IDPlan);

                    EspecialidadLogic el           = new EspecialidadLogic();
                    Especialidad      especialidad = el.GetOne(plan.IDEspecialidad);


                    curso = com.Descripcion + " - " + materia.Descripcion + " - " + especialidad.Descripcion + " - " + cur.AnioCalendario.ToString() + " - " + dc.IDCurso.ToString();

                    cursos.Add(curso);
                }

                this.cmbCursos.DataSource = cursos;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }