protected void btn_desinscribir_Click(object sender, EventArgs e)
        {
            if (gv_profesionales.SelectedRow != null)
            {
                prof_dni = gv_profesionales.SelectedRow.Cells[1].Text;
                oProfesional = cProfesional.ObtenerProfesional(Convert.ToInt32(prof_dni));

                foreach (Modelo_Entidades.Clase oClase in cClase.ObtenerClasesPorCurso(Convert.ToInt32(curso_id)))
                {
                    oAsistencia = cAsistencia.ObtenerAsistenciaPorProfyCurso(Convert.ToInt32(prof_dni), Convert.ToInt32(curso_id));
                    cAsistencia.EliminarAsistencia(oAsistencia);
                }

                curso_id = Request.QueryString["parametro1"];
                oCurso = cCurso.ObtenerCurso(Convert.ToInt32(curso_id));
                oCurso.asistentes = oCurso.asistentes - 1;
                cCurso.ModificarCurso(oCurso);

                lb_inscripcion.Visible = true;
                lb_inscripcion.Text = "El profesional se ha desinscripto exitosamente y la desinscricion se ha restado a los asistentes del curso";
            }

            else
            {
                lb_mensaje.Visible = true;
                lb_mensaje.Text = "DEBE SELECCIONAR UN PROFESIONAL";
            }
        }
        protected void btn_baja_Click(object sender, EventArgs e)
        {
            if (gv_cursos.SelectedRow != null)
            {
                curso_id = gv_cursos.SelectedRow.Cells[1].Text;
                oCurso = cCurso.ObtenerCurso(Convert.ToInt32(curso_id));
                foreach (Modelo_Entidades.Clase oClase in cClase.ObtenerClasesPorCurso(oCurso.id))
                {
                    foreach (Modelo_Entidades.Asistencia oAsistencia in cAsistencia.ObtenerAsistenciasPorCurso(Convert.ToInt32(oCurso.id)))
                    {
                        cAsistencia.EliminarAsistencia(oAsistencia);
                    }

                    cClase.EliminarClase(oClase);
                }
                cCurso.EliminarCurso(oCurso);
                Response.Redirect("~/Cursos/Tablero Cursos.aspx?&parametro1=" + comision_id);
            }

            else
            {
                lb_mensaje.Visible = true;
                lb_mensaje.Text = "DEBE SELECCIONAR UNA CURSO";
            }
        }
        protected void btn_inscribir_Click(object sender, EventArgs e)
        {
            if (gv_profesionales.SelectedRow != null)
            {
                prof_dni     = gv_profesionales.SelectedRow.Cells[1].Text;
                oProfesional = cProfesional.ObtenerProfesional(Convert.ToInt32(prof_dni));

                // Inscribo al profesional en todas las clases de un curso dado
                foreach (Modelo_Entidades.Clase oClase in cClase.ObtenerClasesPorCurso(Convert.ToInt32(curso_id)))
                {
                    oAsistencia             = new Modelo_Entidades.Asistencia();
                    oAsistencia.presente    = false;
                    oAsistencia.Profesional = oProfesional;
                    oAsistencia.Clase       = oClase;
                    cAsistencia.AgregarAsistencia(oAsistencia);
                }

                curso_id          = Request.QueryString["parametro1"];
                oCurso            = cCurso.ObtenerCurso(Convert.ToInt32(curso_id));
                oCurso.asistentes = oCurso.asistentes + 1;
                cCurso.ModificarCurso(oCurso);

                lb_inscripcion.Visible = true;
                lb_inscripcion.Text    = "El profesional se ha inscripto exitosamente y la inscricion se ha sumado a los asistentes del curso";
            }

            else
            {
                lb_mensaje.Visible = true;
                lb_mensaje.Text    = "DEBE SELECCIONAR UN PROFESIONAL";
            }
        }
