Beispiel #1
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);
            }
        }
        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);
            }
        }
Beispiel #3
0
        // Obtener todos las clases de una curso
        public Modelo_Entidades.Clase Obtener1ClasePorCurso(int id)
        {
            Modelo_Entidades.Clase oClase = oModelo_Entidades.Clases.ToList().Find(delegate(Modelo_Entidades.Clase fClase)
            {
                return(fClase.Curso.id == id);
            });

            return(oClase);
        }
        protected void btn_baja_Click(object sender, EventArgs e)
        {
            if (gv_clases.SelectedRow != null)
            {
                clase_id = gv_clases.SelectedRow.Cells[1].Text;
                oClase = cClase.ObtenerClase(Convert.ToInt32(clase_id));
                // Inscribo al profesional en todas las clases de un curso dado
                foreach (Modelo_Entidades.Asistencia oAsistencia in cAsistencia.ObtenerAsistenciasPorCurso(Convert.ToInt32(curso_id)))
                {
                    cAsistencia.EliminarAsistencia(oAsistencia);
                }
                cClase.EliminarClase(oClase);
                Response.Redirect("~/Clases/Tablero Clases.aspx?parametro1=" + curso_id);
            }

            else
            {
                lb_mensaje.Visible = true;
                lb_mensaje.Text = "DEBE SELECCIONAR UNA CLASE";
            }
        }
Beispiel #5
0
        protected void btn_baja_Click(object sender, EventArgs e)
        {
            if (gv_clases.SelectedRow != null)
            {
                clase_id = gv_clases.SelectedRow.Cells[1].Text;
                oClase   = cClase.ObtenerClase(Convert.ToInt32(clase_id));
                // Inscribo al profesional en todas las clases de un curso dado
                foreach (Modelo_Entidades.Asistencia oAsistencia in cAsistencia.ObtenerAsistenciasPorCurso(Convert.ToInt32(curso_id)))
                {
                    cAsistencia.EliminarAsistencia(oAsistencia);
                }
                cClase.EliminarClase(oClase);
                Response.Redirect("~/Clases/Tablero Clases.aspx?parametro1=" + curso_id);
            }

            else
            {
                lb_mensaje.Visible = true;
                lb_mensaje.Text    = "DEBE SELECCIONAR UNA CLASE";
            }
        }
        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";
        }
        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";
        }
Beispiel #8
0
 // Modifico un clase
 public void ModificarClase(Modelo_Entidades.Clase oClase)
 {
     oModelo_Entidades.ApplyCurrentValues("Clases", oClase);
     oModelo_Entidades.SaveChanges();
 }
Beispiel #9
0
 // Agrego un clase
 public void AgregarClase(Modelo_Entidades.Clase oClase)
 {
     oModelo_Entidades.AddToClases(oClase);
     oModelo_Entidades.SaveChanges();
 }
Beispiel #10
0
 // Elimino a un clase
 public void EliminarClase(Modelo_Entidades.Clase oClase)
 {
     oModelo_Entidades.DeleteObject(oClase);
     oModelo_Entidades.SaveChanges();
 }
Beispiel #11
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;
            }
        }