protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                vLstComparacionCompetencias = new List <E_COMPARACION_COMPETENCIA>();
                vLstPromediosPuestos        = new List <E_PROMEDIO_PLAN_VIDA_CARRERA>();

                Negocio.Administracion.PeriodoNegocio neg = new Negocio.Administracion.PeriodoNegocio();
                PlanVidaCarreraNegocio negp = new PlanVidaCarreraNegocio();
                EmpleadoNegocio        nege = new EmpleadoNegocio();

                if (Request.Params["idPeriodo"] != null)
                {
                    SPE_OBTIENE_C_PERIODO_Result per = new SPE_OBTIENE_C_PERIODO_Result();
                    vIdPeriodo = int.Parse(Request.Params["idPeriodo"]);

                    per = neg.Obtener_C_PERIODO(ID_PERIODO: vIdPeriodo).FirstOrDefault();

                    txtPeriodo.InnerText        = per.NB_PERIODO + per.DS_PERIODO;
                    txtTipoEvaluacion.InnerHtml = per.TIPO_EVALUACION;
                }

                if (Request.Params["idEmpleado"] != null)
                {
                    SPE_OBTIENE_M_EMPLEADO_Result emp = new SPE_OBTIENE_M_EMPLEADO_Result();

                    vIdEmpleado = int.Parse(Request.Params["idEmpleado"]);

                    emp = nege.ObtenerEmpleado(ID_EMPLEADO: vIdEmpleado).FirstOrDefault();

                    vIdPuesto = emp.ID_PUESTO;
                    txtClaveEmpleado.InnerText  = emp.CL_EMPLEADO;
                    txtClavePuesto.InnerText    = emp.CL_PUESTO;
                    txtNombreEmpleado.InnerText = emp.NB_EMPLEADO_COMPLETO;
                    txtNombrePuesto.InnerText   = emp.NB_PUESTO;
                }

                if (Request.Params["Puestos"] != null)
                {
                    XElement prueba = new XElement("PUESTOS");

                    string[] aux = Request.Params["Puestos"].ToString().Split(',');

                    foreach (string item in aux)
                    {
                        prueba.Add(new XElement("PUESTO", new XAttribute("ID", item)));
                    }

                    PuestosComparacion = prueba.ToString();

                    List <SPE_OBTIENE_M_PUESTO_Result> listaPuestos = negp.ObtienePuestos(PuestosComparacion);

                    lstPuestos.DataSource     = listaPuestos;
                    lstPuestos.DataValueField = "ID_PUESTO";
                    lstPuestos.DataTextField  = "NB_PUESTO";
                    lstPuestos.DataBind();
                }
            }
        }
        protected void rgCompetencias_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            List <E_COMPARACION_COMPETENCIA>    vLstTemporal  = new List <E_COMPARACION_COMPETENCIA>();
            List <E_PROMEDIO_PLAN_VIDA_CARRERA> vLstTemporal2 = new List <E_PROMEDIO_PLAN_VIDA_CARRERA>();

            PlanVidaCarreraNegocio neg = new PlanVidaCarreraNegocio();

            rgCompetencias.DataSource   = neg.obtieneComparacionCompetenciasPlanVidaCarrera(vIdEmpleado, vIdPeriodo, PuestosComparacion, ref vLstTemporal, ref vLstTemporal2);
            vLstComparacionCompetencias = vLstTemporal;
            vLstPromediosPuestos        = vLstTemporal2;
        }
        private void cargarListas()
        {
            List <SPE_OBTIENE_PLAN_VIDA_CARRERA_Result> rutaNatural     = new List <SPE_OBTIENE_PLAN_VIDA_CARRERA_Result>();
            List <SPE_OBTIENE_PLAN_VIDA_CARRERA_Result> rutaAlternativa = new List <SPE_OBTIENE_PLAN_VIDA_CARRERA_Result>();
            List <SPE_OBTIENE_PLAN_VIDA_CARRERA_Result> rutaHorizontal  = new List <SPE_OBTIENE_PLAN_VIDA_CARRERA_Result>();
            List <SPE_OBTIENE_PLAN_VIDA_CARRERA_Result> rutas           = new List <SPE_OBTIENE_PLAN_VIDA_CARRERA_Result>();

            PlanVidaCarreraNegocio neg = new PlanVidaCarreraNegocio();

            rutas = neg.obtieneDatosPlanVidaCarrera(vIdPuesto, null, vIdPlaza);

            rutaNatural = rutas.Where(n => n.CL_TIPO_GENEALOGIA == "NATURAL").ToList();
            generarOrganigrama(rocNatural, rutaNatural, true, "NATURAL");

            rutaAlternativa = rutas.Where(n => n.CL_TIPO_GENEALOGIA == "RUTA ALTERNATIVA").ToList();
            generarOrganigrama(rocAlternativa, rutaAlternativa, false, "ALTER");

            rutaHorizontal = rutas.Where(n => n.CL_TIPO_GENEALOGIA == "RUTA LATERAL").ToList();
            generarOrganigrama(rocHorizontal, rutaHorizontal, false, "HOR");
        }
        protected void grdpuestos_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            PlanVidaCarreraNegocio neg = new PlanVidaCarreraNegocio();

            grdpuestos.DataSource = neg.obtenerComparacionPuestos(PuestosComparacion, vIdEmpleado);
        }