Example #4
0
        protected void btn_baja_Click(object sender, EventArgs e)
        {
            if (gv_cursos.SelectedRow != null)
            {
                curso_id = gv_cursos.SelectedRow.Cells[1].Text;
                oCurso   = cCurso.ObtenerCurso(Convert.ToInt32(curso_id));
                foreach (Modelo_Entidades.Clase oClase in cClase.ObtenerClasesPorCurso(oCurso.id))
                {
                    foreach (Modelo_Entidades.Asistencia oAsistencia in cAsistencia.ObtenerAsistenciasPorCurso(Convert.ToInt32(oCurso.id)))
                    {
                        cAsistencia.EliminarAsistencia(oAsistencia);
                    }

                    cClase.EliminarClase(oClase);
                }
                cCurso.EliminarCurso(oCurso);
                Response.Redirect("~/Cursos/Tablero Cursos.aspx?&parametro1=" + comision_id);
            }

            else
            {
                lb_mensaje.Visible = true;
                lb_mensaje.Text    = "DEBE SELECCIONAR UNA CURSO";
            }
        }
        protected void btn_desinscribir_Click(object sender, EventArgs e)
        {
            if (gv_profesionales.SelectedRow != null)
            {
                prof_dni     = gv_profesionales.SelectedRow.Cells[1].Text;
                oProfesional = cProfesional.ObtenerProfesional(Convert.ToInt32(prof_dni));

                foreach (Modelo_Entidades.Clase oClase in cClase.ObtenerClasesPorCurso(Convert.ToInt32(curso_id)))
                {
                    oAsistencia = cAsistencia.ObtenerAsistenciaPorProfyCurso(Convert.ToInt32(prof_dni), Convert.ToInt32(curso_id));
                    cAsistencia.EliminarAsistencia(oAsistencia);
                }

                curso_id          = Request.QueryString["parametro1"];
                oCurso            = cCurso.ObtenerCurso(Convert.ToInt32(curso_id));
                oCurso.asistentes = oCurso.asistentes - 1;
                cCurso.ModificarCurso(oCurso);

                lb_inscripcion.Visible = true;
                lb_inscripcion.Text    = "El profesional se ha desinscripto exitosamente y la desinscricion se ha restado a los asistentes del curso";
            }

            else
            {
                lb_mensaje.Visible = true;
                lb_mensaje.Text    = "DEBE SELECCIONAR UN PROFESIONAL";
            }
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Instancio las controladoras
            clase_id = Request.QueryString["parametro1"];
            accion   = Request.QueryString["parametro2"];
            curso_id = Request.QueryString["parametro3"];

            cCurso = Controladora.cCurso.ObtenerInstancia();
            cClase = Controladora.cClase.ObtenerInstancia();

            if (!(Page.IsPostBack)) // Lo que esta aca carga cuando solamente carga la página
            {
                if (accion != "Alta")
                {
                    //Recibo el id de la Curso

                    // Busco el surso y la clase
                    oCurso = cCurso.ObtenerCurso(Convert.ToInt32(curso_id));
                    oClase = cClase.ObtenerClase(Convert.ToInt32(clase_id));

                    // Asigno las variables a los controles

                    if (accion == "Consultar")
                    {
                        // Deshabilito los controles
                        txt_fecha.Enabled = false;
                    }

                    txt_fecha.Text = oClase.fecha.ToShortDateString();
                }
            }

            else
            {
                if (ValidarObligatorios() == true)
                {
                    if (accion == "Alta")
                    {
                        curso_id     = Request.QueryString["parametro3"];
                        oClase       = new Modelo_Entidades.Clase();
                        oClase.fecha = Convert.ToDateTime(txt_fecha.Text);
                        oCurso       = cCurso.ObtenerCurso(Convert.ToInt32(curso_id));
                        oClase.Curso = oCurso;
                        cClase.AgregarClase(oClase);
                    }

                    if (accion == "Modificar")
                    {
                        clase_id     = Request.QueryString["parametro1"];
                        oClase       = cClase.ObtenerClase(Convert.ToInt32(clase_id));
                        oClase.fecha = Convert.ToDateTime(txt_fecha.Text);
                        cClase.ModificarClase(oClase);
                    }
                }

                Response.Redirect("~/Clases/Tablero Clases.aspx?parametro1=" + curso_id);
            }
        }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Instancio las controladoras
            clase_id = Request.QueryString["parametro1"];
            accion = Request.QueryString["parametro2"];
            curso_id = Request.QueryString["parametro3"];

            cCurso = Controladora.cCurso.ObtenerInstancia();
            cClase = Controladora.cClase.ObtenerInstancia();

            if (!(Page.IsPostBack)) // Lo que esta aca carga cuando solamente carga la página
            {
                if (accion != "Alta")
                {
                    //Recibo el id de la Curso

                    // Busco el surso y la clase
                    oCurso = cCurso.ObtenerCurso(Convert.ToInt32(curso_id));
                    oClase = cClase.ObtenerClase(Convert.ToInt32(clase_id));

                    // Asigno las variables a los controles

                    if (accion == "Consultar")
                    {
                        // Deshabilito los controles
                        txt_fecha.Enabled = false;
                    }

                    txt_fecha.Text = oClase.fecha.ToShortDateString();
                }
            }

            else
            {
                if (ValidarObligatorios() == true)
                {
                    if (accion == "Alta")
                    {
                        curso_id = Request.QueryString["parametro3"];
                        oClase = new Modelo_Entidades.Clase();
                        oClase.fecha = Convert.ToDateTime(txt_fecha.Text);
                        oCurso = cCurso.ObtenerCurso(Convert.ToInt32(curso_id));
                        oClase.Curso = oCurso;
                        cClase.AgregarClase(oClase);
                    }

                    if (accion == "Modificar")
                    {
                        clase_id = Request.QueryString["parametro1"];
                        oClase = cClase.ObtenerClase(Convert.ToInt32(clase_id));
                        oClase.fecha = Convert.ToDateTime(txt_fecha.Text);
                        cClase.ModificarClase(oClase);
                    }
                }

                Response.Redirect("~/Clases/Tablero Clases.aspx?parametro1=" + curso_id);
            }
        }
