protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                oListaEmpleados = new List <string>();
                PlanSucesionNegocio neg = new PlanSucesionNegocio();

                if (Request.Params["idEmpleado"] != null)
                {
                    vIdEmpleado = int.Parse(Request.Params["idEmpleado"]);


                    SPE_OBTIENE_EMPLEADOS_Result emp = new SPE_OBTIENE_EMPLEADOS_Result();
                    XElement xml_empleado            = new XElement("SELECCION", new XElement("FILTRO", new XAttribute("CL_TIPO", "EMPLEADO"), new XElement("EMP", new XAttribute("ID_EMPLEADO", vIdEmpleado))));

                    emp = neg.ObtieneEmpleados(xml_empleado).FirstOrDefault();

                    vIdPuesto             = emp.M_PUESTO_ID_PUESTO.Value;
                    txtEmpleado.InnerText = emp.M_EMPLEADO_CL_EMPLEADO + ": " + emp.M_EMPLEADO_NB_EMPLEADO_COMPLETO;
                    txtPuesto.InnerText   = emp.M_PUESTO_CL_PUESTO + ": " + emp.M_PUESTO_NB_PUESTO;
                }

                if (Request.Params["sucesores"] != null)
                {
                    listaDatosSucesores = new List <E_PLAN_SUCESION>();
                    listaDatosSucesores = JsonConvert.DeserializeObject <List <E_PLAN_SUCESION> >(Request.Params["sucesores"].ToString());

                    XElement xml_sucesores = new XElement("EMPLEADOS");
                    XElement xml_seleccion = new XElement("SELECCION");
                    XElement xml_filtro    = new XElement("FILTRO", new XAttribute("CL_TIPO", "EMPLEADO"));

                    foreach (E_PLAN_SUCESION item in listaDatosSucesores)
                    {
                        vXmlEmpleados = vXmlEmpleados + item.ID_EMPLEADO + ",";
                        xml_filtro.Add(new XElement("EMP", new XAttribute("ID_EMPLEADO", item.ID_EMPLEADO)));
                        xml_sucesores.Add(new XElement("EMP", new XAttribute("ID_EMPLEADO", item.ID_EMPLEADO), new XAttribute("ID_PERIODO", item.ID_PERIODO)));
                    }

                    xml_seleccion.Add(xml_filtro);

                    vXmlSucesores          = xml_sucesores.ToString();
                    vXmlSucesoresSeleccion = xml_seleccion.ToString();
                }

                CargarDatos();
            }
        }
Beispiel #2
0
        private void CargarEmpleado()
        {
            SPE_OBTIENE_EMPLEADOS_Result vEmpleado     = new SPE_OBTIENE_EMPLEADOS_Result();
            PlanSucesionNegocio          nPlanSucesion = new PlanSucesionNegocio();

            XElement vXmlEmpleado = new XElement("SELECCION", new XElement("FILTRO", new XAttribute("CL_TIPO", "EMPLEADO"), new XElement("EMP", new XAttribute("ID_EMPLEADO", vIdEmpleado))));

            vEmpleado = nPlanSucesion.ObtieneEmpleados(vXmlEmpleado, true).FirstOrDefault();

            if (vEmpleado != null)
            {
                txtNbEmpleado.InnerText   = vEmpleado.M_EMPLEADO_NB_EMPLEADO_COMPLETO;
                txtNbPuesto.InnerText     = vEmpleado.M_PUESTO_NB_PUESTO;
                txtNbAntiguedad.InnerText = Antiguedad(vEmpleado.M_EMPLEADO_FE_ALTA);
                vIdPuesto = vEmpleado.M_PUESTO_ID_PUESTO.Value;
                rbiFotoSuceder.DataValue = vEmpleado.FI_FOTOGRAFIA;
            }
        }