private void Cargar(Decimal ID_SOLICITUD)
    {
        HiddenField_ID_SOLICITUD.Value = ID_SOLICITUD.ToString();

        DataTable tablaInfoSolicitud;

        radicacionHojasDeVida _radicacionHojasDeVida = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        tablaInfoSolicitud = _radicacionHojasDeVida.ObtenerRegSolicitudesingresoPorIdSolicitud(Convert.ToInt32(ID_SOLICITUD));

        if (String.IsNullOrEmpty(_radicacionHojasDeVida.MensajeError) == false)
        {
            Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _radicacionHojasDeVida.MensajeError, Proceso.Error);
        }
        else
        {
            if (tablaInfoSolicitud.Rows.Count <= 0)
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "No se encontró información de la solicitud seleccionada.", Proceso.Advertencia);
            }
            else
            {
                Ocultar(Acciones.Inicio);
                Mostrar(Acciones.BotonesAccion);

                DataRow filaInfoSolicitud = tablaInfoSolicitud.Rows[0];

                cargar_datos_solicitud_ingreso(filaInfoSolicitud);

                cargar_datos_bitacora(filaInfoSolicitud);

                cargar_seccion_descarte(filaInfoSolicitud);
            }
        }
    }
    protected void Button_IMPRIMIR_Click(object sender, EventArgs e)
    {
        Decimal ID_EMPLEADO  = Convert.ToDecimal(HiddenField_ID_EMPLEADO.Value);
        Decimal ID_SOLICITUD = Convert.ToDecimal(HiddenField_ID_SOLICITUD.Value);
        Decimal ID_EMPRESA   = Convert.ToDecimal(HiddenField_ID_EMPRESA.Value);

        radicacionHojasDeVida _rad           = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable             tablaSolicitud = _rad.ObtenerRegSolicitudesingresoPorIdSolicitud(Convert.ToInt32(ID_SOLICITUD));
        DataRow filaSolicitud = tablaSolicitud.Rows[0];

        maestrasInterfaz _maestrasInterfaz = new maestrasInterfaz();

        byte[] datosArchivo = _maestrasInterfaz.GenerarPDFEntrevistaRetiro(ID_EMPLEADO, ID_SOLICITUD, ID_EMPRESA);

        String filename = filaSolicitud["NUM_DOC_IDENTIDAD"].ToString().Trim() + "_INFORME_ENTREVISTA_RETIRO";

        filename = filename.Replace(' ', '_');

        Response.Clear();
        Response.BufferOutput = false;
        Response.ContentType  = "application/pdf";
        Response.AddHeader("Content-Disposition", "attachment;FileName=" + filename + ".pdf");
        Response.BinaryWrite(datosArchivo);
        Response.End();
    }
    protected void GridView_RESULTADOS_BUSQUEDA_SelectedIndexChanged(object sender, EventArgs e)
    {
        String ID_SOLICITUD                   = GridView_RESULTADOS_BUSQUEDA.SelectedDataKey["ID_SOLICITUD"].ToString();
        String ID_REQUERIMIENTO               = GridView_RESULTADOS_BUSQUEDA.SelectedDataKey["ID_REQUERIMIENTO"].ToString();
        String NUM_DOC_IDENTIDAD              = GridView_RESULTADOS_BUSQUEDA.SelectedDataKey["NUM_DOC_IDENTIDAD"].ToString();
        radicacionHojasDeVida _SolIngreso     = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable             tablaSolIngreso = _SolIngreso.ObtenerRegSolicitudesingresoPorNumDocIdentidad(NUM_DOC_IDENTIDAD.ToString());
        DataRow filaSolIngreso                = tablaSolIngreso.Rows[0];

        if (filaSolIngreso["ARCHIVO"].ToString().Trim().Equals("CONTRATADO"))
        {
            Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "La persona seleccionada no puede ser descartada, porque se encuentra CONTRATADA.", Proceso.Advertencia);
        }
        else
        {
            tools             _tools = new tools();
            SecureQueryString QueryStringSeguros;
            QueryStringSeguros = new SecureQueryString(_tools.byteParaQueryStringSeguro());

            QueryStringSeguros["img_area"]          = "contratacion";
            QueryStringSeguros["nombre_area"]       = "CONTRATACIÓN";
            QueryStringSeguros["nombre_modulo"]     = "DESCARTE DE PERSONAL";
            QueryStringSeguros["accion"]            = "cargar";
            QueryStringSeguros["reg"]               = ID_SOLICITUD;
            QueryStringSeguros["id_Requerimiento"]  = ID_REQUERIMIENTO;
            QueryStringSeguros["num_doc_identidad"] = NUM_DOC_IDENTIDAD;

            Response.Redirect("~/contratacion/descartePersonal.aspx?data=" + HttpUtility.UrlEncode(QueryStringSeguros.ToString()));
        }
    }
    private void Cargar_DropDownList_AreaInteres()
    {
        DropDownList_AreaInteres.Items.Clear();

        radicacionHojasDeVida _radicacionHojasDeVida    = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable             tablaAreasEspecializacion = _radicacionHojasDeVida.ObtenerAreasInteresLaboral();

        ListItem item = new ListItem("Seleccione...", "");

        DropDownList_AreaInteres.Items.Add(item);

        int contador = 0;

        foreach (DataRow fila in tablaAreasEspecializacion.Rows)
        {
            if (contador > 0)
            {
                item = new ListItem(fila["DESCRIPCION"].ToString(), fila["ID_AREAINTERES"].ToString());
                DropDownList_AreaInteres.Items.Add(item);
            }
            contador += 1;
        }

        DropDownList_AreaInteres.DataBind();
    }
Example #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        tools             _tools = new tools();
        SecureQueryString QueryStringSeguro;

        QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro(), Request["data"]);

        Decimal REGISTRO = Convert.ToDecimal(QueryStringSeguro["registro"]);

        hojasVida _hojasVida            = new hojasVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaPruebaAplicadaYa = _hojasVida.ObtenerSelRegAplicacionPrueebasObtenerPorRegistro(REGISTRO);
        DataRow   filaPruebaAplicadaYa  = tablaPruebaAplicadaYa.Rows[0];

        Int32 ID_SOLICITUD = Convert.ToInt32(filaPruebaAplicadaYa["ID_SOLICITUD"]);
        radicacionHojasDeVida _radicacionHojasDeVida = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable             tablaSolicitud         = _radicacionHojasDeVida.ObtenerRegSolicitudesingresoPorIdSolicitud(ID_SOLICITUD);
        DataRow filaSolicitud = tablaSolicitud.Rows[0];

        String NOMBRE_ARCHIVO = filaSolicitud["NUM_DOC_IDENTIDAD"].ToString().Trim() + "-PRUEBA-" + filaPruebaAplicadaYa["NOM_PRUEBA"].ToString().Trim();

        NOMBRE_ARCHIVO = NOMBRE_ARCHIVO.Replace(' ', '_');

        Response.Clear();
        Response.AddHeader("content-disposition", string.Format("attachment;filename={0}", NOMBRE_ARCHIVO + filaPruebaAplicadaYa["ARCHIVO_EXTENSION"].ToString().Trim()));

        Response.ContentType = filaPruebaAplicadaYa["ARCHIVO_TYPE"].ToString().Trim();

        Response.BinaryWrite((byte[])filaPruebaAplicadaYa["ARCHIVO_PRUEBA"]);

        Response.End();
    }
    private void iniciar_interfaz_para_validacion()
    {
        tools             _tools = new tools();
        SecureQueryString QueryStringSeguro;

        QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro(), Request["data"]);

        String NUM_DOC_IDENTIDAD = QueryStringSeguro["num_doc_identidad"].ToString();

        DataTable tablaInfoSolicitud;

        radicacionHojasDeVida _radicacionHojasDeVida = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        tablaInfoSolicitud = _radicacionHojasDeVida.ObtenerRegSolicitudesingresoPorNumDocIdentidadValAcoset(NUM_DOC_IDENTIDAD);

        if (String.IsNullOrEmpty(_radicacionHojasDeVida.MensajeError) == false)
        {
            Panel_FORM_BOTONES_1.Visible = false;

            Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _radicacionHojasDeVida.MensajeError, Proceso.Error);

            Panel_FORMULARIO.Visible      = false;
            Panel_RESULTADOS_GRID.Visible = false;

            Panel_BITACORA_HOJA.Visible       = false;
            Panel_Descarte_Entrevista.Visible = false;
        }
        else
        {
            if (tablaInfoSolicitud.Rows.Count <= 0)
            {
                Panel_FORM_BOTONES_1.Visible = true;
                configurarBotonesDeAccion(false, true, true);

                Panel_FORMULARIO.Visible      = true;
                Panel_RESULTADOS_GRID.Visible = false;
                cargarInterfazEnBlanco();

                Panel_BITACORA_HOJA.Visible       = false;
                Panel_Descarte_Entrevista.Visible = false;
            }
            else
            {
                Panel_FORMULARIO.Visible      = true;
                Panel_RESULTADOS_GRID.Visible = false;

                cargarInterfazConDatos(tablaInfoSolicitud);
                configurarBotonesDeAccion(true, true, true);

                Panel_BITACORA_HOJA.Visible = true;
                cargar_GridView_BITACORA();

                Panel_Descarte_Entrevista.Visible = false;
            }
        }
    }
        public Boolean ValidarNumeroDocumento(String numeroDocumento)
        {
            Boolean encontrado = true;
            radicacionHojasDeVida solicitudIngreso = new radicacionHojasDeVida(Empresa, Usuario);
            DataTable             _dataTable       = solicitudIngreso.ObtenerRegSolicitudesingresoPorNumDocIdentidad(numeroDocumento);

            if (_dataTable.Rows.Count == 0)
            {
                encontrado = false;
            }
            return(encontrado);
        }