Example #8
0
        // Obtengo un curso dado su id
        public Modelo_Entidades.Curso ObtenerCurso(int id)
        {
            Modelo_Entidades.Curso oCurso = oModelo_Entidades.Cursos.ToList().Find(delegate(Modelo_Entidades.Curso fCurso)
            {
                return(fCurso.id == id);
            });

            return(oCurso);
        }
Example #9
0
 // Elimino a un titulo
 public void EliminarCurso(Modelo_Entidades.Curso oCurso)
 {
     oModelo_Entidades.DeleteObject(oCurso);
     oModelo_Entidades.SaveChanges();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            lb_mensaje.Visible     = false;
            lb_inscripcion.Visible = false;
            lb_curso.Visible       = false;
            lb_profesionales_inscriptos.Visible = false;

            curso_id    = Request.QueryString["parametro1"];
            accion      = Request.QueryString["parametro2"];
            comision_id = Request.QueryString["parametro3"];

            cProfesional = Controladora.cProfesional.ObtenerInstancia();
            cAsistencia  = Controladora.cAsistencia.ObtenerInstancia();
            cClase       = Controladora.cClase.ObtenerInstancia();
            cCurso       = Controladora.cCurso.ObtenerInstancia();

            if (accion == "Inscripcion")
            {
                lb_mensaje2.Text               = "Aquí puede visualizar si los profesionales se encuentran habilitados (color verde), o No Habilitados o tiene suspendida la matrícula (color rojo)";
                btn_desinscribir.Visible       = false;
                btn_asentar_asistencia.Visible = false;
                gv_profesionales.DataSource    = cProfesional.ObtenerProfesionales();
                gv_profesionales.DataBind();

                for (int i = 0; gv_profesionales.Rows.Count > i; i++)
                {
                    Modelo_Entidades.Profesional oProf = cProfesional.ObtenerProfesional((Convert.ToInt32(gv_profesionales.Rows[i].Cells[1].Text)));

                    if (oProf.Estado.descripcion == "Habilitado")
                    {
                        gv_profesionales.Rows[i].Cells[0].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[1].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[2].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[3].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[4].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[5].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[6].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[7].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[8].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[9].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[10].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[11].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[12].BackColor = Color.LightGreen;
                    }

                    if (oProf.Estado.descripcion == "No Habilitado" || oProf.Estado.descripcion == "Baja")
                    {
                        gv_profesionales.Rows[i].Cells[0].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[1].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[2].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[3].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[4].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[5].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[6].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[7].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[8].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[9].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[10].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[11].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[12].BackColor = Color.LightCoral;
                    }
                }
            }

            else
            {
                lb_mensaje2.Text = "Aquí puede visualizar si los profesionales han asistido más de un 75% a la clase (color verde), entre un 50 y un 75% (color amarillo) y menos de un 50% (color rojo)";
                lb_profesionales_inscriptos.Visible = true;
                lb_curso.Visible            = true;
                oCurso                      = cCurso.ObtenerCurso(Convert.ToInt32(curso_id));
                lb_curso.Text               = oCurso.descripcion;
                oClase                      = cClase.Obtener1ClasePorCurso(Convert.ToInt32(curso_id));
                gv_profesionales.DataSource = cProfesional.ObtenerProfesionalesPorCurso(oClase.id);
                gv_profesionales.DataBind();

                for (int i = 0; gv_profesionales.Rows.Count > i; i++)
                {
                    Modelo_Entidades.Profesional       oProf            = cProfesional.ObtenerProfesional((Convert.ToInt32(gv_profesionales.Rows[i].Cells[1].Text)));
                    List <Modelo_Entidades.Asistencia> ListaAsistencias = cAsistencia.ObtenerAsistenciasPorCursoyProfesional(oProf.dni, Convert.ToInt32(curso_id));
                    int asitencias = ListaAsistencias.Count;
                    List <Modelo_Entidades.Clase> ListaClases = cClase.ObtenerClasesPorCurso(Convert.ToInt32(curso_id));
                    int    clases    = ListaClases.Count;
                    double resultado = (asitencias * 100) / clases;

                    if (resultado >= 75)
                    {
                        gv_profesionales.Rows[i].Cells[0].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[1].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[2].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[3].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[4].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[5].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[6].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[7].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[8].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[9].BackColor  = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[10].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[11].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[12].BackColor = Color.LightGreen;
                    }

                    if (50 <= resultado && resultado < 75)
                    {
                        gv_profesionales.Rows[i].Cells[0].BackColor  = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[1].BackColor  = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[2].BackColor  = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[3].BackColor  = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[4].BackColor  = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[5].BackColor  = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[6].BackColor  = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[7].BackColor  = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[8].BackColor  = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[9].BackColor  = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[10].BackColor = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[11].BackColor = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[12].BackColor = Color.Yellow;
                    }

                    if (resultado < 50)
                    {
                        gv_profesionales.Rows[i].Cells[0].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[1].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[2].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[3].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[4].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[5].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[6].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[7].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[8].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[9].BackColor  = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[10].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[11].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[12].BackColor = Color.LightCoral;
                    }
                }

                if (accion == "Asistencia")
                {
                    btn_inscribir.Visible    = false;
                    btn_desinscribir.Visible = false;
                }

                if (accion == "Inscripcion")
                {
                    btn_asentar_asistencia.Visible = false;
                    btn_desinscribir.Visible       = false;
                }

                if (accion == "Desinscripcion")
                {
                    btn_inscribir.Visible          = false;
                    btn_asentar_asistencia.Visible = false;
                }

                if (accion == "Ver")
                {
                    btn_inscribir.Visible          = false;
                    btn_desinscribir.Visible       = false;
                    btn_asentar_asistencia.Visible = false;
                }
            }

            gv_profesionales.HeaderRow.Cells[0].Text = "Selección";
            gv_profesionales.HeaderRow.Cells[1].Text = "DNI";
            gv_profesionales.HeaderRow.Cells[2].Text = "Nombre y Apellido";
            gv_profesionales.HeaderRow.Cells[5].Text = "Teléfono";
            gv_profesionales.HeaderRow.Cells[6].Text = "Celular";
            gv_profesionales.HeaderRow.Cells[7].Text = "Email 1";
            gv_profesionales.HeaderRow.Cells[8].Text = "Email 2";
        }
