コード例 #1
0
        protected void CargaInicial()
        {
            ITLA_PE_MVC.SERVICE.ServicesDashboard servicesDashboard = new ITLA_PE_MVC.SERVICE.ServicesDashboard();

            periodo = int.Parse(ddlPeriodo.SelectedValue);

            RepeaterCarreras.DataSource = servicesDashboard.UspReporteInscritosSeleccionXCarreraCuatrimestre(periodo);
            RepeaterCarreras.DataBind();


            RepeaterInscritos.DataSource = servicesDashboard.UspReporteInscritosSeleccionCuatrimestre(periodo);
            RepeaterInscritos.DataBind();

            RepeaterFechas.DataSource = servicesDashboard.UspReporteInscritosSeleccionXFecha(periodo);
            RepeaterFechas.DataBind();


            RepeaterGenero.DataSource = servicesDashboard.DashboardGeneroPorPeriodo(periodo);
            RepeaterGenero.DataBind();


            RepeaterEdad.DataSource = servicesDashboard.DashboardRangoEdadPorPeriodo(periodo);
            RepeaterEdad.DataBind();


            var total = servicesDashboard.UspReporteInscritosSeleccionCuatrimestre(periodo);

            literalNuevoIngreso.Text   = total.Sum(a => a.Nuevo_Ingreso).ToString();
            literalReinscritos.Text    = total.Sum(a => a.Viejos).ToString();
            literalTotalInscritos.Text = total.Sum(set => set.Total1).ToString();



            double totalInscritos = (int)total.Sum(set => set.Total1);
            double reinscritos    = (int)total.Sum(a => a.Viejos);
            int    nuevos         = (int)total.Sum(a => a.Nuevo_Ingreso);



            CantNuevos = nuevos;
            CantViejos = reinscritos;



            double porcientoReinscritos = Math.Round(reinscritos * 100 / totalInscritos);
            double porcientoNuevos      = Math.Round(nuevos * 100 / totalInscritos);

            literalPorcientoReinscritos.Text = porcientoReinscritos.ToString();
            literalNuevos.Text = porcientoNuevos.ToString();
        }