client/FrmChekList.vb

1014 lines
44 KiB
VB.net
Raw Blame History

Public Class FrmChekList
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents GrdBusqueda As System.Windows.Forms.DataGrid
Friend WithEvents BTCumple As System.Windows.Forms.Button
Friend WithEvents BTFaltantes As System.Windows.Forms.Button
Friend WithEvents BTTodos As System.Windows.Forms.Button
Friend WithEvents BTNCumple As System.Windows.Forms.Button
Friend WithEvents PNTPPersona As System.Windows.Forms.Panel
Friend WithEvents PNCumple As System.Windows.Forms.Panel
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents BTCerrar As System.Windows.Forms.Button
Friend WithEvents RDBFisica As System.Windows.Forms.RadioButton
Friend WithEvents RDBMoral As System.Windows.Forms.RadioButton
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents Chart1 As SoftwareFX.ChartFX.Chart
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents BTExportar As System.Windows.Forms.Button
Friend WithEvents BTRef As System.Windows.Forms.Button
Friend WithEvents LBLComodin As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim SeriesAttributes1 As SoftwareFX.ChartFX.SeriesAttributes = New SoftwareFX.ChartFX.SeriesAttributes
Dim SeriesAttributes2 As SoftwareFX.ChartFX.SeriesAttributes = New SoftwareFX.ChartFX.SeriesAttributes
Dim TitleDockable1 As SoftwareFX.ChartFX.TitleDockable = New SoftwareFX.ChartFX.TitleDockable
Me.GrdBusqueda = New System.Windows.Forms.DataGrid
Me.BTCerrar = New System.Windows.Forms.Button
Me.PNTPPersona = New System.Windows.Forms.Panel
Me.RDBFisica = New System.Windows.Forms.RadioButton
Me.RDBMoral = New System.Windows.Forms.RadioButton
Me.PNCumple = New System.Windows.Forms.Panel
Me.BTTodos = New System.Windows.Forms.Button
Me.BTNCumple = New System.Windows.Forms.Button
Me.BTCumple = New System.Windows.Forms.Button
Me.BTFaltantes = New System.Windows.Forms.Button
Me.Label1 = New System.Windows.Forms.Label
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.Chart1 = New SoftwareFX.ChartFX.Chart
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.BTExportar = New System.Windows.Forms.Button
Me.LBLComodin = New System.Windows.Forms.Label
Me.BTRef = New System.Windows.Forms.Button
CType(Me.GrdBusqueda, System.ComponentModel.ISupportInitialize).BeginInit()
Me.PNTPPersona.SuspendLayout()
Me.PNCumple.SuspendLayout()
Me.GroupBox1.SuspendLayout()
Me.SuspendLayout()
'
'GrdBusqueda
'
Me.GrdBusqueda.BackColor = System.Drawing.Color.AliceBlue
Me.GrdBusqueda.BackgroundColor = System.Drawing.Color.White
Me.GrdBusqueda.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.GrdBusqueda.CaptionText = "Resultados"
Me.GrdBusqueda.DataMember = ""
Me.GrdBusqueda.FlatMode = True
Me.GrdBusqueda.HeaderBackColor = System.Drawing.Color.WhiteSmoke
Me.GrdBusqueda.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.GrdBusqueda.Location = New System.Drawing.Point(136, 16)
Me.GrdBusqueda.Name = "GrdBusqueda"
Me.GrdBusqueda.PreferredColumnWidth = 200
Me.GrdBusqueda.PreferredRowHeight = 8
Me.GrdBusqueda.ReadOnly = True
Me.GrdBusqueda.Size = New System.Drawing.Size(464, 320)
Me.GrdBusqueda.TabIndex = 7
'
'BTCerrar
'
Me.BTCerrar.BackColor = System.Drawing.Color.MidnightBlue
Me.BTCerrar.ForeColor = System.Drawing.Color.White
Me.BTCerrar.Location = New System.Drawing.Point(16, 312)
Me.BTCerrar.Name = "BTCerrar"
Me.BTCerrar.Size = New System.Drawing.Size(104, 24)
Me.BTCerrar.TabIndex = 9
Me.BTCerrar.Text = "Cerrar"
Me.BTCerrar.UseVisualStyleBackColor = False
'
'PNTPPersona
'
Me.PNTPPersona.Controls.Add(Me.RDBFisica)
Me.PNTPPersona.Controls.Add(Me.RDBMoral)
Me.PNTPPersona.Location = New System.Drawing.Point(8, 32)
Me.PNTPPersona.Name = "PNTPPersona"
Me.PNTPPersona.Size = New System.Drawing.Size(120, 64)
Me.PNTPPersona.TabIndex = 15
'
'RDBFisica
'
Me.RDBFisica.Location = New System.Drawing.Point(8, 40)
Me.RDBFisica.Name = "RDBFisica"
Me.RDBFisica.Size = New System.Drawing.Size(104, 16)
Me.RDBFisica.TabIndex = 1
Me.RDBFisica.Text = "Fisica"
'
'RDBMoral
'
Me.RDBMoral.Location = New System.Drawing.Point(8, 16)
Me.RDBMoral.Name = "RDBMoral"
Me.RDBMoral.Size = New System.Drawing.Size(104, 16)
Me.RDBMoral.TabIndex = 0
Me.RDBMoral.Text = "Moral"
'
'PNCumple
'
Me.PNCumple.Controls.Add(Me.BTTodos)
Me.PNCumple.Controls.Add(Me.BTNCumple)
Me.PNCumple.Controls.Add(Me.BTCumple)
Me.PNCumple.Controls.Add(Me.BTFaltantes)
Me.PNCumple.Location = New System.Drawing.Point(8, 104)
Me.PNCumple.Name = "PNCumple"
Me.PNCumple.Size = New System.Drawing.Size(120, 168)
Me.PNCumple.TabIndex = 16
'
'BTTodos
'
Me.BTTodos.BackColor = System.Drawing.Color.MidnightBlue
Me.BTTodos.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.BTTodos.ForeColor = System.Drawing.Color.White
Me.BTTodos.Location = New System.Drawing.Point(8, 128)
Me.BTTodos.Name = "BTTodos"
Me.BTTodos.Size = New System.Drawing.Size(104, 32)
Me.BTTodos.TabIndex = 18
Me.BTTodos.Text = "Todos"
Me.BTTodos.UseVisualStyleBackColor = False
'
'BTNCumple
'
Me.BTNCumple.BackColor = System.Drawing.Color.MidnightBlue
Me.BTNCumple.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.BTNCumple.ForeColor = System.Drawing.Color.White
Me.BTNCumple.Location = New System.Drawing.Point(8, 88)
Me.BTNCumple.Name = "BTNCumple"
Me.BTNCumple.Size = New System.Drawing.Size(104, 32)
Me.BTNCumple.TabIndex = 17
Me.BTNCumple.Text = "No Cumple"
Me.BTNCumple.UseVisualStyleBackColor = False
'
'BTCumple
'
Me.BTCumple.BackColor = System.Drawing.Color.MidnightBlue
Me.BTCumple.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.BTCumple.ForeColor = System.Drawing.Color.White
Me.BTCumple.Location = New System.Drawing.Point(8, 48)
Me.BTCumple.Name = "BTCumple"
Me.BTCumple.Size = New System.Drawing.Size(104, 32)
Me.BTCumple.TabIndex = 16
Me.BTCumple.Text = "Cumple"
Me.BTCumple.UseVisualStyleBackColor = False
'
'BTFaltantes
'
Me.BTFaltantes.BackColor = System.Drawing.Color.MidnightBlue
Me.BTFaltantes.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.BTFaltantes.ForeColor = System.Drawing.Color.White
Me.BTFaltantes.Location = New System.Drawing.Point(8, 8)
Me.BTFaltantes.Name = "BTFaltantes"
Me.BTFaltantes.Size = New System.Drawing.Size(104, 32)
Me.BTFaltantes.TabIndex = 15
Me.BTFaltantes.Text = "Faltantes"
Me.BTFaltantes.UseVisualStyleBackColor = False
'
'Label1
'
Me.Label1.BackColor = System.Drawing.Color.RoyalBlue
Me.Label1.ForeColor = System.Drawing.Color.MidnightBlue
Me.Label1.Location = New System.Drawing.Point(8, 16)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(120, 16)
Me.Label1.TabIndex = 17
Me.Label1.Text = "Tipo de Persona"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.Chart1)
Me.GroupBox1.Location = New System.Drawing.Point(608, 0)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(280, 248)
Me.GroupBox1.TabIndex = 18
Me.GroupBox1.TabStop = False
'
'Chart1
'
Me.Chart1.BackColor = System.Drawing.Color.White
Me.Chart1.BorderColor = System.Drawing.Color.White
Me.Chart1.Chart3D = True
Me.Chart1.DesignTimeData = "C:\Program Files\ChartFX for .NET 6.2\Wizard\PieShadows.txt"
Me.Chart1.Dock = System.Windows.Forms.DockStyle.Fill
Me.Chart1.Gallery = SoftwareFX.ChartFX.Gallery.Pie
CType(Me.Chart1.GalleryObj, SoftwareFX.ChartFX.GalleryObj.Pie).DoughnutThickness = CType(50, Short)
CType(Me.Chart1.GalleryObj, SoftwareFX.ChartFX.GalleryObj.Pie).LineBreak = CType(10, Short)
Me.Chart1.Location = New System.Drawing.Point(3, 16)
Me.Chart1.Name = "Chart1"
Me.Chart1.NSeries = 1
Me.Chart1.NValues = 3
Me.Chart1.PointLabels = True
SeriesAttributes1.Color = System.Drawing.Color.Aqua
Me.Chart1.Series.AddRange(New SoftwareFX.ChartFX.SeriesAttributes() {SeriesAttributes1, SeriesAttributes2})
Me.Chart1.Size = New System.Drawing.Size(274, 229)
Me.Chart1.TabIndex = 19
Me.Chart1.Titles.AddRange(New SoftwareFX.ChartFX.TitleDockable() {TitleDockable1})
'
'Label2
'
Me.Label2.BackColor = System.Drawing.Color.Red
Me.Label2.Font = New System.Drawing.Font("Verdana", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.ForeColor = System.Drawing.Color.MidnightBlue
Me.Label2.Location = New System.Drawing.Point(608, 264)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(280, 16)
Me.Label2.TabIndex = 19
Me.Label2.Text = "NO CUMPLE"
Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label3
'
Me.Label3.BackColor = System.Drawing.Color.LimeGreen
Me.Label3.Font = New System.Drawing.Font("Verdana", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.ForeColor = System.Drawing.Color.MidnightBlue
Me.Label3.Location = New System.Drawing.Point(608, 248)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(280, 16)
Me.Label3.TabIndex = 20
Me.Label3.Text = "CUMPLE"
Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label4
'
Me.Label4.BackColor = System.Drawing.Color.RoyalBlue
Me.Label4.Font = New System.Drawing.Font("Verdana", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.ForeColor = System.Drawing.Color.MidnightBlue
Me.Label4.Location = New System.Drawing.Point(608, 280)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(280, 16)
Me.Label4.TabIndex = 21
Me.Label4.Text = "FALTANTES"
Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'BTExportar
'
Me.BTExportar.BackColor = System.Drawing.Color.MidnightBlue
Me.BTExportar.ForeColor = System.Drawing.Color.White
Me.BTExportar.Location = New System.Drawing.Point(16, 280)
Me.BTExportar.Name = "BTExportar"
Me.BTExportar.Size = New System.Drawing.Size(104, 24)
Me.BTExportar.TabIndex = 22
Me.BTExportar.Text = "Exportar"
Me.BTExportar.UseVisualStyleBackColor = False
'
'LBLComodin
'
Me.LBLComodin.Location = New System.Drawing.Point(0, 0)
Me.LBLComodin.Name = "LBLComodin"
Me.LBLComodin.Size = New System.Drawing.Size(112, 16)
Me.LBLComodin.TabIndex = 23
Me.LBLComodin.Text = "Comodin"
Me.LBLComodin.Visible = False
Me.LBLComodin.ForeColor = System.Drawing.Color.MidnightBlue
'
'BTRef
'
Me.BTRef.BackColor = System.Drawing.Color.MidnightBlue
Me.BTRef.ForeColor = System.Drawing.Color.White
Me.BTRef.Location = New System.Drawing.Point(608, 304)
Me.BTRef.Name = "BTRef"
Me.BTRef.Size = New System.Drawing.Size(280, 30)
Me.BTRef.TabIndex = 24
Me.BTRef.Text = "Refrescar"
Me.BTRef.UseVisualStyleBackColor = False
'
'FrmChekList
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.Color.WhiteSmoke
Me.ClientSize = New System.Drawing.Size(896, 349)
Me.Controls.Add(Me.BTRef)
Me.Controls.Add(Me.LBLComodin)
Me.Controls.Add(Me.BTExportar)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.PNCumple)
Me.Controls.Add(Me.PNTPPersona)
Me.Controls.Add(Me.BTCerrar)
Me.Controls.Add(Me.GrdBusqueda)
Me.Name = "FrmChekList"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "ChekList de Documentacion para Compliance"
CType(Me.GrdBusqueda, System.ComponentModel.ISupportInitialize).EndInit()
Me.PNTPPersona.ResumeLayout(False)
Me.PNCumple.ResumeLayout(False)
Me.GroupBox1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub BTMoral_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub BTMoral_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs)
Dim Etiqueta As Button
Etiqueta = sender
Etiqueta.BackColor = System.Drawing.Color.Blue
End Sub
Private Sub BTFisica_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub BTFisica_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs)
Dim Etiqueta As Button
Etiqueta = sender
Etiqueta.BackColor = System.Drawing.Color.Blue
End Sub
Private Sub BTFisica_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim Etiqueta As Button
Etiqueta = sender
Etiqueta.BackColor = System.Drawing.Color.MidnightBlue
End Sub
Private Sub BTMoral_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim Etiqueta As Button
Etiqueta = sender
Etiqueta.BackColor = System.Drawing.Color.MidnightBlue
End Sub
Private Sub BTFaltantes_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTFaltantes.Click
Dim ClassCom As New clsComplejo
Dim strBusqueda As String
Dim VarTipoPersona As Long
Dim VarSumaDoc As Long
Dim Fila As DataRow
'Deacuerdo el tipo de persona
VarTipoPersona = 0
If RDBMoral.Checked = True Then
VarTipoPersona = 2
ElseIf RDBFisica.Checked = True Then
VarTipoPersona = 1
End If
If VarTipoPersona <> 0 Then
Select Case VarTipoPersona
Case Is = 1
strBusqueda = "SELECT idcliente as NumeroCliente,NIC 'Numero Socio',Clientenom as 'Nombre Cliente',apaterno as 'Apellido Paterno',amaterno as 'Apellido Materno',tipopersona as 'Tipo de Persona'"
strBusqueda = strBusqueda & " FROM Cliente "
strBusqueda = strBusqueda & " WHERE tipopersona = " & VarTipoPersona
strBusqueda = strBusqueda & " AND idcliente "
strBusqueda = strBusqueda & " NOT IN (SELECT distinct(idcliente) as idcliente FROM KYC_CheckList) "
strBusqueda = strBusqueda & " ORDER BY Clientenom"
ClassCom.fdtDataSetTabla(strBusqueda)
'If ClassCom.ds.Tables(0).Rows.Count <> 0 Then
LBLComodin.Text = strBusqueda
GrdBusqueda.SetDataBinding(ClassCom.ds, "Tabla")
Case Is = 2
strBusqueda = "SELECT idcliente as NumeroCliente,NIC 'Numero Socio',Clientenom as 'Nombre Cliente',tipopersona as 'Tipo de Persona'"
strBusqueda = strBusqueda & " FROM Cliente "
strBusqueda = strBusqueda & " WHERE tipopersona = " & VarTipoPersona
strBusqueda = strBusqueda & " AND idcliente "
strBusqueda = strBusqueda & " NOT IN (SELECT distinct(idcliente) as idcliente FROM KYC_CheckList) "
strBusqueda = strBusqueda & " ORDER BY Clientenom"
ClassCom.fdtDataSetTabla(strBusqueda)
'If ClassCom.ds.Tables(0).Rows.Count <> 0 Then
LBLComodin.Text = strBusqueda
GrdBusqueda.SetDataBinding(ClassCom.ds, "Tabla")
End Select
'End If
End If
End Sub
Private Sub BTFaltantes_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTFaltantes.MouseLeave
Dim Etiqueta As Button
Etiqueta = sender
Etiqueta.BackColor = System.Drawing.Color.MidnightBlue
End Sub
Private Sub BTCumple_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTCumple.Click
Dim ClassCom As New clsComplejo
Dim strBusqueda As String
Dim SQLSuma As String
Dim VarTipoPersona As Long
Dim VarSumaDoc As Long
Dim Fila As DataRow
'Deacuerdo el tipo de persona
VarTipoPersona = 0
If RDBMoral.Checked = True Then
VarTipoPersona = 2
ElseIf RDBFisica.Checked = True Then
VarTipoPersona = 1
End If
If VarTipoPersona <> 0 Then
SQLSuma = " SELECT count(ID_DoctoCheckList)"
SQLSuma = SQLSuma & " FROM DoctosChecklist"
SQLSuma = SQLSuma & " WHERE TipoPersona = " & VarTipoPersona
SQLSuma = SQLSuma & " AND isnull(obligatorio,0) <> 0 "
ClassCom.fdtDataSet(SQLSuma)
If ClassCom.ds.Tables(0).Rows.Count <> 0 Then
Fila = ClassCom.ds.Tables(0).Rows(0)
VarSumaDoc = Fila(0)
End If
Select Case VarTipoPersona
Case Is = 1
strBusqueda = "SELECT idcliente as NumeroCliente,NIC 'Numero Socio',Clientenom as 'Nombre Cliente',apaterno as 'Apellido Paterno',amaterno as 'Apellido Materno',tipopersona as 'Tipo de Persona'"
strBusqueda = strBusqueda & " FROM CLIENTE"
strBusqueda = strBusqueda & " WHERE idcliente IN ("
strBusqueda = strBusqueda & " SELECT DISTINCT(idcliente)"
strBusqueda = strBusqueda & " FROM kyc_checklist"
strBusqueda = strBusqueda & " WHERE idcliente in (SELECT idcliente FROM cliente WHERE tipopersona = " & VarTipoPersona & ")"
strBusqueda = strBusqueda & " GROUP BY idcliente"
strBusqueda = strBusqueda & " HAVING(SUM(cumple) >= " & VarSumaDoc
strBusqueda = strBusqueda & " ) )"
strBusqueda = strBusqueda & " ORDER BY CLIENTENOM"
ClassCom = New clsComplejo
ClassCom.fdtDataSetTabla(strBusqueda)
'If ClassCom.ds.Tables(0).Rows.Count <> 0 Then
LBLComodin.Text = strBusqueda
GrdBusqueda.DataSource = Nothing
GrdBusqueda.SetDataBinding(ClassCom.ds, "Tabla")
'End If
Case Is = 2
strBusqueda = "SELECT idcliente as NumeroCliente,NIC 'Numero Socio',Clientenom as 'Nombre Cliente',tipopersona as 'Tipo de Persona'"
strBusqueda = strBusqueda & " FROM CLIENTE"
strBusqueda = strBusqueda & " WHERE idcliente IN ("
strBusqueda = strBusqueda & " SELECT DISTINCT(idcliente)"
strBusqueda = strBusqueda & " FROM kyc_checklist a,doctoschecklist b "
strBusqueda = strBusqueda & " WHERE a.idcliente in (SELECT idcliente FROM cliente WHERE tipopersona = " & VarTipoPersona & ")"
strBusqueda = strBusqueda & " and a.id_doctochecklist = b.id_doctochecklist"
strBusqueda = strBusqueda & " and isnull(obligatorio,0) <> 0 "
strBusqueda = strBusqueda & " GROUP BY a.idcliente"
strBusqueda = strBusqueda & " HAVING(SUM(cumple) >= " & VarSumaDoc
strBusqueda = strBusqueda & " ) )"
strBusqueda = strBusqueda & " ORDER BY CLIENTENOM"
ClassCom = New clsComplejo
ClassCom.fdtDataSetTabla(strBusqueda)
'If ClassCom.ds.Tables(0).Rows.Count <> 0 Then
LBLComodin.Text = strBusqueda
GrdBusqueda.DataSource = Nothing
GrdBusqueda.SetDataBinding(ClassCom.ds, "Tabla")
'End If
End Select
End If
End Sub
Private Sub BTCumple_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTCumple.MouseLeave
Dim Etiqueta As Button
Etiqueta = sender
Etiqueta.BackColor = System.Drawing.Color.MidnightBlue
End Sub
Private Sub BTNCumple_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNCumple.Click
Dim ClassCom As New clsComplejo
Dim strBusqueda As String
Dim SQLSuma As String
Dim VarTipoPersona As Long
Dim VarSumaDoc As Long
Dim Fila As DataRow
'Deacuerdo el tipo de persona
VarTipoPersona = 0
If RDBMoral.Checked = True Then
VarTipoPersona = 2
ElseIf RDBFisica.Checked = True Then
VarTipoPersona = 1
End If
If VarTipoPersona <> 0 Then
SQLSuma = " SELECT count(ID_DoctoCheckList)"
SQLSuma = SQLSuma & " FROM DoctosChecklist"
SQLSuma = SQLSuma & " WHERE TipoPersona = " & VarTipoPersona
SQLSuma = SQLSuma & " AND isnull(obligatorio,0) <> 0 "
ClassCom.fdtDataSet(SQLSuma)
If ClassCom.ds.Tables(0).Rows.Count <> 0 Then
Fila = ClassCom.ds.Tables(0).Rows(0)
VarSumaDoc = Fila(0)
End If
Select Case VarTipoPersona
Case Is = 1
strBusqueda = "SELECT idcliente as NumeroCliente, NIC 'Numero Socio',Clientenom as 'Nombre Cliente',apaterno as 'Apellido Paterno',amaterno as 'Apellido Materno',tipopersona as 'Tipo de Persona'"
strBusqueda = strBusqueda & " FROM CLIENTE"
strBusqueda = strBusqueda & " WHERE idcliente IN ("
strBusqueda = strBusqueda & " SELECT DISTINCT(idcliente)"
strBusqueda = strBusqueda & " FROM kyc_checklist"
strBusqueda = strBusqueda & " WHERE idcliente in (SELECT idcliente FROM cliente WHERE tipopersona = " & VarTipoPersona & ")"
strBusqueda = strBusqueda & " GROUP BY idcliente"
strBusqueda = strBusqueda & " HAVING(SUM(cumple) < " & VarSumaDoc
strBusqueda = strBusqueda & " ) )"
strBusqueda = strBusqueda & " ORDER BY CLIENTENOM"
ClassCom = New clsComplejo
ClassCom.fdtDataSetTabla(strBusqueda)
'If ClassCom.ds.Tables(0).Rows.Count <> 0 Then
LBLComodin.Text = strBusqueda
GrdBusqueda.DataSource = Nothing
GrdBusqueda.SetDataBinding(ClassCom.ds, "Tabla")
'End If
Case Is = 2
strBusqueda = "SELECT idcliente as NumeroCliente,NIC 'Numero Socio',Clientenom as 'Nombre Cliente',tipopersona as 'Tipo de Persona'"
strBusqueda = strBusqueda & " FROM CLIENTE"
strBusqueda = strBusqueda & " WHERE idcliente IN ("
strBusqueda = strBusqueda & " SELECT DISTINCT(a.idcliente)"
strBusqueda = strBusqueda & " FROM kyc_checklist a,doctoschecklist b "
strBusqueda = strBusqueda & " WHERE a.idcliente in (SELECT idcliente FROM cliente WHERE tipopersona = " & VarTipoPersona & ")"
strBusqueda = strBusqueda & " and a.id_doctochecklist = b.id_doctochecklist"
strBusqueda = strBusqueda & " and isnull(obligatorio,0) <> 0 "
strBusqueda = strBusqueda & " GROUP BY a.idcliente"
strBusqueda = strBusqueda & " HAVING(SUM(a.cumple) < " & VarSumaDoc
strBusqueda = strBusqueda & " ) )"
strBusqueda = strBusqueda & " ORDER BY CLIENTENOM"
ClassCom = New clsComplejo
ClassCom.fdtDataSetTabla(strBusqueda)
'If ClassCom.ds.Tables(0).Rows.Count <> 0 Then
LBLComodin.Text = strBusqueda
GrdBusqueda.DataSource = Nothing
GrdBusqueda.SetDataBinding(ClassCom.ds, "Tabla")
End Select
End If
End Sub
Private Sub BTNCumple_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTNCumple.MouseLeave
Dim Etiqueta As Button
Etiqueta = sender
Etiqueta.BackColor = System.Drawing.Color.MidnightBlue
End Sub
Private Sub BTTodos_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTTodos.Click
Dim ClassCom As New clsComplejo
Dim strBusqueda As String
Dim VarTipoPersona As Long
Dim VarSumaDoc As Long
Dim Fila As DataRow
'Deacuerdo el tipo de persona
VarTipoPersona = 0
If RDBMoral.Checked = True Then
VarTipoPersona = 2
ElseIf RDBFisica.Checked = True Then
VarTipoPersona = 1
End If
If VarTipoPersona <> 0 Then
Select Case VarTipoPersona
Case Is = 1
strBusqueda = "SELECT idcliente as NumeroCliente,NIC 'Numero Socio',rtrim(ltrim(Clientenom)) as 'Nombre Cliente',apaterno as 'Apellido Paterno',amaterno as 'Apellido Materno',tipopersona as 'Tipo de Persona'"
strBusqueda = strBusqueda & " FROM Cliente "
'strBusqueda = strBusqueda & " WHERE idcliente "
'strBusqueda = strBusqueda & " NOT IN (SELECT DISTINCT(idcliente) as idcliente FROM KYC_CheckList) "
strBusqueda = strBusqueda & " WHERE tipopersona = " & VarTipoPersona
strBusqueda = strBusqueda & " ORDER BY Clientenom"
ClassCom.fdtDataSetTabla(strBusqueda)
'If ClassCom.ds.Tables(0).Rows.Count <> 0 Then
LBLComodin.Text = strBusqueda
GrdBusqueda.SetDataBinding(ClassCom.ds, "Tabla")
'End If
Case Is = 2
strBusqueda = "SELECT idcliente as NumeroCliente,NIC 'Numero Socio',Clientenom as 'Nombre Cliente',tipopersona as 'Tipo de Persona'"
strBusqueda = strBusqueda & " FROM Cliente "
'strBusqueda = strBusqueda & " WHERE idcliente "
'strBusqueda = strBusqueda & " NOT IN (SELECT DISTINCT(idcliente) as idcliente FROM KYC_CheckList) "
strBusqueda = strBusqueda & " WHERE tipopersona = " & VarTipoPersona
55:
strBusqueda = strBusqueda & " ORDER BY Clientenom"
ClassCom.fdtDataSetTabla(strBusqueda)
'If ClassCom.ds.Tables(0).Rows.Count <> 0 Then
LBLComodin.Text = strBusqueda
GrdBusqueda.SetDataBinding(ClassCom.ds, "Tabla")
'End If
End Select
End If
End Sub
Private Sub BTTodos_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTTodos.MouseLeave
Dim Etiqueta As Button
Etiqueta = sender
Etiqueta.BackColor = System.Drawing.Color.MidnightBlue
End Sub
Private Sub BTFaltantes_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles BTFaltantes.MouseMove
Dim Etiqueta As Button
Etiqueta = sender
Etiqueta.BackColor = System.Drawing.Color.Blue
End Sub
Private Sub BTCumple_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles BTCumple.MouseMove
Dim Etiqueta As Button
Etiqueta = sender
Etiqueta.BackColor = System.Drawing.Color.Blue
End Sub
Private Sub BTNCumple_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles BTNCumple.MouseMove
Dim Etiqueta As Button
Etiqueta = sender
Etiqueta.BackColor = System.Drawing.Color.Blue
End Sub
Private Sub BTTodos_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles BTTodos.MouseMove
Dim Etiqueta As Button
Etiqueta = sender
Etiqueta.BackColor = System.Drawing.Color.Blue
End Sub
Private Sub FrmChekList_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.GotFocus
End Sub
Private Sub FrmChekList_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ClassCom As New clsComplejo
Dim strBusqueda As String
Dim VarTipoPersona As Long
Dim VarSumaDoc As Long
Dim Fila As DataRow
'Deacuerdo el tipo de persona
VarTipoPersona = 0
RDBMoral.Checked = True
If RDBMoral.Checked = True Then
VarTipoPersona = 2
ElseIf RDBFisica.Checked = True Then
VarTipoPersona = 1
End If
If VarTipoPersona <> 0 Then
Select Case VarTipoPersona
Case Is = 1
strBusqueda = "SELECT idcliente as NumeroCliente,NIC 'Numero Socio',ltrim(rtrim(Clientenom)) as 'Nombre Cliente',rtrim(ltrim(apaterno)) as 'Apellido Paterno',ltrim(rtrim(amaterno)) as 'Apellido Materno',tipopersona as 'Tipo de Persona'"
strBusqueda = strBusqueda & " FROM Cliente "
strBusqueda = strBusqueda & " WHERE tipopersona = " & VarTipoPersona
strBusqueda = strBusqueda & " AND idcliente "
strBusqueda = strBusqueda & " NOT IN (SELECT distinct(idcliente) as idcliente FROM KYC_CheckList) "
strBusqueda = strBusqueda & " ORDER BY Clientenom"
ClassCom.fdtDataSetTabla(strBusqueda)
Case Is = 2
strBusqueda = "SELECT idcliente as NumeroCliente,NIC 'Numero Socio',ltrim(rtrim(Clientenom)) as 'Nombre Cliente',tipopersona as 'Tipo de Persona'"
strBusqueda = strBusqueda & " FROM Cliente "
strBusqueda = strBusqueda & " WHERE tipopersona = " & VarTipoPersona
strBusqueda = strBusqueda & " AND idcliente "
strBusqueda = strBusqueda & " NOT IN (SELECT distinct(idcliente) as idcliente FROM KYC_CheckList) "
strBusqueda = strBusqueda & " ORDER BY Clientenom"
ClassCom.fdtDataSetTabla(strBusqueda)
End Select
If ClassCom.ds.Tables(0).Rows.Count <> 0 Then
GrdBusqueda.SetDataBinding(ClassCom.ds, "Tabla")
End If
End If
Chart()
'AUDITORIA
Dim ClassAud As New ClassMyUtils
Dim varUser As Long
Dim ClassComodin As New clsComplejo
'varUser = ClassComodin.BuscaValores("IdUsuario", "usuario", "usuario = '" & My.User.Name & "'")
ClassAud.RT_Auditoria(clsVaribles.varUsuario, 3, 1, "Consulta de Checklist")
' ClassAud.RT_Auditoria(clsVaribles.varUsuario, 3, My.Computer.Name, "Minds Cliente", "Entrada Cheklist")
'FIN AUDITORIA
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTCerrar.Click
Me.Close()
End Sub
Private Sub BTEditar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub BTEditar_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim Etiqueta As Button
Etiqueta = sender
Etiqueta.BackColor = System.Drawing.Color.MidnightBlue
End Sub
Private Sub BTCerrar_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTCerrar.MouseLeave
Dim Etiqueta As Button
Etiqueta = sender
Etiqueta.BackColor = System.Drawing.Color.MidnightBlue
End Sub
Private Sub BTEditar_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs)
Dim Etiqueta As Button
Etiqueta = sender
Etiqueta.BackColor = System.Drawing.Color.Blue
End Sub
Private Sub BTCerrar_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles BTCerrar.MouseMove
Dim Etiqueta As Button
Etiqueta = sender
Etiqueta.BackColor = System.Drawing.Color.Blue
End Sub
Private Sub GrdBusqueda_Navigate(ByVal sender As System.Object, ByVal ne As System.Windows.Forms.NavigateEventArgs) Handles GrdBusqueda.Navigate
End Sub
Private Sub GrdBusqueda_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles GrdBusqueda.DoubleClick
Dim Doctos As New CLIENTE.FrmDocChk
Dim Classcom As New clsComplejo
Dim Fila As DataRow
Dim SQL As String
SQL = "SELECT idcliente,tipopersona FROM Cliente"
SQL = SQL & " WHERE idcliente = '" & GrdBusqueda.Item(GrdBusqueda.CurrentRowIndex, 0) & "'"
Classcom.fdtDataSet(SQL)
If Classcom.ds.Tables(0).Rows.Count <> 0 Then
Fila = Classcom.ds.Tables(0).Rows(0)
clsVaribles.IDCliente = Fila("idcliente")
clsVaribles.TipoPersona = Fila("tipopersona")
End If
Doctos.Show()
End Sub
Public Sub Chart()
Dim ClassCom As New clsComplejo
Dim ClassCom1 As New clsComplejo
Dim ClassCom2 As New clsComplejo
Dim ClassCom3 As New clsComplejo
Dim strBusqueda As String
Dim VarTipoPersona As Long
Dim VarSumaDoc As Long
Dim Fila As DataRow
Dim valArray(3) As Integer
Dim SQLSuma As String
VarTipoPersona = 0
If RDBMoral.Checked = True Then
VarTipoPersona = 2
ElseIf RDBFisica.Checked = True Then
VarTipoPersona = 1
End If
If VarTipoPersona <> 0 Then
SQLSuma = " SELECT count(ID_DoctoCheckList)"
SQLSuma = SQLSuma & " FROM DoctosChecklist"
SQLSuma = SQLSuma & " WHERE TipoPersona = " & VarTipoPersona
SQLSuma = SQLSuma & " AND isnull(obligatorio,0) <> 0 "
ClassCom.fdtDataSet(SQLSuma)
If ClassCom.ds.Tables(0).Rows.Count <> 0 Then
Fila = ClassCom.ds.Tables(0).Rows(0)
VarSumaDoc = Fila(0)
End If
strBusqueda = "SELECT Clientenom as 'Nombre Cliente',apaterno as 'Apellido Paterno',amaterno as 'Apellido Paterno',tipopersona as 'Tipo de Persona'"
strBusqueda = strBusqueda & " FROM Cliente "
strBusqueda = strBusqueda & " WHERE tipopersona = " & VarTipoPersona
strBusqueda = strBusqueda & " AND idcliente "
strBusqueda = strBusqueda & " NOT IN (SELECT distinct(idcliente) as idcliente FROM KYC_CheckList) "
strBusqueda = strBusqueda & " ORDER BY Clientenom"
ClassCom1.fdtDataSetTabla(strBusqueda)
If ClassCom1.ds.Tables(0).Rows.Count <> 0 Then
valArray(0) = ClassCom1.ds.Tables(0).Rows.Count
End If
'strBusqueda = "SELECT Clientenom as 'Nombre Cliente',apaterno as 'Apellido Paterno',amaterno as 'Apellido Paterno',tipopersona as 'Tipo de Persona'"
'strBusqueda = strBusqueda & " FROM CLIENTE"
'strBusqueda = strBusqueda & " WHERE idcliente IN ("
'strBusqueda = strBusqueda & " SELECT DISTINCT(idcliente)"
'strBusqueda = strBusqueda & " FROM kyc_checklist"
'strBusqueda = strBusqueda & " WHERE idcliente in (SELECT idcliente FROM cliente WHERE tipopersona = " & VarTipoPersona & ")"
'strBusqueda = strBusqueda & " GROUP BY idcliente"
'strBusqueda = strBusqueda & " HAVING(SUM(cumple) >= " & VarSumaDoc
'strBusqueda = strBusqueda & " ) )"
'strBusqueda = strBusqueda & " ORDER BY CLIENTENOM"
strBusqueda = "SELECT Clientenom as 'Nombre Cliente',apaterno as 'Apellido Paterno',amaterno as 'Apellido Paterno',tipopersona as 'Tipo de Persona'"
strBusqueda = strBusqueda & " FROM CLIENTE"
strBusqueda = strBusqueda & " WHERE idcliente IN ("
strBusqueda = strBusqueda & " SELECT DISTINCT(idcliente)"
strBusqueda = strBusqueda & " FROM kyc_checklist a,doctoschecklist b "
strBusqueda = strBusqueda & " WHERE a.idcliente in (SELECT idcliente FROM cliente WHERE tipopersona = " & VarTipoPersona & ")"
strBusqueda = strBusqueda & " and a.id_doctochecklist = b.id_doctochecklist"
strBusqueda = strBusqueda & " and isnull(obligatorio,0) <> 0 "
strBusqueda = strBusqueda & " GROUP BY idcliente"
strBusqueda = strBusqueda & " HAVING(SUM(cumple) >= " & VarSumaDoc
strBusqueda = strBusqueda & " ) )"
strBusqueda = strBusqueda & " ORDER BY CLIENTENOM"
ClassCom2.fdtDataSetTabla(strBusqueda)
If ClassCom2.ds.Tables(0).Rows.Count <> 0 Then
valArray(1) = ClassCom2.ds.Tables(0).Rows.Count
End If
'strBusqueda = "SELECT Clientenom as 'Nombre Cliente',apaterno as 'Apellido Paterno',amaterno as 'Apellido Paterno',tipopersona as 'Tipo de Persona'"
'strBusqueda = strBusqueda & " FROM CLIENTE"
'strBusqueda = strBusqueda & " WHERE idcliente IN ("
'strBusqueda = strBusqueda & " SELECT DISTINCT(idcliente)"
'strBusqueda = strBusqueda & " FROM kyc_checklist"
'strBusqueda = strBusqueda & " WHERE idcliente in (SELECT idcliente FROM cliente WHERE tipopersona = " & VarTipoPersona & ")"
'strBusqueda = strBusqueda & " GROUP BY idcliente"
'strBusqueda = strBusqueda & " HAVING(SUM(cumple) < " & VarSumaDoc
'strBusqueda = strBusqueda & " ) )"
'strBusqueda = strBusqueda & " ORDER BY CLIENTENOM"
'ClassCom3.fdtDataSetTabla(strBusqueda)
strBusqueda = "SELECT Clientenom as 'Nombre Cliente',apaterno as 'Apellido Paterno',amaterno as 'Apellido Paterno',tipopersona as 'Tipo de Persona'"
strBusqueda = strBusqueda & " FROM CLIENTE"
strBusqueda = strBusqueda & " WHERE idcliente IN ("
strBusqueda = strBusqueda & " SELECT DISTINCT(idcliente)"
strBusqueda = strBusqueda & " FROM kyc_checklist a,doctoschecklist b "
strBusqueda = strBusqueda & " WHERE a.idcliente in (SELECT idcliente FROM cliente WHERE tipopersona = " & VarTipoPersona & ")"
strBusqueda = strBusqueda & " and a.id_doctochecklist = b.id_doctochecklist"
strBusqueda = strBusqueda & " and isnull(obligatorio,0) <> 0 "
strBusqueda = strBusqueda & " GROUP BY idcliente"
strBusqueda = strBusqueda & " HAVING(SUM(isnull(cumple,0)) < " & VarSumaDoc
strBusqueda = strBusqueda & " ) )"
strBusqueda = strBusqueda & " ORDER BY CLIENTENOM"
ClassCom3.fdtDataSetTabla(strBusqueda)
If ClassCom3.ds.Tables(0).Rows.Count <> 0 Then
valArray(2) = ClassCom3.ds.Tables(0).Rows.Count
End If
End If
Chart1.DataSource = Nothing
Chart1.DataSourceSettings.DataSource = valArray
End Sub
Private Sub Chart1_DragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Chart1.DragOver
End Sub
Private Sub RDBFisica_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RDBFisica.CheckedChanged
Me.BTCumple.PerformClick()
Chart()
End Sub
Private Sub RDBMoral_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RDBMoral.CheckedChanged
Me.BTCumple.PerformClick()
Chart()
End Sub
Private Sub BTExportar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTExportar.Click
Dim classcom As clsComplejo
Try
classcom = New clsComplejo
'If clCmp.ds.Tables.Count = 0 Then
If LBLComodin.Text = "" Then
MessageBox.Show("Realiza una consulta ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
classcom.fdtDataSet(LBLComodin.Text)
If classcom.ds.Tables(0).Rows.Count = 0 Then
MessageBox.Show("No hay datos para exportar ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
Dim Resul As DialogResult
Resul = MessageBox.Show("Este proceso puede tardar varios minutos, <20>Deseas continuar? ", "MINDS", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Resul = DialogResult.Yes Then
'Creamos una copia del dataset
'Dim copyDS As DataSet = clCmp.ds.Copy()
Dim copyDS As DataSet = classcom.ds.Copy
'Quitamos las siguientes columnas para no exportarlas
'copyDS.Tables(0).Columns.Remove("idtransaccion")
'copyDS.Tables(0).Columns.Remove("idproducto")
'copyDS.Tables(0).Columns.Remove("Id_Subproducto")
'copyDS.Tables(0).Columns.Remove("Id_Patron")
'copyDS.Tables(0).Columns.Remove("Id_EstatusTransaccion")
'Creo una instancia de la clase aExcel
Dim clsExcel As aExcel = New aExcel
'Obtenemos el nombre o el titulo del form
clsExcel.Titulo = Me.Text
'Utilizo la funcion ExportDataset de la clase aExcel
clsExcel.ExportDataset(copyDS) 'Asigno el dataset a exportar
End If
End If
End If
Catch ex As Exception
MessageBox.Show(ex.Message, "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub BTRef_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTRef.Click
Chart()
End Sub
End Class