Beispiel #1
0
        public DataTable GetListado()
        {
            List <Materia> materias = MateriaData.GetAll();
            //Se crea el DataTable que va a ser el DataSource del dgv
            DataTable Listado = new DataTable();

            Listado.Columns.Add("ID", typeof(int));
            Listado.Columns.Add("Descripcion", typeof(string));
            Listado.Columns.Add("HSSemanales", typeof(int));
            Listado.Columns.Add("HSTotales", typeof(int));
            Listado.Columns.Add("Plan", typeof(string));

            //Se obtienen las especialidades y los planes para mostrar en la columna Plan = esp.Descripcion + plan.Descripcion
            PlanLogic           pl             = new PlanLogic();
            List <Plan>         planes         = pl.GetAll();
            EspecialidadLogic   el             = new EspecialidadLogic();
            List <Especialidad> especialidades = el.GetAll();

            foreach (Materia mat in materias)
            {
                DataRow Linea = Listado.NewRow();

                Linea["ID"]          = mat.ID;
                Linea["Descripcion"] = mat.Descripcion;
                Linea["HSSemanales"] = mat.HSSemanales;
                Linea["HSTotales"]   = mat.HSTotales;

                Plan         plan = planes.FirstOrDefault(x => x.ID == mat.IDPlan);
                Especialidad esp  = especialidades.FirstOrDefault(x => x.ID == plan.IDEspecialidad);
                Linea["Plan"] = esp.Descripcion + " - " + plan.Descripcion;

                Listado.Rows.Add(Linea);
            }
            return(Listado);
        }
Beispiel #2
0
 private void Planes_Load(object sender, EventArgs e)
 {
     PlanLogic pl = new PlanLogic();
     cmbPlanes.DataSource = pl.GetAll();
     cmbPlanes.DisplayMember = "desc_plan";
     cmbPlanes.ValueMember = "id_plan";
     Listar();
 }
