protected void GridView_CONTRATOS_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        Mostrar(Acciones.ContratoSeleccionado);
        Limpiar(Acciones.ContratoSeleccionado);

        int index = Convert.ToInt32(e.CommandArgument);

        poner_color_a_grilla_contratos();
        GridView_CONTRATOS.Rows[index].BackColor = colorSeleccionado;

        Decimal ID_EMPLEADO = Convert.ToDecimal(GridView_CONTRATOS.DataKeys[index].Values["ID_EMPLEADO"]);
        HiddenField_ID_EMPLEADO.Value = ID_EMPLEADO.ToString();

        Operacion _operacion = new Operacion(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaContrato = _operacion.ObtenerInformacionContratoPorIdEmpleado(ID_EMPLEADO);
        DataRow filaContrato = tablaContrato.Rows[0];

        HiddenField_ID_CONTRATO.Value = filaContrato["ID_CONTRATO"].ToString();
        HiddenField_ID_SOLICITUD.Value = filaContrato["ID_SOLICITUD"].ToString();
        HiddenField_ID_PERFIL.Value = filaContrato["ID_PERFIL_REQUISICION"].ToString();
        HiddenField_ID_REFERENCIA.Value = filaContrato["ID_REFERENCIA"].ToString();
        HiddenField_ID_REQUERIMIENTO.Value = filaContrato["ID_REQUERIMIENTO"].ToString();

        cargar_DropDownList_CONTACTO_SELECCION();
        cargar_DropDownList_CONTACTO_CONTRATACION();
    }
    private void cargar_DropDownList_ID_TRABAJADOR(String dato)
    {
        Ocultar(Acciones.BuscarEmpleado);

        Decimal ID_EMPRESA = Convert.ToDecimal(HiddenField_ID_EMPRESA.Value);

        DropDownList_ID_TRABAJADOR.Items.Clear();

        System.Web.UI.WebControls.ListItem item = new System.Web.UI.WebControls.ListItem ("Seleccione...", "");
        DropDownList_ID_TRABAJADOR.Items.Add(item);

        Operacion _operacion = new Operacion(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaTrabajadores = _operacion.BuscarInformacionContratosEmpresa(dato, ID_EMPRESA);

        foreach (DataRow fila in tablaTrabajadores.Rows)
        {
            item = new System.Web.UI.WebControls.ListItem(fila["NOMBRES"].ToString().Trim() + " " + fila["APELLIDOS"].ToString(), fila["ID_SOLICITUD"].ToString().Trim());
            DropDownList_ID_TRABAJADOR.Items.Add(item);
        }

        DropDownList_ID_TRABAJADOR.DataBind();
    }
    private Dictionary<String, byte[]> ObtenerArchivosSeleccionados(String prefijoNombreArchivo, SeccionEnvio seccion)
    {
        Decimal ID_SOLICITUD = Convert.ToDecimal(TextBox_ID_SOLICITUD.Text.Trim());
        Decimal ID_PERFIL = Convert.ToDecimal(HiddenField_ID_PERFIL.Value);
        Decimal ID_REQUERIMIENTO = Convert.ToDecimal(HiddenField_ID_REQUERIMIENTO.Value);
        Decimal ID_CONTRATO = Convert.ToDecimal(HiddenField_ID_CONTRATO.Value);
        Decimal ID_EMPLEADO = Convert.ToDecimal(Label_ID_EMPLEADO.Text);

        Operacion _operacion = new Operacion(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaContrato = _operacion.ObtenerInformacionContratoPorIdEmpleado(ID_EMPLEADO);
        DataRow filaContrato = tablaContrato.Rows[0];

        Decimal ID_REFERENCIA = 0;
        if (String.IsNullOrEmpty(filaContrato["ID_REFERENCIA"].ToString().Trim()) == false)
        {
            ID_REFERENCIA = Convert.ToDecimal(filaContrato["ID_REFERENCIA"]);
        }

        Dictionary<String, byte[]> listaArchivos = new Dictionary<String, byte[]>();

        maestrasInterfaz _maestrasInterfaz = new maestrasInterfaz();

        switch(seccion)
        {
            case SeccionEnvio.Seleccion:
                if (CheckBoxList_DOCUMENTOS_SELECCION.Items[0].Selected == true)
                {
                    listaArchivos.Add(prefijoNombreArchivo + "INFORME_SELECCION.pdf", _maestrasInterfaz.GenerarPDFEntrevista(ID_SOLICITUD, ID_PERFIL));
                }

                if (CheckBoxList_DOCUMENTOS_SELECCION.Items[1].Selected == true)
                {
                    Dictionary<String, byte[]> archivosPruebas = _maestrasInterfaz.ObtenerArchivosPruebas(prefijoNombreArchivo, ID_PERFIL, ID_SOLICITUD);

                    foreach (KeyValuePair<String, byte[]> archivoPrueba in archivosPruebas)
                    {
                        listaArchivos.Add(archivoPrueba.Key, archivoPrueba.Value);
                    }
                }

                if (ID_REFERENCIA > 0)
                {
                    if (CheckBoxList_DOCUMENTOS_SELECCION.Items[2].Selected == true)
                    {
                        listaArchivos.Add(prefijoNombreArchivo + "CONFIRMACION_REFERENCIAS_LABORALES.pdf", _maestrasInterfaz.GenerarPDFReferencia(ID_REFERENCIA, ID_SOLICITUD));
                    }
                }
                break;
            case SeccionEnvio.Contratacion:
                if (CheckBoxList_DOCUEMENTOS_CONTRATACION.Items[0].Selected == true)
                {
                    Dictionary<String, byte[]> archivosExamenes = _maestrasInterfaz.ObtenerArchivosExamenes(prefijoNombreArchivo, ID_SOLICITUD, ID_REQUERIMIENTO);

                    foreach (KeyValuePair<String, byte[]> archivoExamen in archivosExamenes)
                    {
                        listaArchivos.Add(archivoExamen.Key, archivoExamen.Value);
                    }
                }

                if (CheckBoxList_DOCUEMENTOS_CONTRATACION.Items[1].Selected == true)
                {
                    byte[] archivoExamenes = _maestrasInterfaz.GenerarPDFExamenes(ID_CONTRATO, ID_SOLICITUD, ID_REQUERIMIENTO);
                    if (archivoExamenes != null)
                    {
                        listaArchivos.Add(prefijoNombreArchivo + "AUTOS_RECOMENDACION.pdf", archivoExamenes);
                    }
                }

                if (CheckBoxList_DOCUEMENTOS_CONTRATACION.Items[2].Selected == true)
                {
                    listaArchivos.Add(prefijoNombreArchivo + "CONTRATO.pdf", _maestrasInterfaz.GenerarPDFContrato(ID_CONTRATO));
                }

                if (CheckBoxList_DOCUEMENTOS_CONTRATACION.Items[3].Selected == true)
                {
                    byte[] archivoClausulas = _maestrasInterfaz.GenerarPDFClausulas(ID_CONTRATO);

                    if (archivoClausulas != null)
                    {
                        listaArchivos.Add(prefijoNombreArchivo + "CLAUSULAS_CONTRATO.pdf", archivoClausulas);
                    }
                }

                if (CheckBoxList_DOCUEMENTOS_CONTRATACION.Items[4].Selected == true)
                {
                    Dictionary<String, byte[]> archivosAfiliaciones = _maestrasInterfaz.ObtenerArchivosAfiliaciones(prefijoNombreArchivo, ID_CONTRATO);

                    foreach (KeyValuePair<String, byte[]> archivoAfiliacion in archivosAfiliaciones)
                    {
                        listaArchivos.Add(archivoAfiliacion.Key, archivoAfiliacion.Value);
                    }
                }
                break;
        }

        return listaArchivos;
    }