Example #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Instancio las controladoras
            cCurso = Controladora.cCurso.ObtenerInstancia();
            cDoncete = Controladora.cDocente.ObtenerInstancia();
            cComision = Controladora.cComision.ObtenerInstancia();
            cClase = Controladora.cClase.ObtenerInstancia();

            id_Curso = Request.QueryString["parametro1"];
            accion = Request.QueryString["parametro2"];
            id_comision = Request.QueryString["parametro3"];

            if (!(Page.IsPostBack)) // Lo que esta aca carga cuando solamente carga la página
            {
                ddl_doncentes.DataSource = cDoncete.ObtenerDocentes();
                ddl_doncentes.DataTextField = "nombre_apellido";
                ddl_doncentes.DataBind();

                ddl_comision.DataSource = cComision.ObtenerComisiones();
                ddl_comision.DataTextField = "descripcion";
                ddl_comision.DataBind();

                // Según la accion habilito o deshabilito los controles
                if (accion != "Alta")
                {
                        // Busco la comisión
                        id_Curso = Request.QueryString["parametro1"];
                        oCurso = cCurso.ObtenerCurso(Convert.ToInt32(id_Curso));
                        // Asigno las variables a los controles
                        lb_Curso.Text = oCurso.descripcion;
                        txt_nombre.Text = oCurso.descripcion;
                        txt_objetivo.Text = oCurso.objetivo.ToString();
                        if (oCurso.arancelado == false)
                        {
                            chk_arancelado.Checked = false;
                        }
                        else
                        {
                            chk_arancelado.Checked = true;
                        }
                        txt_costo.Text = oCurso.costo.ToString();
                        ddl_doncentes.SelectedValue = oCurso.Docente.nombre_apellido;
                        ddl_comision.SelectedValue = oCurso.Comision.descripcion;

                    if (accion == "Consultar")
                    {
                        // Deshabilito los controles
                        txt_nombre.Enabled = false;
                        txt_costo.Enabled = false;
                        txt_objetivo.Enabled = false;
                        ddl_comision.Enabled = false;
                        ddl_doncentes.Enabled = false;
                        chk_arancelado.Enabled = false;
                    }
                }

                else
                {
                    lb_Curso.Visible = false;
                }
            }

            else
            {
                if (ValidarObligatorios() == true)
                {
                    oDocente = cDoncete.ObtenerDocentePorNombre(ddl_doncentes.SelectedValue);
                    oComision = cComision.ObtenerComisionPorDesc(ddl_comision.SelectedValue);

                    if (accion == "Alta")
                    {
                        oCurso = new Modelo_Entidades.Curso();
                        oCurso.descripcion = txt_nombre.Text;
                        oCurso.objetivo = Convert.ToInt32(txt_objetivo.Text);
                        oCurso.costo = Convert.ToInt32(txt_costo.Text);
                        oCurso.asistentes = 0;
                        oCurso.cupo = 35;
                        if (chk_arancelado.Checked == false)
                        {
                            oCurso.arancelado = false;
                        }
                        else
                        {
                            oCurso.arancelado = true;
                        }
                        oCurso.Docente = oDocente;
                        oCurso.Comision = oComision;
                        cCurso.AgregarCurso(oCurso);
                        id_comision = Request.QueryString["parametro3"];
                        Response.Redirect("~/Cursos/Tablero Cursos.aspx?&parametro1=" + id_comision);
                    }

                    if (accion == "Modificar")
                    {
                        id_Curso = Request.QueryString["parametro1"];
                        oCurso = cCurso.ObtenerCurso(Convert.ToInt32(id_Curso));
                        oCurso.descripcion = txt_nombre.Text;
                        oCurso.objetivo = Convert.ToInt32(txt_objetivo.Text);
                        oCurso.costo = Convert.ToInt32(txt_costo.Text);
                        if (chk_arancelado.Checked == false)
                        {
                            oCurso.arancelado = false;
                        }
                        else
                        {
                            oCurso.arancelado = true;
                        }
                        oCurso.Docente = oDocente;
                        oCurso.Comision = oComision;
                        cCurso.ModificarCurso(oCurso);
                        id_comision = Request.QueryString["parametro3"];
                        Response.Redirect("~/Cursos/Tablero Cursos.aspx?&parametro1=" + id_comision);
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            cCurso = Controladora.cCurso.ObtenerInstancia();
            cClase = Controladora.cClase.ObtenerInstancia();
            cAsistencia = Controladora.cAsistencia.ObtenerInstancia();
            cProfesional = Controladora.cProfesional.ObtenerInstancia();

            lb_mensaje.Visible = false;

            curso_id = Request.QueryString["parametro1"];
            oCurso = cCurso.ObtenerCurso(Convert.ToInt32(curso_id));
            lb_curso.Text = oCurso.descripcion;

            accion = Request.QueryString["parametro2"];
            comision_id = Request.QueryString["parametro3"];
            prof_dni = Request.QueryString["parametro4"];

            gv_clases.DataSource = cClase.ObtenerClasesPorCurso(Convert.ToInt32(curso_id));
            gv_clases.DataBind();

            for (int i = 0; gv_clases.Rows.Count > i; i++)
            {
                Modelo_Entidades.Clase oCla = cClase.ObtenerClase((Convert.ToInt32(gv_clases.Rows[i].Cells[1].Text)));
                List<Modelo_Entidades.Asistencia> ListaAsistencias = cAsistencia.ObtenerAsistenciasPorClaseyCurso(oCla.id, Convert.ToInt32(curso_id));
                int asitencias = ListaAsistencias.Count;
                List<Modelo_Entidades.Profesional> ListaInscriptos = cProfesional.ObtenerProfesionalesPorCurso(oCla.id);
                int inscriptos = ListaInscriptos.Count;
                double resultado = (asitencias * 100) / inscriptos;

                if (resultado > 75)
                {
                    gv_clases.Rows[i].Cells[0].BackColor = Color.LightCoral;
                    gv_clases.Rows[i].Cells[1].BackColor = Color.LightCoral;
                    gv_clases.Rows[i].Cells[2].BackColor = Color.LightCoral;
                }

                if (50 <= resultado && resultado <= 75)
                {
                    gv_clases.Rows[i].Cells[0].BackColor = Color.Yellow;
                    gv_clases.Rows[i].Cells[1].BackColor = Color.Yellow;
                    gv_clases.Rows[i].Cells[2].BackColor = Color.Yellow;
                }

                if (resultado < 50)
                {
                    gv_clases.Rows[i].Cells[0].BackColor = Color.LightGreen;
                    gv_clases.Rows[i].Cells[1].BackColor = Color.LightGreen;
                    gv_clases.Rows[i].Cells[2].BackColor = Color.LightGreen;;
                }
            }

            gv_clases.HeaderRow.Cells[0].Text = "Selección";
            gv_clases.HeaderRow.Cells[1].Text = "ID";
            gv_clases.HeaderRow.Cells[2].Text = "Fecha";

            if (accion == "Ver")
            {
                btn_dar_presente.Visible = false;
                btn_dar_ausente.Visible = false;
            }

            if (accion == "Asistencia")
            {
                btn_alta.Visible = false;
                btn_baja.Visible = false;
                btn_modificar.Visible = false;
                btn_consulta.Visible = false;
            }
        }
        protected void btn_inscribir_Click(object sender, EventArgs e)
        {
            if (gv_profesionales.SelectedRow != null)
            {
                prof_dni = gv_profesionales.SelectedRow.Cells[1].Text;
                oProfesional = cProfesional.ObtenerProfesional(Convert.ToInt32(prof_dni));

                // Inscribo al profesional en todas las clases de un curso dado
                foreach (Modelo_Entidades.Clase oClase in cClase.ObtenerClasesPorCurso(Convert.ToInt32(curso_id)))
                {
                    oAsistencia = new Modelo_Entidades.Asistencia();
                    oAsistencia.presente = false;
                    oAsistencia.Profesional = oProfesional;
                    oAsistencia.Clase = oClase;
                    cAsistencia.AgregarAsistencia(oAsistencia);
                }

                curso_id = Request.QueryString["parametro1"];
                oCurso = cCurso.ObtenerCurso(Convert.ToInt32(curso_id));
                oCurso.asistentes = oCurso.asistentes + 1;
                cCurso.ModificarCurso(oCurso);

                lb_inscripcion.Visible = true;
                lb_inscripcion.Text = "El profesional se ha inscripto exitosamente y la inscricion se ha sumado a los asistentes del curso";
            }

            else
            {
                lb_mensaje.Visible = true;
                lb_mensaje.Text = "DEBE SELECCIONAR UN PROFESIONAL";
            }
        }
Example #14
0
 // Agrego un titulo
 public void AgregarCurso(Modelo_Entidades.Curso oCurso)
 {
     oModelo_Entidades.AddToCursos(oCurso);
     oModelo_Entidades.SaveChanges();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            lb_mensaje.Visible = false;
            lb_inscripcion.Visible = false;
            lb_curso.Visible = false;
            lb_profesionales_inscriptos.Visible = false;

            curso_id = Request.QueryString["parametro1"];
            accion = Request.QueryString["parametro2"];
            comision_id = Request.QueryString["parametro3"];

            cProfesional = Controladora.cProfesional.ObtenerInstancia();
            cAsistencia = Controladora.cAsistencia.ObtenerInstancia();
            cClase = Controladora.cClase.ObtenerInstancia();
            cCurso = Controladora.cCurso.ObtenerInstancia();

            if (accion == "Inscripcion")
            {
                lb_mensaje2.Text = "Aquí puede visualizar si los profesionales se encuentran habilitados (color verde), o No Habilitados o tiene suspendida la matrícula (color rojo)";
                btn_desinscribir.Visible = false;
                btn_asentar_asistencia.Visible = false;
                gv_profesionales.DataSource = cProfesional.ObtenerProfesionales();
                gv_profesionales.DataBind();

                for (int i = 0; gv_profesionales.Rows.Count > i; i++)
                {
                    Modelo_Entidades.Profesional oProf = cProfesional.ObtenerProfesional((Convert.ToInt32(gv_profesionales.Rows[i].Cells[1].Text)));

                    if (oProf.Estado.descripcion == "Habilitado")
                    {
                        gv_profesionales.Rows[i].Cells[0].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[1].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[2].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[3].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[4].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[5].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[6].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[7].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[8].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[9].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[10].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[11].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[12].BackColor = Color.LightGreen;
                    }

                    if (oProf.Estado.descripcion == "No Habilitado" || oProf.Estado.descripcion == "Baja")
                    {
                        gv_profesionales.Rows[i].Cells[0].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[1].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[2].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[3].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[4].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[5].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[6].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[7].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[8].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[9].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[10].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[11].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[12].BackColor = Color.LightCoral;
                    }
                }
            }

            else
            {
                lb_mensaje2.Text = "Aquí puede visualizar si los profesionales han asistido más de un 75% a la clase (color verde), entre un 50 y un 75% (color amarillo) y menos de un 50% (color rojo)";
                lb_profesionales_inscriptos.Visible = true;
                lb_curso.Visible = true;
                oCurso = cCurso.ObtenerCurso(Convert.ToInt32(curso_id));
                lb_curso.Text = oCurso.descripcion;
                oClase = cClase.Obtener1ClasePorCurso(Convert.ToInt32(curso_id));
                gv_profesionales.DataSource = cProfesional.ObtenerProfesionalesPorCurso(oClase.id);
                gv_profesionales.DataBind();

                for (int i = 0; gv_profesionales.Rows.Count > i; i++)
                {
                    Modelo_Entidades.Profesional oProf = cProfesional.ObtenerProfesional((Convert.ToInt32(gv_profesionales.Rows[i].Cells[1].Text)));
                    List<Modelo_Entidades.Asistencia> ListaAsistencias = cAsistencia.ObtenerAsistenciasPorCursoyProfesional(oProf.dni, Convert.ToInt32(curso_id));
                    int asitencias = ListaAsistencias.Count;
                    List<Modelo_Entidades.Clase> ListaClases = cClase.ObtenerClasesPorCurso(Convert.ToInt32(curso_id));
                    int clases = ListaClases.Count;
                    double resultado = (asitencias * 100) / clases;

                    if (resultado >= 75)
                    {
                        gv_profesionales.Rows[i].Cells[0].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[1].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[2].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[3].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[4].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[5].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[6].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[7].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[8].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[9].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[10].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[11].BackColor = Color.LightGreen;
                        gv_profesionales.Rows[i].Cells[12].BackColor = Color.LightGreen;
                    }

                    if (50 <= resultado && resultado < 75)
                    {
                        gv_profesionales.Rows[i].Cells[0].BackColor = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[1].BackColor = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[2].BackColor = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[3].BackColor = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[4].BackColor = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[5].BackColor = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[6].BackColor = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[7].BackColor = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[8].BackColor = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[9].BackColor = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[10].BackColor = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[11].BackColor = Color.Yellow;
                        gv_profesionales.Rows[i].Cells[12].BackColor = Color.Yellow;
                    }

                    if (resultado < 50)
                    {
                        gv_profesionales.Rows[i].Cells[0].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[1].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[2].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[3].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[4].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[5].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[6].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[7].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[8].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[9].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[10].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[11].BackColor = Color.LightCoral;
                        gv_profesionales.Rows[i].Cells[12].BackColor = Color.LightCoral;
                    }
                }

                if (accion == "Asistencia")
                {
                    btn_inscribir.Visible = false;
                    btn_desinscribir.Visible = false;
                }

                if (accion == "Inscripcion")
                {
                    btn_asentar_asistencia.Visible = false;
                    btn_desinscribir.Visible = false;
                }

                if (accion == "Desinscripcion")
                {
                    btn_inscribir.Visible = false;
                    btn_asentar_asistencia.Visible = false;
                }

                if (accion == "Ver" )
                {
                    btn_inscribir.Visible = false;
                    btn_desinscribir.Visible = false;
                    btn_asentar_asistencia.Visible = false;
                }
            }

            gv_profesionales.HeaderRow.Cells[0].Text = "Selección";
            gv_profesionales.HeaderRow.Cells[1].Text = "DNI";
            gv_profesionales.HeaderRow.Cells[2].Text = "Nombre y Apellido";
            gv_profesionales.HeaderRow.Cells[5].Text = "Teléfono";
            gv_profesionales.HeaderRow.Cells[6].Text = "Celular";
            gv_profesionales.HeaderRow.Cells[7].Text = "Email 1";
            gv_profesionales.HeaderRow.Cells[8].Text = "Email 2";
        }
Example #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Instancio las controladoras
            cCurso    = Controladora.cCurso.ObtenerInstancia();
            cDoncete  = Controladora.cDocente.ObtenerInstancia();
            cComision = Controladora.cComision.ObtenerInstancia();
            cClase    = Controladora.cClase.ObtenerInstancia();

            id_Curso    = Request.QueryString["parametro1"];
            accion      = Request.QueryString["parametro2"];
            id_comision = Request.QueryString["parametro3"];

            if (!(Page.IsPostBack)) // Lo que esta aca carga cuando solamente carga la página
            {
                ddl_doncentes.DataSource    = cDoncete.ObtenerDocentes();
                ddl_doncentes.DataTextField = "nombre_apellido";
                ddl_doncentes.DataBind();

                ddl_comision.DataSource    = cComision.ObtenerComisiones();
                ddl_comision.DataTextField = "descripcion";
                ddl_comision.DataBind();

                // Según la accion habilito o deshabilito los controles
                if (accion != "Alta")
                {
                    // Busco la comisión
                    id_Curso = Request.QueryString["parametro1"];
                    oCurso   = cCurso.ObtenerCurso(Convert.ToInt32(id_Curso));
                    // Asigno las variables a los controles
                    lb_Curso.Text     = oCurso.descripcion;
                    txt_nombre.Text   = oCurso.descripcion;
                    txt_objetivo.Text = oCurso.objetivo.ToString();
                    if (oCurso.arancelado == false)
                    {
                        chk_arancelado.Checked = false;
                    }
                    else
                    {
                        chk_arancelado.Checked = true;
                    }
                    txt_costo.Text = oCurso.costo.ToString();
                    ddl_doncentes.SelectedValue = oCurso.Docente.nombre_apellido;
                    ddl_comision.SelectedValue  = oCurso.Comision.descripcion;

                    if (accion == "Consultar")
                    {
                        // Deshabilito los controles
                        txt_nombre.Enabled     = false;
                        txt_costo.Enabled      = false;
                        txt_objetivo.Enabled   = false;
                        ddl_comision.Enabled   = false;
                        ddl_doncentes.Enabled  = false;
                        chk_arancelado.Enabled = false;
                    }
                }

                else
                {
                    lb_Curso.Visible = false;
                }
            }

            else
            {
                if (ValidarObligatorios() == true)
                {
                    oDocente  = cDoncete.ObtenerDocentePorNombre(ddl_doncentes.SelectedValue);
                    oComision = cComision.ObtenerComisionPorDesc(ddl_comision.SelectedValue);

                    if (accion == "Alta")
                    {
                        oCurso             = new Modelo_Entidades.Curso();
                        oCurso.descripcion = txt_nombre.Text;
                        oCurso.objetivo    = Convert.ToInt32(txt_objetivo.Text);
                        oCurso.costo       = Convert.ToInt32(txt_costo.Text);
                        oCurso.asistentes  = 0;
                        oCurso.cupo        = 35;
                        if (chk_arancelado.Checked == false)
                        {
                            oCurso.arancelado = false;
                        }
                        else
                        {
                            oCurso.arancelado = true;
                        }
                        oCurso.Docente  = oDocente;
                        oCurso.Comision = oComision;
                        cCurso.AgregarCurso(oCurso);
                        id_comision = Request.QueryString["parametro3"];
                        Response.Redirect("~/Cursos/Tablero Cursos.aspx?&parametro1=" + id_comision);
                    }

                    if (accion == "Modificar")
                    {
                        id_Curso           = Request.QueryString["parametro1"];
                        oCurso             = cCurso.ObtenerCurso(Convert.ToInt32(id_Curso));
                        oCurso.descripcion = txt_nombre.Text;
                        oCurso.objetivo    = Convert.ToInt32(txt_objetivo.Text);
                        oCurso.costo       = Convert.ToInt32(txt_costo.Text);
                        if (chk_arancelado.Checked == false)
                        {
                            oCurso.arancelado = false;
                        }
                        else
                        {
                            oCurso.arancelado = true;
                        }
                        oCurso.Docente  = oDocente;
                        oCurso.Comision = oComision;
                        cCurso.ModificarCurso(oCurso);
                        id_comision = Request.QueryString["parametro3"];
                        Response.Redirect("~/Cursos/Tablero Cursos.aspx?&parametro1=" + id_comision);
                    }
                }
            }
        }
Example #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            cCurso       = Controladora.cCurso.ObtenerInstancia();
            cClase       = Controladora.cClase.ObtenerInstancia();
            cAsistencia  = Controladora.cAsistencia.ObtenerInstancia();
            cProfesional = Controladora.cProfesional.ObtenerInstancia();

            lb_mensaje.Visible = false;

            curso_id      = Request.QueryString["parametro1"];
            oCurso        = cCurso.ObtenerCurso(Convert.ToInt32(curso_id));
            lb_curso.Text = oCurso.descripcion;

            accion      = Request.QueryString["parametro2"];
            comision_id = Request.QueryString["parametro3"];
            prof_dni    = Request.QueryString["parametro4"];


            gv_clases.DataSource = cClase.ObtenerClasesPorCurso(Convert.ToInt32(curso_id));
            gv_clases.DataBind();

            for (int i = 0; gv_clases.Rows.Count > i; i++)
            {
                Modelo_Entidades.Clase             oCla             = cClase.ObtenerClase((Convert.ToInt32(gv_clases.Rows[i].Cells[1].Text)));
                List <Modelo_Entidades.Asistencia> ListaAsistencias = cAsistencia.ObtenerAsistenciasPorClaseyCurso(oCla.id, Convert.ToInt32(curso_id));
                int asitencias = ListaAsistencias.Count;
                List <Modelo_Entidades.Profesional> ListaInscriptos = cProfesional.ObtenerProfesionalesPorCurso(oCla.id);
                int    inscriptos = ListaInscriptos.Count;
                double resultado  = (asitencias * 100) / inscriptos;


                if (resultado > 75)
                {
                    gv_clases.Rows[i].Cells[0].BackColor = Color.LightCoral;
                    gv_clases.Rows[i].Cells[1].BackColor = Color.LightCoral;
                    gv_clases.Rows[i].Cells[2].BackColor = Color.LightCoral;
                }

                if (50 <= resultado && resultado <= 75)
                {
                    gv_clases.Rows[i].Cells[0].BackColor = Color.Yellow;
                    gv_clases.Rows[i].Cells[1].BackColor = Color.Yellow;
                    gv_clases.Rows[i].Cells[2].BackColor = Color.Yellow;
                }

                if (resultado < 50)
                {
                    gv_clases.Rows[i].Cells[0].BackColor = Color.LightGreen;
                    gv_clases.Rows[i].Cells[1].BackColor = Color.LightGreen;
                    gv_clases.Rows[i].Cells[2].BackColor = Color.LightGreen;;
                }
            }

            gv_clases.HeaderRow.Cells[0].Text = "Selección";
            gv_clases.HeaderRow.Cells[1].Text = "ID";
            gv_clases.HeaderRow.Cells[2].Text = "Fecha";

            if (accion == "Ver")
            {
                btn_dar_presente.Visible = false;
                btn_dar_ausente.Visible  = false;
            }

            if (accion == "Asistencia")
            {
                btn_alta.Visible      = false;
                btn_baja.Visible      = false;
                btn_modificar.Visible = false;
                btn_consulta.Visible  = false;
            }
        }
Example #18
0
 // Modifico un titulo
 public void ModificarCurso(Modelo_Entidades.Curso oCurso)
 {
     oModelo_Entidades.ApplyCurrentValues("Cursos", oCurso);
     oModelo_Entidades.SaveChanges();
 }