98 lines
4.2 KiB
VB.net
98 lines
4.2 KiB
VB.net
|
Public Class FrmUmbral
|
|||
|
|
|||
|
Private Sub BtnBuscar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBuscar.Click
|
|||
|
Me.Cursor = Cursors.WaitCursor
|
|||
|
Call sbBuscar()
|
|||
|
Me.Cursor = Cursors.Default
|
|||
|
End Sub
|
|||
|
Public Sub sbBuscar()
|
|||
|
Dim CLCMP As New clsComplejo
|
|||
|
Dim VarComodin As Long
|
|||
|
Dim SQL As String
|
|||
|
|
|||
|
Try
|
|||
|
If clsVaribles.lbDemo = True Then Exit Sub
|
|||
|
Dim mes As Integer = DTP_Umbral.Value.Month
|
|||
|
Dim año As Integer = DTP_Umbral.Value.Year
|
|||
|
|
|||
|
Dim Str_fech As String
|
|||
|
Str_fech = mes & "/" & año
|
|||
|
|
|||
|
|
|||
|
' Dim SQL2 As String
|
|||
|
SQL = "SELECT int_id_cliente as IDCLIENTE,Str_Fecha AS FECHA, Str_Nombre AS NOMBRE, Str_Umbral AS UMBRAL, Str_Mes_Anterior AS MES_ANTERIOR"
|
|||
|
SQL = SQL & " ,Str_Estatus_Umbral AS STATUS_UMBRAL, Mon_Monto_Pesos AS MONTO_PESOS, Mon_Monto_USD AS MONTO_USD,"
|
|||
|
SQL = SQL & " case when Str_Componente_Inversion=1 then 'Con Componete' when Str_Componente_Inversion=0 then 'Sin Componete' end "
|
|||
|
SQL = SQL & "AS COMP_INVERSIÓN, Str_No_Polizas AS NÚMERO_POLIZAS"
|
|||
|
SQL = SQL & " FROM Umbral where Str_Fecha= '" & Str_fech & "'"
|
|||
|
|
|||
|
|
|||
|
clsVaribles.VarSQL = SQL 'Solo Guarda el query para hacer la emportacion
|
|||
|
|
|||
|
CLCMP.fdtDataSetTabla(SQL)
|
|||
|
Me.DGV_Umbral.SetDataBinding(CLCMP.ds, "Tabla")
|
|||
|
Me.DGV_Umbral.Visible = True
|
|||
|
Dim Cont As Integer
|
|||
|
Cont = CLCMP.ds.Tables(0).Rows.Count
|
|||
|
LblNumReg.Text = "Número de Registros : " & Cont
|
|||
|
|
|||
|
Catch er As Exception
|
|||
|
MessageBox.Show("Error al Buscar " & er.Message, "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
|||
|
End Try
|
|||
|
End Sub
|
|||
|
|
|||
|
Private Sub BtnInformacionFalt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnInformacionFalt.Click
|
|||
|
Dim EstaAbierta As New mdiForm
|
|||
|
If Not EstaAbierta.estaAbieta("FrmInformacionFalt") Then '- verifica si ya se abrio la forma
|
|||
|
Dim FORMA As New CLIENTE.FrmInformacionFalt
|
|||
|
FORMA.Show()
|
|||
|
Else
|
|||
|
Application.OpenForms.Item("FrmInformacionFalt").Activate()
|
|||
|
End If
|
|||
|
End Sub
|
|||
|
|
|||
|
Private Sub BtnExportar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnExportar.Click
|
|||
|
Dim Classcom As New clsComplejo
|
|||
|
If clsVaribles.VarSQL = "" Then Exit Sub
|
|||
|
If clsVaribles.lbDemo = True Then Exit Sub
|
|||
|
Classcom.fdtDataSetTabla(clsVaribles.VarSQL)
|
|||
|
'GrdPrincipal.SaveLayout( "C:\EXP.XLS")
|
|||
|
Try
|
|||
|
If Classcom.ds.Tables.Count = 0 Then
|
|||
|
MessageBox.Show("Realiza una consulta ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
|||
|
Else
|
|||
|
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, ¿Deseas continuar? ", "MINDS", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
|||
|
If Resul = DialogResult.Yes Then
|
|||
|
'Creamos una copia del dataset
|
|||
|
Dim copyDS As DataSet = Classcom.ds.Copy()
|
|||
|
'Quitamos las siguientes columnas para no exportarlas
|
|||
|
'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
|
|||
|
Dim ClassAud As New ClassMyUtils
|
|||
|
ClassAud.RT_Auditoria(clsVaribles.varUsuario, 29, 1, "Periodo de " & Classcom.ObtenFecha(Me.DTP_Umbral.Value.Date, "YYYYMMDD"))
|
|||
|
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 BtnDetalles_Click(sender As System.Object, e As System.EventArgs) Handles BtnDetalles.Click
|
|||
|
Dim EstaAbierta As New mdiForm
|
|||
|
If Not EstaAbierta.estaAbieta("FrmDetallesUmbral") Then '- verifica si ya se abrio la forma
|
|||
|
Dim FORMA As New CLIENTE.FrmDetallesUmbral
|
|||
|
FORMA.Show()
|
|||
|
Else
|
|||
|
Application.OpenForms.Item("FrmDetallesUmbral").Activate()
|
|||
|
End If
|
|||
|
End Sub
|
|||
|
End Class
|