Beispiel #3
0
 public void Listar()
 {
     try
     {
         PlanLogic pl = new PlanLogic();
         this.dgvPlanes.DataSource = pl.GetAll();
     }
     catch (Exception ex)
     {
         this.Notificar("Error", ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #4
0
 private void Listar()
 {
     PlanLogic pl = new PlanLogic();
     cmbPlanes.ValueMember = "id_plan";
     cmbPlanes.DisplayMember = "desc_plan";
     cmbPlanes.DataSource = pl.GetAll();
     ComisionLogic cl = new ComisionLogic();
     cmbComision.ValueMember = "id_comision";
     cmbComision.DisplayMember = "desc_comision";
     cmbComision.DataSource = cl.DameComisiones((int)cmbPlanes.SelectedValue);
     CursoLogic curl=new CursoLogic();
     dgvCursos.DataSource = curl.DameCursos((int)cmbComision.SelectedValue);
 }
        public static List <ReportePlanes> ObtenerPlanes()
        {
            List <ReportePlanes> listaPlanes    = new List <ReportePlanes>();
            PlanLogic            pl             = new PlanLogic();
            EspecialidadLogic    el             = new EspecialidadLogic();
            List <Plan>          planes         = pl.GetAll();
            List <Especialidad>  especialidades = el.GetAll();
            var consultaPlanes =
                from p in planes
                join es in especialidades
                on p.IDEspecialidad equals es.ID
                select new ReportePlanes
            {
                ID           = p.ID,
                Descripcion  = p.Descripcion,
                Especialidad = es.Descripcion
            };

            listaPlanes = consultaPlanes.ToList();
            return(listaPlanes);
        }
 public void Listar()
 {
     EspecialidadLogic e = new EspecialidadLogic();
     this.dgvEspecialidades.DataSource = e.GetAll();
     PlanLogic p = new PlanLogic();
     this.dgvPlanes.DataSource = p.GetAll();
     MateriaLogic m = new MateriaLogic();
     this.dgvMaterias.DataSource = m.GetAll();
     ComisionLogic co = new ComisionLogic();
     this.dgvComisiones.DataSource = co.GetAll();
     CursoLogic cu = new CursoLogic();
     this.dgvCursos.DataSource = cu.GetAll();
     PersonaLogic alu = new PersonaLogic();
     this.dgvAlumnos.DataSource = alu.GetAll(0);
     PersonaLogic pro = new PersonaLogic();
     this.dgvProfesores.DataSource = pro.GetAll(1);
     DocenteCursoLogic dc = new DocenteCursoLogic();
     this.dgvDesignaciones.DataSource = dc.GetAll();
     UsuarioLogic u = new UsuarioLogic();
     this.dgvUsuarios.DataSource = u.GetAll();
 }
 private void LoadDdlPlanes()
 {
     PlanLogic pl = new PlanLogic();
     List<Plan> planes = new List<Plan>();
     foreach (Plan p in pl.GetAll())
     {
         if (p.Especialidad.ID == Convert.ToInt32(this.ddlEspecialidades.SelectedValue))
         {
             planes.Add(p);
         }
     }
     this.ddlPlanes.DataSource = planes;
     this.ddlPlanes.DataTextField = "Descripcion";
     this.ddlPlanes.DataValueField = "ID";
     this.ddlPlanes.DataBind();
     ListItem init = new ListItem();
     init.Text = "--Seleccionar Plan--";
     init.Value = "-1";
     this.ddlPlanes.Items.Add(init);
     this.ddlPlanes.SelectedValue = "-1";
 }
 private void LlenarComboPlanes()
 {
     try
     {
         PlanLogic pl = new PlanLogic();
         List<Plan> planes = new List<Plan>();
         foreach (Plan p in pl.GetAll())
         {
             if (p.Especialidad.ID == Convert.ToInt32(cbxEspecialidades.SelectedValue))
             {
                 planes.Add(p);
             }
         }
         cbxPlanes.DataSource = planes;
         cbxPlanes.DisplayMember = "Descripcion";
         cbxPlanes.ValueMember = "ID";
     }
     catch (Exception ex)
     {
         this.Notificar("Error", ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #9
0
 public List<Plan> getPlanes()
 {
     PlanLogic esp = new PlanLogic();
     this.lstPlan = esp.GetAll();
     return this.lstPlan;
 }
Beispiel #10
0
 public List<Plan> getPlanes(int IDEspecialidad)
 {
     PlanLogic esp = new PlanLogic();
     this.lstPlan = esp.GetAll(IDEspecialidad);
     return this.lstPlan;
 }
Beispiel #11
0
 private void LoadCmbPlanes()
 {
     PlanLogic pl = new PlanLogic();
     this.cmbPlan.DataSource = pl.GetAll();
     this.cmbPlan.DataTextField = "DescCompleta";
     this.cmbPlan.DataValueField = "ID";
     this.cmbPlan.DataBind();
 }
Beispiel #12
0
        public void Listar()
        {
            PlanLogic PL = new PlanLogic();

            this.dgvPlan.DataSource = PL.GetAll();
        }
Beispiel #13
0
 private void MateriaDesktop_Load(object sender, EventArgs e)
 {
     PlanLogic pl = new PlanLogic();
     cmbPlanes.DataSource = pl.GetAll();
     cmbPlanes.DisplayMember = "desc_plan";
     cmbPlanes.ValueMember = "id_plan";
     if (MateriaActual != null)
     {
         this.cmbPlanes.SelectedValue = (this.MateriaActual.IDPlan).ToString();
         this.cmbPlanes.Enabled = false;
     }
 }
Beispiel #14
0
 public void Listar()
 {
     PlanLogic ul = new PlanLogic();
     this.dgvPlanes.DataSource = ul.GetAll();
 }
        public DataTable GetListado(Usuario user)
        {
            List <Curso> cursos = new List <Curso>();

            if ((int)user.TipoPersona == 2)
            {
                DocenteCursoLogic   dcl    = new DocenteCursoLogic();
                List <DocenteCurso> dclist = dcl.GetAllFromUser(user.ID);

                foreach (DocenteCurso dc in dclist)
                {
                    cursos.Add(CursoData.GetOne(dc.IDCurso));
                }
            }
            else
            {
                cursos = CursoData.GetAll();
            }

            //Se crea el DataTable que va a ser el DataSource del dgv
            DataTable Listado = new DataTable();

            Listado.Columns.Add("ID", typeof(int));
            Listado.Columns.Add("AnioCalendario", typeof(int));
            Listado.Columns.Add("Cupo", typeof(int));
            Listado.Columns.Add("Materia", typeof(string));
            Listado.Columns.Add("Comision", typeof(string));
            Listado.Columns.Add("Plan", typeof(string));

            //La columna materia mostrara materia.Descripcion
            //La columna comision mostrara comision.Descripcion
            //La columna plan mostrara especialidad.Descripcion + plan.Descripcion
            //En vez de mostrar los ID's que aportan poca informacion
            PlanLogic           pl             = new PlanLogic();
            List <Plan>         planes         = pl.GetAll();
            EspecialidadLogic   el             = new EspecialidadLogic();
            List <Especialidad> especialidades = el.GetAll();
            MateriaLogic        ml             = new MateriaLogic();
            List <Materia>      materias       = ml.GetAll();
            ComisionLogic       coml           = new ComisionLogic();
            List <Comision>     comisiones     = coml.GetAll();

            foreach (Curso cur in cursos)
            {
                DataRow Linea = Listado.NewRow();

                Linea["ID"]             = cur.ID;
                Linea["AnioCalendario"] = cur.AnioCalendario.ToString();
                Linea["Cupo"]           = cur.Cupo;

                Comision com = comisiones.FirstOrDefault(x => x.ID == cur.IDComision);
                Linea["Comision"] = com.Descripcion;

                Materia      materia = materias.FirstOrDefault(x => x.ID == cur.IDMateria);
                Plan         plan    = planes.FirstOrDefault(x => x.ID == materia.IDPlan);
                Especialidad esp     = especialidades.FirstOrDefault(x => x.ID == plan.IDEspecialidad);
                Linea["Materia"] = materia.Descripcion;
                Linea["Plan"]    = esp.Descripcion + " - " + plan.Descripcion;

                Listado.Rows.Add(Linea);
            }
            return(Listado);
        }