Example #8
0
        public Decimal ActualizarAuditoriaContratosPorSeccionYEstadoProceso(Decimal ID_EMPLEADO, String TABLA_AUDITADA, Decimal ID_AUDITADO, Boolean ACTUALIZAR_ESTADO_PROCESO, Decimal ID_SOLICITUD, String ESTADO_PROCESO)
        {
            Decimal ID_AUDITORIA = 0;

            Conexion conexion = new Conexion(Empresa);

            conexion.IniciarTransaccion();

            try
            {
                ID_AUDITORIA = AdicionarAuditoriaContratos(ID_EMPLEADO, TABLA_AUDITADA, ID_AUDITADO, DateTime.Now, conexion);

                if (ID_AUDITORIA <= 0)
                {
                    conexion.DeshacerTransaccion();
                    ID_AUDITORIA = 0;
                }
                else
                {
                    if (ACTUALIZAR_ESTADO_PROCESO == true)
                    {
                        radicacionHojasDeVida _radicacionHojasDeVida = new radicacionHojasDeVida(Empresa, Usuario);

                        if (_radicacionHojasDeVida.ActualizarEstadoProcesoRegSolicitudesIngresoAuditoria(ID_SOLICITUD, ESTADO_PROCESO, conexion) == false)
                        {
                            conexion.DeshacerTransaccion();
                            MensajeError = _radicacionHojasDeVida.MensajeError;
                            ID_AUDITORIA = 0;
                        }
                        else
                        {
                            conexion.AceptarTransaccion();
                        }
                    }
                    else
                    {
                        conexion.AceptarTransaccion();
                    }
                }
            }
            catch (Exception ex)
            {
                MensajeError = ex.Message;
                conexion.DeshacerTransaccion();
                ID_AUDITORIA = 0;
            }
            finally
            {
                conexion.Desconectar();
            }

            return(ID_AUDITORIA);
        }
        public Boolean DescartarConRegContratosTemporal(Decimal ID_REQUERIMIENTO,
                                                        Decimal ID_SOLICITUD,
                                                        String OBSERVACIONES)
        {
            Boolean correcto = true;

            Conexion conexion = new Conexion(Empresa);

            conexion.IniciarTransaccion();

            try
            {
                if (ActualizarDescarte(ID_REQUERIMIENTO, ID_SOLICITUD, OBSERVACIONES, conexion) == false)
                {
                    correcto = false;
                    conexion.DeshacerTransaccion();
                }
                else
                {
                    radicacionHojasDeVida _rad = new radicacionHojasDeVida(Empresa, Usuario);

                    if (_rad.ActualizarEstadoProcesoRegSolicitudesIngreso(Convert.ToInt32(ID_REQUERIMIENTO), Convert.ToInt32(ID_SOLICITUD), "EN DESCARTE", Usuario, conexion) == false)
                    {
                        correcto = false;
                        conexion.DeshacerTransaccion();
                    }
                }

                if (correcto == true)
                {
                    conexion.AceptarTransaccion();
                }
            }
            catch
            {
                correcto = false;
                conexion.DeshacerTransaccion();
            }
            finally
            {
                conexion.Desconectar();
            }

            return(correcto);
        }
    private void cargar_DropDownList_AREAS_ESPECIALIZACION()
    {
        DropDownList_AREAS_ESPECIALIZACION.Items.Clear();

        radicacionHojasDeVida _radicacionHojasDeVida    = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable             tablaAreasEspecializacion = _radicacionHojasDeVida.ObtenerAreasInteresLaboral();

        ListItem item = new ListItem("Seleccione Área", "");

        DropDownList_AREAS_ESPECIALIZACION.Items.Add(item);

        foreach (DataRow fila in tablaAreasEspecializacion.Rows)
        {
            item = new ListItem(fila["DESCRIPCION"].ToString(), fila["ID_AREAINTERES"].ToString());
            DropDownList_AREAS_ESPECIALIZACION.Items.Add(item);
        }

        DropDownList_AREAS_ESPECIALIZACION.DataBind();
    }
