-
Notifications
You must be signed in to change notification settings - Fork 0
/
Admin.vb
68 lines (63 loc) · 2.55 KB
/
Admin.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Imports MySql.Data.MySqlClient
Public Class Admin
Inherits Persona
Dim db As ReMe_DB
Private ReadOnly ids As New List(Of Integer)
Private Registrados As Integer
Public nombres As New List(Of String)
Public aprobadas As New List(Of Integer)
Public desaprobadas As New List(Of Integer)
Public importantes As New List(Of Integer)
Public olvidadas As New List(Of Integer)
Public globales As New List(Of Integer)
Public ReadOnly Property Reg As Integer
Get
Return Registrados
End Get
End Property
Public Sub New(usr As String, clv As String)
MyBase.New(usr, clv)
End Sub
Public Sub ObtenerReporte()
Try
db = New ReMe_DB
db.miComando.CommandText = "Obtener_Registrados"
db.miComando.CommandType = CommandType.StoredProcedure
Dim rd As MySqlDataReader = db.miComando.ExecuteReader
If rd.HasRows Then
While rd.Read()
Registrados = rd.GetValue(0)
ids.Add(Convert.ToInt32(rd.GetValue(1)))
End While
rd.NextResult()
End If
Catch ex As Exception
MsgBox("Se ha producido un error inesperado..", vbCritical, "ERROR")
End Try
Try
For Each itm In ids
db = New ReMe_DB
db.miComando.CommandText = "Reporte_Global"
db.miComando.CommandType = CommandType.StoredProcedure
Dim pa1 As New MySqlParameter("n1", MySqlDbType.Int32)
pa1.Direction = ParameterDirection.Input
pa1.Value = itm
db.miComando.Parameters.Add(pa1)
Dim rd2 As MySqlDataReader = db.miComando.ExecuteReader
If rd2.HasRows Then
While rd2.Read()
nombres.Add(rd2.GetValue(0))
aprobadas.Add(Convert.ToInt32(rd2.GetValue(1)))
desaprobadas.Add(Convert.ToInt32(rd2.GetValue(2)))
importantes.Add(Convert.ToInt32(rd2.GetValue(3)))
olvidadas.Add(Convert.ToInt32(rd2.GetValue(4)))
globales.Add(Convert.ToInt32(rd2.GetValue(5)))
End While
rd2.NextResult()
End If
Next
Catch ex As Exception
MsgBox("Hubo un error al cargar los reportes :/", vbCritical, "ERROR")
End Try
End Sub
End Class