VERSION 5.00
Begin VB.Form Form_Ficha_Alu_Docu 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Documentos Entregados"
   ClientHeight    =   3420
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   8700
   Icon            =   "Form_Ficha_Alu_Docu.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   3420
   ScaleWidth      =   8700
   Begin VB.Frame Frame1 
      Caption         =   "Documentos a Recibir"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   1215
      Left            =   120
      TabIndex        =   5
      Top             =   1080
      Width           =   8415
      Begin VB.CheckBox che_fotos 
         Caption         =   "Fotos"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   9
         TabStop         =   0   'False
         Top             =   720
         Width           =   1575
      End
      Begin VB.CheckBox che_ult_cur 
         Caption         =   "Certificado de Estudio  Ultimo Curso Realizado"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3480
         TabIndex        =   8
         TabStop         =   0   'False
         Top             =   720
         Width           =   3975
      End
      Begin VB.CheckBox che_notas 
         Caption         =   "Informe de Notas Parciales"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   3480
         TabIndex        =   7
         TabStop         =   0   'False
         Top             =   480
         Width           =   3495
      End
      Begin VB.CheckBox che_cer_nac 
         Caption         =   " Certificado de Nacimiento"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   6
         TabStop         =   0   'False
         Top             =   480
         Width           =   2415
      End
   End
   Begin VB.Frame Frame_doc_alu 
      Caption         =   "Otros Documentos"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   855
      Index           =   1
      Left            =   120
      TabIndex        =   3
      Top             =   2400
      Width           =   6375
      Begin VB.CheckBox che_doc_her 
         Caption         =   "Documentos de Certificación de Descuento por Hermano"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   480
         TabIndex        =   4
         Top             =   360
         Width           =   4815
      End
   End
   Begin VB.TextBox ci_alu 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   1080
      Locked          =   -1  'True
      MaxLength       =   11
      TabIndex        =   2
      Top             =   240
      Width           =   1335
   End
   Begin VB.TextBox cl_nombre 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   1080
      Locked          =   -1  'True
      TabIndex        =   1
      Top             =   600
      Width           =   6255
   End
   Begin VB.CommandButton Command1 
      Caption         =   "&Recibir y Grabar"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   6720
      Picture         =   "Form_Ficha_Alu_Docu.frx":2A8B2
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   2400
      Width           =   1695
   End
   Begin VB.Label Label2 
      Caption         =   "Alumno:"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   240
      TabIndex        =   11
      Top             =   600
      Width           =   975
   End
   Begin VB.Label Label3 
      Caption         =   "RUN:"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   240
      TabIndex        =   10
      Top             =   240
      Width           =   735
   End
   Begin VB.Image Image1 
      Height          =   1005
      Left            =   7440
      Picture         =   "Form_Ficha_Alu_Docu.frx":2AEE0
      Top             =   0
      Width           =   1050
   End
End
Attribute VB_Name = "Form_Ficha_Alu_Docu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim sqlUp As String
sqlUp = ""

If CodPerfil = "#PJE#" Then
    MsgBox "Su perfil no tiene la autorización para modificar datos", vbInformation
    Exit Sub
End If

If Me.ci_alu.Text <> "" And (Me.che_cer_nac.Value <> 0 Or Me.che_fotos.Value <> 0 Or Me.che_doc_her.Value <> 0 Or Me.che_notas.Value <> 0 Or Me.che_ult_cur.Value <> 0) Then
    sqlUp = "update postulantes set "
    If Me.che_cer_nac.Value = 1 Then
       sqlUp = sqlUp & "v_cer_nac=1,"
    Else
        sqlUp = sqlUp & "v_cer_nac=0,"
    End If
    
    If Me.che_fotos.Value = 1 Then
        sqlUp = sqlUp & "v_fotos=1,"
    Else
        sqlUp = sqlUp & "v_fotos=0,"
    End If
    
    If Me.che_notas.Value = 1 Then
        sqlUp = sqlUp & "v_inf_not_par=1,"
    Else
        sqlUp = sqlUp & "v_inf_not_par=0,"
    End If
    
    If Me.che_ult_cur.Value = 1 Then
        sqlUp = sqlUp & "v_cer_est_ult_cur=1,"
    Else
        sqlUp = sqlUp & "v_cer_est_ult_cur=0,"
    End If
    
    If Me.che_doc_her.Value = 1 Then
        sqlUp = sqlUp & "ind_hermano='SI' "
    Else
        sqlUp = sqlUp & "ind_hermano='NO' "
    End If
    
    
    sqlUp = Mid(sqlUp, 1, Len(sqlUp) - 1) & " where ci_alu='" & Me.ci_alu.Text & "'"
ElseIf Me.ci_alu.Text <> "" And (Me.che_cer_nac.Value = 0 Or Me.che_fotos.Value = 0 Or Me.che_doc_her.Value = 0 Or Me.che_notas.Value = 0 Or Me.che_ult_cur.Value = 0) Then
    sqlUp = "update postulantes set v_cer_nac=0, v_fotos=0,v_inf_not_par=0, v_cer_est_ult_cur=0,ind_hermano=0 where ci_alu='" & Me.ci_alu.Text & "' limit 1"
End If

Dim docUp As ADODB.Recordset

Set docUp = New ADODB.Recordset

docUp.Open sqlUp, conn

Unload Me
End Sub

Private Sub Form_Load()
Me.ci_alu.Text = Form_Ficha_Alu.ci_aluaca
Me.cl_nombre.Text = Form_Ficha_Alu.cl_nombre
If Me.ci_alu.Text = "" Then
    Exit Sub
End If

Dim recDatos As ADODB.Recordset

Set recDatos = New ADODB.Recordset

recDatos.Open "Select v_cer_nac,v_fotos,v_inf_not_par,v_cer_est_ult_cur,ind_hermano from postulantes where ci_alu='" & Me.ci_alu.Text & "'", conn

If recDatos.RecordCount > 0 Then
    If Not IsNull(recDatos!v_cer_nac) Then
        Me.che_cer_nac.Value = recDatos!v_cer_nac
    Else
        Me.che_cer_nac.Value = 0
    End If
    
    If Not IsNull(recDatos!v_fotos) Then
        Me.che_fotos.Value = recDatos!v_fotos
    Else
        Me.che_fotos.Value = 0
    End If
    
    If Not IsNull(recDatos!v_inf_not_par) Then
        Me.che_notas.Value = recDatos!v_inf_not_par
    Else
        Me.che_notas.Value = 0
    End If
    If Not IsNull(recDatos!v_cer_est_ult_cur) Then
        Me.che_ult_cur.Value = recDatos!v_cer_est_ult_cur
    Else
        Me.che_ult_cur.Value = 0
    End If
    
    If Not IsNull(recDatos!ind_hermano) Then
        If recDatos!ind_hermano = "SI" Then
              Me.che_doc_her.Value = 1
        Else
            Me.che_doc_her.Value = 0
        End If
    Else
       Me.che_doc_her.Value = 0
    End If
    
End If

End Sub

Private Sub Form_Unload(Cancel As Integer)
    Form_Ficha_Alu.Enabled = True
    Form_Ficha_Alu.Command1_Click
    Form_Ficha_Alu.Show
End Sub