Example #11
0
    protected void DropDownList_ID_TRABAJADOR_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DropDownList_ID_TRABAJADOR.SelectedIndex <= 0)
        {
            Ocultar(Acciones.EmpleadoSeleccionado);

            HiddenField_ID_EMPLEADO.Value      = "";
            HiddenField_ID_CONTRATO.Value      = "";
            HiddenField_ID_PERFIL.Value        = "";
            HiddenField_ID_SOLICITUD.Value     = "";
            HiddenField_ID_REFERENCIA.Value    = "";
            HiddenField_ID_REQUERIMIENTO.Value = "";
        }
        else
        {
            Ocultar(Acciones.EmpleadoSeleccionado);
            Mostrar(Acciones.EmpleadoSeleccionado);

            Decimal ID_SOLICITUD = Convert.ToDecimal(DropDownList_ID_TRABAJADOR.SelectedValue);
            HiddenField_ID_SOLICITUD.Value = ID_SOLICITUD.ToString();

            HiddenField_ID_EMPLEADO.Value      = "";
            HiddenField_ID_CONTRATO.Value      = "";
            HiddenField_ID_PERFIL.Value        = "";
            HiddenField_ID_REFERENCIA.Value    = "";
            HiddenField_ID_REQUERIMIENTO.Value = "";

            radicacionHojasDeVida _radicacionHojasDeVida = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
            DataTable             tablaSolicitud         = _radicacionHojasDeVida.ObtenerRegSolicitudesingresoPorIdSolicitud(Convert.ToInt32(ID_SOLICITUD));
            DataRow filaSolicitud = tablaSolicitud.Rows[0];

            registroContrato _registroContrato = new registroContrato(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
            DataTable        tablaContratos    = _registroContrato.ObtenerContratosPorIdSolicitud(ID_SOLICITUD);

            Label_NOMBRE_TRABAJADOR.Text = filaSolicitud["NOMBRES"].ToString().Trim() + " " + filaSolicitud["APELLIDOS"].ToString().Trim();
            Label_TIP_DOC_IDENTIDAD.Text = filaSolicitud["TIP_DOC_IDENTIDAD"].ToString().Trim() + " ";
            Label_NUM_DOC_IDENTIDAD.Text = filaSolicitud["NUM_DOC_IDENTIDAD"].ToString().Trim();
            Label_RAZ_SOCIAL.Text        = DropDownList_ID_EMPRESA.SelectedItem.Text;

            Cargar(tablaContratos);
        }
    }
    public void activarEmpleado()
    {
        radicacionHojasDeVida _sol     = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        registroContrato      contrato = new registroContrato(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        String valores = HiddenField_persona.Value;

        String[] val = valores.Split(',');

        DataTable tablaCont = contrato.ObtenerConRegContratosPorRegistro(Convert.ToInt32(val[5].ToString()));
        DataRow   filacont  = tablaCont.Rows[0];

        if (filacont["CONTRATO_IMPRESO"].Equals("S") & filacont["CLAUSULA_IMPRESO"].Equals("S"))
        {
            _sol.ActualizarEstadoRegSolicitudesIngreso(Convert.ToInt32(val[1].ToString()), Convert.ToInt32(val[0].ToString()), "CONTRATADO");
            Label_MENSAJE_Entregas.Text = "Se activo el empleado en el sistema";
            configurarMensajes(true, System.Drawing.Color.Green, Label_MENSAJE_Entregas, Panel_MENSAJE_Entregas);
        }
        else
        {
            Label_MENSAJE_Entregas.Text = "ADVERTENCIA: No se han impreso las clausulas o el contrato. Verifique por favor";
            configurarMensajes(true, System.Drawing.Color.Red, Label_MENSAJE_Entregas, Panel_MENSAJE_Entregas);
        }
    }
        public Boolean adicionarOrdenesExamenes(List <examenesEmpleado> examenesLab,
                                                Decimal ID_SOLICITUD,
                                                Decimal ID_ENTIDAD,
                                                String NUM_CUENTA,
                                                String FORMA_PAGO,
                                                String TIPO_CUENTA,
                                                Decimal ID_REQUERIMIENTO,
                                                String ID_CIUDAD,
                                                Decimal ID_CENTRO_C,
                                                Decimal ID_SUB_C,
                                                Decimal ID_SERVICIO,
                                                Decimal ID_EMPRESA,
                                                Boolean TIENE_CUENTA)
        {
            Boolean correcto = true;

            ordenExamenes orden   = new ordenExamenes(Empresa, Usuario);
            decimal       idOrden = 0;
            int           idLab   = 0;

            Conexion conexion = new Conexion(Empresa);

            conexion.IniciarTransaccion();

            try
            {
                foreach (examenesEmpleado item in examenesLab)
                {
                    if (item.valida == false)
                    {
                        idLab   = item.idLab;
                        idOrden = orden.AdicionarConRegOrdenExamen(item.idSolIngreso, item.idRequerimientos, conexion);
                        if (idOrden <= 0)
                        {
                            correcto = false;
                            conexion.DeshacerTransaccion();
                            MensajeError = orden.MensajeError;
                            break;
                        }
                        else
                        {
                            Decimal ID_EXAMEN_EMPLEADO = AdicionarConRegExamenesEmpleado(Convert.ToInt32(idOrden), item.registroAlmacen, 0, "N", item.fecha, conexion);

                            if (ID_EXAMEN_EMPLEADO <= 0)
                            {
                                correcto = false;
                                conexion.DeshacerTransaccion();
                                break;
                            }
                            else
                            {
                                item.valida = true;
                            }
                        }
                    }
                }

                if (correcto == true)
                {
                    radicacionHojasDeVida _radicacionHojasDeVida = new radicacionHojasDeVida(Empresa, Usuario);
                    if (_radicacionHojasDeVida.ActualizarEntidadNumCuenta(Convert.ToInt32(ID_SOLICITUD), Convert.ToInt32(ID_ENTIDAD), NUM_CUENTA, FORMA_PAGO, TIPO_CUENTA, conexion) == false)
                    {
                        correcto     = false;
                        MensajeError = _radicacionHojasDeVida.MensajeError;
                        conexion.DeshacerTransaccion();
                    }
                }

                if (correcto == true)
                {
                    ConRegContratoTemporal _contratoTemporal = new ConRegContratoTemporal(Empresa, Usuario);

                    Decimal ID_TEMPORAL = _contratoTemporal.AdicionarConRegContratoTemporal(ID_REQUERIMIENTO, ID_SOLICITUD, ID_CIUDAD, ID_CENTRO_C, ID_SUB_C, ID_SERVICIO, ID_EMPRESA, TIENE_CUENTA, conexion);

                    if (ID_TEMPORAL <= 0)
                    {
                        correcto     = false;
                        MensajeError = _contratoTemporal.MensajeError;
                        conexion.DeshacerTransaccion();
                    }
                }

                if (correcto == true)
                {
                    conexion.AceptarTransaccion();
                }
            }
            catch (ExecutionEngineException ex)
            {
                correcto     = false;
                MensajeError = ex.Message;
                conexion.DeshacerTransaccion();
            }
            finally
            {
                conexion.Desconectar();
            }

            return(correcto);
        }
    protected void GridView_RESULTADOS_BUSQUEDA_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView_RESULTADOS_BUSQUEDA.PageIndex = e.NewPageIndex;

        String datosCapturados = TextBox_BUSCAR.Text.ToUpper();

        radicacionHojasDeVida _SolIngreso = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        DataTable tablaResultadosBusqueda = new DataTable();


        if (DropDownList_BUSCAR.SelectedValue == "NOMBRES")
        {
            tablaResultadosBusqueda = _SolIngreso.ObtenerRegSolicitudesingresoPorNombres(datosCapturados);
        }
        else
        {
            if (DropDownList_BUSCAR.SelectedValue == "APELLIDOS")
            {
                tablaResultadosBusqueda = _SolIngreso.ObtenerRegSolicitudesingresoPorApellidos(datosCapturados);
            }
            else
            {
                if (DropDownList_BUSCAR.SelectedValue == "NUM_DOC_IDENTIDAD")
                {
                    tablaResultadosBusqueda = _SolIngreso.ObtenerRegSolicitudesingresoPorNumDocIdentidad(datosCapturados);
                }
            }
        }

        if (tablaResultadosBusqueda.Rows.Count <= 0)
        {
            if (_SolIngreso.MensajeError != null)
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _SolIngreso.MensajeError, Proceso.Error);
            }
            else
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "No se encontraron registros que cumplierna los datos de busqueda.", Proceso.Advertencia);
            }
        }
        else
        {
            Panel_RESULTADOS_GRID.Enabled           = true;
            Panel_RESULTADOS_GRID.Visible           = true;
            GridView_RESULTADOS_BUSQUEDA.DataSource = tablaResultadosBusqueda;
            GridView_RESULTADOS_BUSQUEDA.DataBind();


            DataRow filaSolicitud;
            for (int i = 0; i < GridView_RESULTADOS_BUSQUEDA.Rows.Count; i++)
            {
                filaSolicitud = tablaResultadosBusqueda.Rows[(GridView_RESULTADOS_BUSQUEDA.PageIndex * GridView_RESULTADOS_BUSQUEDA.PageSize) + i];

                if ((filaSolicitud["ARCHIVO"].ToString().ToUpper().Trim() == "DISPONIBLE") || (filaSolicitud["ARCHIVO"].ToString().ToUpper().Trim() == "ASPIRANTE") || (filaSolicitud["ARCHIVO"].ToString().ToUpper().Trim() == "CONTRATADO") || (filaSolicitud["ARCHIVO"].ToString().ToUpper().Trim() == "DESCARTADO SELECCION"))
                {
                    GridView_RESULTADOS_BUSQUEDA.Rows[i].Cells[0].Enabled = false;
                    GridView_RESULTADOS_BUSQUEDA.Rows[i].Cells[0].Text    = "";
                }
            }
        }
    }
        public Decimal ActualizarConceptosFijosEmpleado(Decimal ID_EMPLEADO, List <ConceptosNominaEmpleado> listaConceptos, Boolean ACTUALIZAR_ESTADO_PROCESO, Decimal ID_SOLICITUD)
        {
            Boolean ejecutar = true;

            if (ID_EMPLEADO == 0)
            {
                MensajeError = "El campo ID_EMPLEADO no puede ser 0\n";
                ejecutar     = false;
            }

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                conexion.IniciarTransaccion();

                try
                {
                    DataTable tablaConceptosActuales = ObtenerNomConceptosEmpleadosPorIdEmpleadoConceptosFijos(Convert.ToInt32(ID_EMPLEADO));

                    foreach (DataRow fila in tablaConceptosActuales.Rows)
                    {
                        ejecutar = true;
                        foreach (ConceptosNominaEmpleado filaDeLaLista in listaConceptos)
                        {
                            if (filaDeLaLista.REGISTRO == Convert.ToDecimal(fila["REGISTRO"]))
                            {
                                ejecutar = false;
                                break;
                            }
                        }

                        if (ejecutar == true)
                        {
                            if (desactivarConceptosFijoDeEmpleado(Convert.ToDecimal(fila["REGISTRO"]), conexion) == false)
                            {
                                conexion.DeshacerTransaccion();
                                return(0);
                            }
                        }
                    }

                    foreach (ConceptosNominaEmpleado filaDeLaLista in listaConceptos)
                    {
                        if (filaDeLaLista.REGISTRO == 0)
                        {
                            if (AdicionarConceptoFijoAEmpleado(ID_EMPLEADO, filaDeLaLista.ID_CONCEPTO, filaDeLaLista.CAN_PRE, filaDeLaLista.VAL_PRE, filaDeLaLista.LIQ_Q_1, filaDeLaLista.LIQ_Q_2, filaDeLaLista.LIQ_Q_3, filaDeLaLista.LIQ_Q_4, filaDeLaLista.ID_CLAUSULA, conexion) == 0)
                            {
                                conexion.DeshacerTransaccion();
                                return(0);
                            }
                        }
                    }

                    auditoriaContratos _auditoriaContratos = new auditoriaContratos(Empresa, Usuario);
                    Decimal            ID_AUDITORIA        = _auditoriaContratos.AdicionarAuditoriaContratos(ID_EMPLEADO, tabla.NOM_CONCEPTOS_EMPLEADO, 1, DateTime.Now, conexion);

                    if (ID_AUDITORIA <= 0)
                    {
                        conexion.DeshacerTransaccion();
                        MensajeError = _auditoriaContratos.MensajeError;
                        return(0);
                    }

                    if (ACTUALIZAR_ESTADO_PROCESO == true)
                    {
                        radicacionHojasDeVida _radicacionHojasDeVida = new radicacionHojasDeVida(Empresa, Usuario);

                        if (_radicacionHojasDeVida.ActualizarEstadoProcesoRegSolicitudesIngresoAuditoria(ID_SOLICITUD, tabla.VAR_ESTADO_PROCESO_CONCEPTOS_FIJOS, conexion) == false)
                        {
                            conexion.DeshacerTransaccion();
                            MensajeError = _radicacionHojasDeVida.MensajeError;
                            return(0);
                        }
                    }

                    conexion.AceptarTransaccion();
                    return(1);
                }
                catch
                {
                    conexion.DeshacerTransaccion();
                    return(0);
                }
                finally
                {
                    conexion.Desconectar();
                }
            }
            else
            {
                return(0);
            }
        }
    protected void Button_ADICIONAR_ENTREVISTA_Click(object sender, EventArgs e)
    {
        radicacionHojasDeVida _SolIngreso = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        regRegsitrosHojaVida  _Reg_HV     = new regRegsitrosHojaVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());


        Decimal NUM_DOC_IDENTIDAD = Convert.ToDecimal(TextBox_NUM_DOC_IDENTIDAD.Text);
        int     ID_REQUERIMIENTO  = 0;
        int     ID_SOLICITUD      = 0;

        String ARCHIVO = "DISPONIBLE";

        DataTable tablaSolIngreso = _SolIngreso.ObtenerRegSolicitudesingresoPorNumDocIdentidad(NUM_DOC_IDENTIDAD.ToString());
        DataRow   filaSolIngreso  = tablaSolIngreso.Rows[0];

        if (filaSolIngreso["ARCHIVO"].Equals("CONTRATADO"))
        {
            Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "La persona seleccionada no puede ser descartada, porque ya se encuentra en estado CONTRATADA.", Proceso.Advertencia);
        }
        else
        {
            if (RadioButtonList_TipoDescarte.SelectedValue == "-")
            {
                ARCHIVO = "DESCARTADO SELECCION";
            }

            ID_SOLICITUD = Convert.ToInt32(filaSolIngreso["ID_SOLICITUD"].ToString());

            if (!(String.IsNullOrEmpty(filaSolIngreso["ID_REQUERIMIENTO"].ToString())))
            {
                ID_REQUERIMIENTO = Convert.ToInt32(filaSolIngreso["ID_REQUERIMIENTO"].ToString());
            }

            if (Cliente.Checked)
            {
                _Reg_HV.AdicionarRegRegistrosHojaVida(ID_SOLICITUD, "DESC. CONTRATACION", TextBox_comentarios_Entrevista.Text.ToString(), "CLIENTE", ID_REQUERIMIENTO);
                _SolIngreso.ActualizarEstadoRegSolicitudesIngreso(ID_REQUERIMIENTO, ID_SOLICITUD, ARCHIVO);


                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "La persona seleccionada fue descartada exitosamente.", Proceso.Correcto);
            }
            else if (Cuenta.Checked)
            {
                _Reg_HV.AdicionarRegRegistrosHojaVida(ID_SOLICITUD, "DESC. CONTRATACION", TextBox_comentarios_Entrevista.Text.ToString(), "CUENTA", ID_REQUERIMIENTO);

                _SolIngreso.ActualizarEstadoRegSolicitudesIngreso(ID_REQUERIMIENTO, ID_SOLICITUD, ARCHIVO);


                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "La persona seleccionada fue descartada exitosamente.", Proceso.Correcto);
            }
            else if (Examenes.Checked)
            {
                _Reg_HV.AdicionarRegRegistrosHojaVida(ID_SOLICITUD, "DESC. CONTRATACION", TextBox_comentarios_Entrevista.Text.ToString(), "EXAMENES", ID_REQUERIMIENTO);

                _SolIngreso.ActualizarEstadoRegSolicitudesIngreso(ID_REQUERIMIENTO, ID_SOLICITUD, ARCHIVO);


                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_FONDO_MENSAJE, Label_MENSAJE, "La persona seleccionada fue descartada exitosamente.", Proceso.Correcto);
            }
            else if (firma.Checked)
            {
                _Reg_HV.AdicionarRegRegistrosHojaVida(ID_SOLICITUD, "DESC. CONTRATACION", TextBox_comentarios_Entrevista.Text.ToString(), "FIRMA", ID_REQUERIMIENTO);

                _SolIngreso.ActualizarEstadoRegSolicitudesIngreso(ID_REQUERIMIENTO, ID_SOLICITUD, ARCHIVO);


                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "La persona seleccionada fue descartada exitosamente.", Proceso.Correcto);
            }
            else if (Otros.Checked)
            {
                _Reg_HV.AdicionarRegRegistrosHojaVida(ID_SOLICITUD, "DESC. CONTRATACION", TextBox_comentarios_Entrevista.Text.ToString(), "OTROS", ID_REQUERIMIENTO);

                _SolIngreso.ActualizarEstadoRegSolicitudesIngreso(ID_REQUERIMIENTO, ID_SOLICITUD, ARCHIVO);


                Informar(Panel_MENSAJES, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "La persona seleccionada fue descartada exitosamente.", Proceso.Correcto);
            }

            Panel_Descarte_Entrevista.Enabled = false;

            Button3.Visible           = false;
            Button5.Visible           = false;
            Button_ENTREVISTA.Visible = false;

            TextBox_ESTADO_ASPIRANTE.Text = ARCHIVO;
        }
    }
    private void Buscar()
    {
        Ocultar(Acciones.Inicio);
        Mostrar(Acciones.Inicio);

        String datosCapturados = HiddenField_FILTRO_DATO.Value;
        String campo           = HiddenField_FILTRO_DROP.Value;

        radicacionHojasDeVida _SolIngreso = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        DataTable tablaResultadosBusqueda = new DataTable();

        if (campo == "NOMBRES")
        {
            tablaResultadosBusqueda = _SolIngreso.ObtenerRegSolicitudesingresoPorNombres(datosCapturados);
        }
        else
        {
            if (campo == "APELLIDOS")
            {
                tablaResultadosBusqueda = _SolIngreso.ObtenerRegSolicitudesingresoPorApellidos(datosCapturados);
            }
            else
            {
                if (campo == "NUM_DOC_IDENTIDAD")
                {
                    tablaResultadosBusqueda = _SolIngreso.ObtenerRegSolicitudesingresoPorNumDocIdentidad(datosCapturados);
                }
            }
        }

        if (tablaResultadosBusqueda.Rows.Count <= 0)
        {
            if (_SolIngreso.MensajeError != null)
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _SolIngreso.MensajeError, Proceso.Error);
            }
            else
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "ADVERTENCIA: No se encontraron registros que cumplieran los datos de busqueda.", Proceso.Advertencia);
            }
        }
        else
        {
            Panel_RESULTADOS_GRID.Visible           = true;
            GridView_RESULTADOS_BUSQUEDA.DataSource = tablaResultadosBusqueda;
            GridView_RESULTADOS_BUSQUEDA.DataBind();

            DataRow filaSolicitud;
            for (int i = 0; i < GridView_RESULTADOS_BUSQUEDA.Rows.Count; i++)
            {
                filaSolicitud = tablaResultadosBusqueda.Rows[(GridView_RESULTADOS_BUSQUEDA.PageIndex * GridView_RESULTADOS_BUSQUEDA.PageSize) + i];

                if ((filaSolicitud["ARCHIVO"].ToString().ToUpper().Trim() == "CONTRATADO"))
                {
                    GridView_RESULTADOS_BUSQUEDA.Rows[i].Cells[0].Enabled = false;
                    GridView_RESULTADOS_BUSQUEDA.Rows[i].Cells[0].Text    = "";
                }
            }
        }
    }
    private void Cargar(Decimal ID_SOLICITUD, Decimal ID_EMPLEADO, Decimal ID_EMPRESA, Decimal REGISTRO_CONTRATO)
    {
        HiddenField_ID_SOLICITUD.Value      = ID_SOLICITUD.ToString();
        HiddenField_ID_EMPLEADO.Value       = ID_EMPLEADO.ToString();
        HiddenField_ID_EMPRESA.Value        = ID_EMPRESA.ToString();
        HiddenField_REGISTRO_CONTRATO.Value = REGISTRO_CONTRATO.ToString();

        radicacionHojasDeVida _radicacionHojasDeVida = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable             tablaInfoTrabajador    = _radicacionHojasDeVida.ObtenerRegSolicitudesingresoPorIdSolicitud(Convert.ToInt32(ID_SOLICITUD));

        cliente   _cliente     = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaCliente = _cliente.ObtenerEmpresaConIdEmpresa(ID_EMPRESA);

        if (tablaInfoTrabajador.Rows.Count <= 0)
        {
            if (_radicacionHojasDeVida.MensajeError != null)
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _radicacionHojasDeVida.MensajeError, Proceso.Error);
            }
            else
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "No se encontró información del Trabajador Seleciconado.", Proceso.Advertencia);
            }
        }
        else
        {
            if (tablaCliente.Rows.Count <= 0)
            {
                if (_cliente.MensajeError != null)
                {
                    Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _cliente.MensajeError, Proceso.Error);
                }
                else
                {
                    Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "No se encontró información de la Empresa asociada al trabajador.", Proceso.Advertencia);
                }
            }
            else
            {
                DataRow filainfoCliente = tablaCliente.Rows[0];

                cargarInfoTrabajador(tablaInfoTrabajador.Rows[0], filainfoCliente);

                MotivoRotacionRetiro _motivo = new MotivoRotacionRetiro(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
                DataTable            tablaMotivosAsociadosAEmpresa = _motivo.ObtenerMotivosActivosEmpresa(ID_EMPRESA);

                if (tablaMotivosAsociadosAEmpresa.Rows.Count <= 0)
                {
                    if (_motivo.MensajeError != null)
                    {
                        Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _motivo.MensajeError, Proceso.Error);
                    }
                    else
                    {
                        Ocultar(Acciones.Inicio);
                        Desactivar(Acciones.Inicio);
                        Mostrar(Acciones.Inicio);
                        Cargar(Acciones.Inicio);

                        Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "La empresa no tiene Motivos de Rotación y Retiros asociados.", Proceso.Advertencia);
                    }
                }
                else
                {
                    _motivo.MensajeError = null;

                    Boolean correcto = true;

                    DataTable tablaResultadosEntrevistaRetiro = _motivo.ObtenerResultadosEntrevistaDeRetiroParaEmpleado(ID_EMPLEADO);

                    if (tablaResultadosEntrevistaRetiro.Rows.Count <= 0)
                    {
                        if (_motivo.MensajeError != null)
                        {
                            if (_motivo.MensajeError != null)
                            {
                                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _motivo.MensajeError, Proceso.Error);
                                correcto = false;
                            }
                        }
                    }

                    if (correcto == true)
                    {
                        DataTable tablaparaGrilla = configurarTablaParaGrillaMotivos();

                        Boolean idEncontrado = false;

                        Int32 contadorResultados = 0;

                        for (int i = 0; i < tablaMotivosAsociadosAEmpresa.Rows.Count; i++)
                        {
                            idEncontrado = false;

                            DataRow filaMotivo     = tablaMotivosAsociadosAEmpresa.Rows[i];
                            DataRow filaParaGrilla = tablaparaGrilla.NewRow();

                            filaParaGrilla["ID_MAESTRA_ROTACION"] = filaMotivo["ID_MAESTRA_ROTACION"];
                            filaParaGrilla["ID_DETALLE_ROTACION"] = filaMotivo["ID_DETALLE_ROTACION"];
                            filaParaGrilla["ID_ROTACION_EMPRESA"] = filaMotivo["ID_ROTACION_EMPRESA"];

                            filaParaGrilla["TITULO"] = filaMotivo["TITULO"];
                            filaParaGrilla["TITULO_MAESTRA_ROTACION"] = filaMotivo["TITULO_MAESTRA_ROTACION"];

                            Decimal ID_ROTACION_EMPRESA_1 = Convert.ToDecimal(filaMotivo["ID_ROTACION_EMPRESA"]);

                            Decimal ID_DETALLE_ROTACION_EMPLEADO = 0;

                            for (int j = 0; j < tablaResultadosEntrevistaRetiro.Rows.Count; j++)
                            {
                                DataRow filaResultado = tablaResultadosEntrevistaRetiro.Rows[j];

                                Decimal ID_ROTACION_EMPRESA_2 = Convert.ToDecimal(filaResultado["ID_ROTACION_EMPRESA"]);

                                if (ID_ROTACION_EMPRESA_1 == ID_ROTACION_EMPRESA_2)
                                {
                                    contadorResultados += 1;

                                    ID_DETALLE_ROTACION_EMPLEADO = Convert.ToDecimal(filaResultado["ID_DETALLE_ROTACION_EMPLEADO"]);
                                    idEncontrado = true;

                                    if (contadorResultados == 1)
                                    {
                                        HiddenField_ID_MAESTRA_ENTREVISTA_EMPLEADO.Value = filaResultado["ID_MAESTRA_ROTACION_EMPLEADO"].ToString().Trim();

                                        TextBox_Observaciones.Text = filaResultado["OBSERVACIONES"].ToString().Trim();
                                    }
                                    break;
                                }
                            }

                            if (idEncontrado == true)
                            {
                                filaParaGrilla["ID_DETALLE_ROTACION_EMPLEADO"] = ID_DETALLE_ROTACION_EMPLEADO;
                            }
                            else
                            {
                                filaParaGrilla["ID_DETALLE_ROTACION_EMPLEADO"] = 0;
                            }

                            tablaparaGrilla.Rows.Add(filaParaGrilla);
                        }

                        CargarGrillaMotivosRotacionDesdeTabla(tablaparaGrilla);

                        Ocultar(Acciones.Inicio);

                        if (contadorResultados <= 0)
                        {
                            Mostrar(Acciones.Nuevo);
                            Activar(Acciones.Nuevo);
                            Limpiar(Acciones.Nuevo);

                            habilitarFilasGrilla(GridView_MotivosRotacion, 0);
                        }
                        else
                        {
                            Mostrar(Acciones.Cargar);
                            Desactivar(Acciones.Cargar);

                            inhabilitarFilasGrilla(GridView_MotivosRotacion, 0);
                        }
                    }
                }
            }
        }
    }
        public Decimal AdicionarRegRegistrosHojaVida(Decimal ID_SOLICITUD,
                                                     String CLASE_REGISTRO,
                                                     String COMENTARIOS,
                                                     String MOTIVO,
                                                     Decimal ID_REQUERIMIENTO)
        {
            Boolean correcto = true;

            Decimal REGISTRO_HOJA_VIDA = 0;
            String  ARCHIVO            = "";

            Conexion conexion = new Conexion(Empresa);

            conexion.IniciarTransaccion();

            try
            {
                REGISTRO_HOJA_VIDA = AdicionarRegistroHojaVida(ID_SOLICITUD, CLASE_REGISTRO, COMENTARIOS, MOTIVO, ID_REQUERIMIENTO, conexion);

                if (REGISTRO_HOJA_VIDA <= 0)
                {
                    conexion.DeshacerTransaccion();
                    correcto           = false;
                    REGISTRO_HOJA_VIDA = 0;
                }
                else
                {
                    if (CLASE_REGISTRO == "DESC. SELECCION")
                    {
                        ARCHIVO = "DESCARTADO SELECCION";
                    }
                    else
                    {
                        ARCHIVO = "DISPONIBLE";
                    }

                    radicacionHojasDeVida _radicacionHojasDeVida = new radicacionHojasDeVida(Empresa, Usuario);

                    if (_radicacionHojasDeVida.ActualizarEstadoRegSolicitudesIngreso(ID_REQUERIMIENTO, ID_SOLICITUD, ARCHIVO, conexion) == false)
                    {
                        conexion.DeshacerTransaccion();
                        correcto           = false;
                        REGISTRO_HOJA_VIDA = 0;
                        MensajeError       = _radicacionHojasDeVida.MensajeError;
                    }
                }

                if (correcto == true)
                {
                    conexion.AceptarTransaccion();
                }
            }
            catch (Exception ex)
            {
                conexion.DeshacerTransaccion();
                MensajeError       = ex.Message;
                correcto           = false;
                REGISTRO_HOJA_VIDA = 0;
            }
            finally
            {
                conexion.Desconectar();
            }

            return(REGISTRO_HOJA_VIDA);
        }
        public Boolean actualizarExamenesYFormaPago(List <examenesEmpleado> listaExamenes,
                                                    Decimal ID_SOLICITUD,
                                                    Decimal ID_ENTIDAD,
                                                    String NUM_CUENTA,
                                                    String FORMA_PAGO,
                                                    String TIPO_CUENTA)
        {
            Boolean correcto = true;

            Conexion conexion = new Conexion(Empresa);

            conexion.IniciarTransaccion();

            try
            {
                radicacionHojasDeVida _radicacionHojasDeVida = new radicacionHojasDeVida(Empresa, Usuario);
                autoRecomendaciones   _auto = new autoRecomendaciones(Empresa, Usuario);

                if (_radicacionHojasDeVida.ActualizarEntidadNumCuenta(ID_SOLICITUD, ID_ENTIDAD, NUM_CUENTA, FORMA_PAGO, TIPO_CUENTA, conexion) == false)
                {
                    correcto     = false;
                    MensajeError = _radicacionHojasDeVida.MensajeError;
                    conexion.DeshacerTransaccion();
                }
                else
                {
                    foreach (examenesEmpleado examen in listaExamenes)
                    {
                        if (examen.ARCHIVO_EXAMEN == null)
                        {
                            if (ActualizarConRegExamenesEmpleado(examen.registro, examen.IdOrden, examen.IdExamen, 0, "S", examen.Fecha, conexion) == false)
                            {
                                correcto = false;
                                conexion.DeshacerTransaccion();
                                break;
                            }
                        }
                        else
                        {
                            if (ActualizarConRegExamenesEmpleadoConArchivo(examen.registro, examen.IdOrden, examen.IdExamen, 0, "S", examen.Fecha, examen.ARCHIVO_EXAMEN, examen.ARCHIVO_EXTENSION, examen.ARCHIVO_TAMANO, examen.ARCHIVO_TYPE, conexion) == false)
                            {
                                correcto = false;
                                conexion.DeshacerTransaccion();
                                break;
                            }
                        }

                        if (correcto == true)
                        {
                            if (String.IsNullOrEmpty(examen.AutoRecomendacion) == false)
                            {
                                if (_auto.AdicionarConRegAutoRecomendaciones(examen.registro, examen.AutoRecomendacion, examen.Fecha, conexion) <= 0)
                                {
                                    correcto     = false;
                                    MensajeError = _auto.MensajeError;
                                    conexion.DeshacerTransaccion();
                                    break;
                                }
                            }
                        }
                    }
                }

                if (correcto == true)
                {
                    conexion.AceptarTransaccion();
                }
            }
            catch (Exception ex)
            {
                conexion.DeshacerTransaccion();
                correcto     = false;
                MensajeError = ex.Message;
            }
            finally
            {
                conexion.Desconectar();
            }

            return(correcto);
        }
    private void ProcesarArchivo()
    {
        DataTable tablaErrores = IniciarTablaErrores();

        Int32 contador           = 0;
        Int32 contadorOmitidos   = 0;
        Int32 contadorErrores    = 0;
        Int32 contadorIngresados = 0;

        using (StreamReader archivo = new StreamReader(FileUpload_ArchivoPlano.PostedFile.InputStream))
        {
            String linea;

            radicacionHojasDeVida _rad = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

            while ((linea = archivo.ReadLine()) != null)
            {
                contador += 1;
                String[] campos = linea.Split(';');

                DataRow fila;

                if ((campos.Length < 4) || (campos.Length > 4))
                {
                    fila = tablaErrores.NewRow();
                    fila["CODIGO_ERROR"] = "ERROR_NUM_CAMPOS";
                    fila["LINEA"]        = contador;
                    fila["CAMPO"]        = null;
                    fila["DESCRIPCION"]  = "El numero de campos de la linea (" + campos.Length.ToString() + ") no corresponde al establecido (4).";

                    tablaErrores.Rows.Add(fila);

                    contadorErrores += 1;
                }
                else
                {
                    if ((campos[0].ToUpper() != "CC") && (campos[0].ToUpper() != "TI") && (campos[0].ToUpper() != "CE"))
                    {
                        fila = tablaErrores.NewRow();
                        fila["CODIGO_ERROR"] = "ERROR_TIPO_DOC_IDENTIDAD";
                        fila["LINEA"]        = contador;
                        fila["CAMPO"]        = "TIPO_DOCUMENTO_IDENTIDAD";
                        fila["DESCRIPCION"]  = "Solo se admiten los siguientes valores CC - CE - TI - PA";

                        tablaErrores.Rows.Add(fila);

                        contadorErrores += 1;
                    }
                    else
                    {
                        if (IsNumeric(campos[1]) == false)
                        {
                            fila = tablaErrores.NewRow();
                            fila["CODIGO_ERROR"] = "ERROR_NON_NUMERIC";
                            fila["LINEA"]        = contador;
                            fila["CAMPO"]        = "NUMERO_DOCUMENTO";
                            fila["DESCRIPCION"]  = "Solo se admiten numeros, sin espacios, lineas, puntos y comas.";

                            tablaErrores.Rows.Add(fila);

                            contadorErrores += 1;
                        }
                        else
                        {
                            if (String.IsNullOrEmpty(campos[2]) == true)
                            {
                                fila = tablaErrores.NewRow();
                                fila["CODIGO_ERROR"] = "ERROR_NULL";
                                fila["LINEA"]        = contador;
                                fila["CAMPO"]        = "NOMBRES_ASPIRANTE ";
                                fila["DESCRIPCION"]  = "El campos no puede ser nulo o vacio.";

                                tablaErrores.Rows.Add(fila);

                                contadorErrores += 1;
                            }
                            else
                            {
                                if (String.IsNullOrEmpty(campos[3]) == true)
                                {
                                    fila = tablaErrores.NewRow();
                                    fila["CODIGO_ERROR"] = "ERROR_NULL";
                                    fila["LINEA"]        = contador;
                                    fila["CAMPO"]        = "APELLIDOS_ASPIRANTE ";
                                    fila["DESCRIPCION"]  = "El campos no puede ser nulo o vacio.";

                                    tablaErrores.Rows.Add(fila);

                                    contadorErrores += 1;
                                }
                                else
                                {
                                    _rad.MensajeError = null;

                                    Int32 contadorRegSol = _rad.ObtenerNumRegSolicitudesPorTipDocAndNumDoc(campos[0], campos[1]);
                                    if (contadorRegSol <= 0)
                                    {
                                        if (_rad.MensajeError != null)
                                        {
                                            fila = tablaErrores.NewRow();
                                            fila["CODIGO_ERROR"] = "ERROR_BD";
                                            fila["LINEA"]        = contador;
                                            fila["CAMPO"]        = null;
                                            fila["DESCRIPCION"]  = "Eror en Base de datos al intentar consultar si el registro ya se encuentra: " + _rad.MensajeError;

                                            tablaErrores.Rows.Add(fila);

                                            contadorErrores += 1;
                                        }
                                        else
                                        {
                                            if (_rad.AdicionarRegistroRegSolicitudIngresoMasivo(campos[3], campos[2], campos[0], campos[1]) <= 0)
                                            {
                                                fila = tablaErrores.NewRow();
                                                fila["CODIGO_ERROR"] = "ERROR_BD";
                                                fila["LINEA"]        = contador;
                                                fila["CAMPO"]        = null;
                                                fila["DESCRIPCION"]  = "Eror en Base de datos al intentar ingresar el registro del aspirante: " + _rad.MensajeError;

                                                tablaErrores.Rows.Add(fila);

                                                contadorErrores += 1;
                                            }
                                            else
                                            {
                                                contadorIngresados += 1;
                                            }
                                        }
                                    }
                                    else
                                    {
                                        contadorOmitidos += 1;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        Label_TotalRegistroProcesados.Text = contador.ToString();
        Label_RegistrosErroneos.Text       = contadorErrores.ToString();
        Label_RegistrosInsertados.Text     = contadorIngresados.ToString();
        Label_RegistrosOmitidos.Text       = contadorOmitidos.ToString();

        GridView_ResultadosCargue.DataSource = tablaErrores;
        GridView_ResultadosCargue.DataBind();

        Ocultar(Acciones.Resultados);
        Mostrar(Acciones.Resultados);

        Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "El archivo fue procesado, por favor verifique la información en la sección de Resultados del Cargue.", Proceso.Correcto);
    }
    protected void Button_Guardar_Click(object sender, EventArgs e)
    {
        EntregaServicioComplementario _entregas = new EntregaServicioComplementario(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        String       idEntrega = null;
        String       talla     = null;
        DropDownList dropTalla;
        TextBox      CantidadaEntregar;
        DataTable    tablaConfigurados = new DataTable();

        tablaConfigurados.Columns.Add("ID_PRODUCTO");
        tablaConfigurados.Columns.Add("CANTIDAD_A_ENTREGAR");
        tablaConfigurados.Columns.Add("TALLA");

        DataTable tablaLotes = new DataTable();

        tablaLotes.Columns.Add("ID_PRODUCTO");
        tablaLotes.Columns.Add("ID_LOTE");
        tablaLotes.Columns.Add("TALLA");
        tablaLotes.Columns.Add("CONTENIDO_LOTE");
        tablaLotes.Columns.Add("CANTIDAD_CONFIGURADA");

        String[] datos    = HiddenField_persona.Value.Split(',');
        int      empleado = Convert.ToInt32(datos[6].ToString());
        int      id_producto;
        int      id_lote;
        int      ContenidoLote;
        int      cantidadConf;
        DateTime fecha = System.DateTime.Today;

        for (int i = 0; i < GridView_Entregas_Configurados.Rows.Count; i++)
        {
            id_producto       = Convert.ToInt32(GridView_Entregas_Configurados.DataKeys[i].Values["ID_PRODUCTO"].ToString());
            dropTalla         = GridView_Entregas_Configurados.Rows[i].FindControl("DropDownList_Talla") as DropDownList;
            CantidadaEntregar = GridView_Entregas_Configurados.Rows[i].FindControl("TextBox_Cantidad") as TextBox;

            DataRow productosConfigurados = tablaConfigurados.NewRow();

            productosConfigurados[0] = id_producto;
            productosConfigurados[1] = CantidadaEntregar.Text;
            productosConfigurados[2] = dropTalla.SelectedValue;

            tablaConfigurados.Rows.Add(productosConfigurados);
        }
        for (int i = 0; i < GridView_lotes.Rows.Count; i++)
        {
            id_producto   = Convert.ToInt32(GridView_lotes.DataKeys[i].Values["ID_PRODUCTO"].ToString());
            id_lote       = Convert.ToInt32(GridView_lotes.DataKeys[i].Values["ID_LOTE"].ToString());
            talla         = GridView_lotes.Rows[i].Cells[3].Text;
            ContenidoLote = Convert.ToInt32(GridView_lotes.Rows[i].Cells[2].Text);
            cantidadConf  = Convert.ToInt32(GridView_lotes.Rows[i].Cells[4].Text);

            DataRow lotesDisponibles = tablaLotes.NewRow();

            lotesDisponibles[0] = id_producto;
            lotesDisponibles[1] = id_lote;
            lotesDisponibles[2] = talla;
            lotesDisponibles[3] = ContenidoLote;
            lotesDisponibles[4] = cantidadConf;

            tablaLotes.Rows.Add(lotesDisponibles);
        }
        if (HiddenField_idBodega.Value.Equals(""))
        {
            Label_MENSAJE_Entregas.Text = "ADVERTENCIA: No se tiene bodega. Verifique con el administrador";
            configurarMensajes(true, System.Drawing.Color.Red, Label_MENSAJE_Entregas, Panel_MENSAJE_Entregas);
        }
        else
        {
            int    idbodega  = Convert.ToInt32(HiddenField_idBodega.Value);
            String faltantes = HiddenField_Faltantes.Value;
            idEntrega = _entregas.adicionarEntregas(empleado, fecha, idbodega, tablaConfigurados, tablaLotes, datos, faltantes);

            HiddenField_idEntrega.Value = idEntrega;

            if (idEntrega.Equals(""))
            {
                Label_MENSAJE_Entregas.Text = "ADVERTENCIA: No se almaceno correctamente la entrega. Verifique por favor" + _entregas.MensajeError;
                configurarMensajes(true, System.Drawing.Color.Red, Label_MENSAJE_Entregas, Panel_MENSAJE_Entregas);
            }
            else
            {
                Panel_Entregas_configurados.Enabled = false;
                registroContrato  _contrato = new registroContrato(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
                SecureQueryString QueryStringSeguro;
                tools             _tools = new tools();
                QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro(), Request["data"]);
                String   persona                  = QueryStringSeguro["persona"].ToString();
                String[] datosEmpleado            = persona.Split(',');
                radicacionHojasDeVida _solIngreso = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

                _solIngreso.ActualizarEstadoProcesoRegSolicitudesIngreso(Convert.ToInt32(datosEmpleado[1]), Convert.ToInt32(datosEmpleado[0]), "CONTRATADO", Session["USU_LOG"].ToString());


                Label_MENSAJE_Entregas.Text = "La entrega se almacenó correctamente. Número entrega: " + idEntrega;
                configurarMensajes(true, System.Drawing.Color.Green, Label_MENSAJE_Entregas, Panel_MENSAJE_Entregas);
                activarEmpleado();
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Header.Title = "SERVICIOS COMPLEMENTARIOS";
        tools             _tools = new tools();
        SecureQueryString QueryStringSeguro;

        QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro(), Request["data"]);

        if (IsPostBack == false)
        {
            String accion = QueryStringSeguro["accion"].ToString();
            if (accion == "inicial")
            {
                iniciar_interfaz_inicial();
                iniciar_seccion_de_busqueda();
                Panel_BOTONES_INTERNOS.Visible = true;
                cargar_menu_botones_modulos_internos(false);
            }
            else if (accion == "cargar")
            {
                String           persona = QueryStringSeguro["persona"].ToString();
                String[]         datos   = persona.Split(',');
                String           datosPersona;
                String           ID_EMPRESA = datos[3];
                registroContrato _cont      = new registroContrato(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
                DataTable        tablaCont  = _cont.ObtenerPorNumIdentificacionActivo(datos[4].ToString());

                Panel_BOTONES_INTERNOS.Visible = true;

                if (tablaCont.Rows.Count <= 0)
                {
                    Label_MENSAJE.Text = "ADVERTENCIA: A la persona no puede entregarsele dotación ni epp por que no ha sido contratado";
                    configurarMensajes(true, System.Drawing.Color.Red, Label_MENSAJE, Panel_MENSAJES);

                    Panel_Entregas_configurados.Visible = false;
                    Panel_FORM_BOTONES.Visible          = false;
                    Panel_RESULTADOS_GRID.Visible       = false;
                    Panel_BOTONES_MENU.Visible          = false;

                    Panel_MENSAJES.Visible         = true;
                    Panel_MENSAJE_Entregas.Visible = false;


                    String ID_SOLICITUD      = datos[0];
                    String ID_REQUERIMIENTO  = datos[1];
                    String ID_OCUPACION      = datos[2];
                    String NUM_DOC_IDENTIDAD = datos[4];

                    radicacionHojasDeVida _solIngreso = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
                    DataTable             tablasol    = _solIngreso.ObtenerRegSolicitudesingresoPorNumDocIdentidad(NUM_DOC_IDENTIDAD);

                    DataRow filaSolIngreso = tablasol.Rows[0];
                    String  nombre         = filaSolIngreso["NOMBRES"] + " " + filaSolIngreso["APELLIDOS"];

                    cliente   _empresa     = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
                    DataTable tablaEmpresa = _empresa.ObtenerEmpresaConIdEmpresa(Convert.ToDecimal(ID_EMPRESA));
                    DataRow   filaEmpresa  = tablaEmpresa.Rows[0];

                    cargo     _cargo         = new cargo(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
                    DataTable tablaOcupacion = _cargo.ObtenerOcupacionPorIdOcupacion(Convert.ToDecimal(ID_OCUPACION));
                    DataRow   filaOcupacion  = tablaOcupacion.Rows[0];

                    datosPersona = "Nombre: " + nombre + "<br> Numero Identificación: " + NUM_DOC_IDENTIDAD + "<br> Empresa: " + filaEmpresa["RAZ_SOCIAL"] + "<br>Cargo: " + filaOcupacion["NOM_OCUPACION"];

                    HiddenField_persona.Value = persona.Trim();
                    configurarInfoAdicionalModulo(true, datosPersona);
                    cargar_menu_botones_modulos_internos(false);

                    Panel_BOTONES_INTERNOS.Visible = true;
                }
                else
                {
                    DataRow filaCon = tablaCont.Rows[0];

                    Panel_Entregas_configurados.Visible = false;
                    Panel_FORM_BOTONES.Visible          = false;
                    Panel_RESULTADOS_GRID.Visible       = false;
                    Panel_BOTONES_MENU.Visible          = false;

                    Panel_MENSAJES.Visible         = false;
                    Panel_MENSAJE_Entregas.Visible = false;

                    String ID_SOLICITUD      = datos[0];
                    String ID_REQUERIMIENTO  = datos[1];
                    String ID_OCUPACION      = datos[2];
                    String NUM_DOC_IDENTIDAD = datos[4];
                    String ID_CONTRATO;
                    String ID_EMPLEADO;

                    if (datos.Length == 7)
                    {
                        ID_CONTRATO = datos[5];
                        ID_EMPLEADO = datos[6];
                    }
                    else
                    {
                        ID_CONTRATO = filaCon["ID_CONTRATO"].ToString();
                        ID_EMPLEADO = filaCon["ID_EMPLEADO"].ToString();
                    }

                    radicacionHojasDeVida _solIngreso = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
                    DataTable             tablasol    = _solIngreso.ObtenerRegSolicitudesingresoPorNumDocIdentidad(NUM_DOC_IDENTIDAD);

                    DataRow filaSolIngreso = tablasol.Rows[0];
                    String  nombre         = filaSolIngreso["NOMBRES"] + " " + filaSolIngreso["APELLIDOS"];

                    cliente   _empresa     = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
                    DataTable tablaEmpresa = _empresa.ObtenerEmpresaConIdEmpresa(Convert.ToDecimal(ID_EMPRESA));
                    DataRow   filaEmpresa  = tablaEmpresa.Rows[0];

                    cargo     _cargo         = new cargo(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
                    DataTable tablaOcupacion = _cargo.ObtenerOcupacionPorIdOcupacion(Convert.ToDecimal(ID_OCUPACION));
                    DataRow   filaOcupacion  = tablaOcupacion.Rows[0];

                    persona = "Nombre: " + nombre + "<br> Numero Identificación: " + NUM_DOC_IDENTIDAD + "<br> Empresa: " + filaEmpresa["RAZ_SOCIAL"] + "<br>Cargo: " + filaOcupacion["NOM_OCUPACION"];
                    configurarInfoAdicionalModulo(true, persona);

                    HiddenField_persona.Value = ID_SOLICITUD + "," + ID_REQUERIMIENTO + "," + ID_OCUPACION + "," + ID_EMPRESA + "," + NUM_DOC_IDENTIDAD.Trim() + "," + ID_CONTRATO + "," + ID_EMPLEADO;

                    cargar_menu_botones_modulos_internos(false);

                    iniciar_interfaz_para_registro_existente();
                }
            }
        }
    }