Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p4 = Convert.ToInt32(validacampo(zp_.Rows(cont)("pax_evaden_p4")))
- Private Function validacampo(v As Object) As Integer
- If v.Equals(DBNull.Value) Then
- Return 0
- Else
- Return v
- End If
- End Function
- Private Function ValTotales(ppu As String, sentido As String, conexion As OleDbConnection) As Object
- Dim zp_ As New DataTable
- Dim cont As Integer = 0
- Dim evasores, p1, p2, p3, p4, val, totalusuarios, zp As Integer
- Dim array(4) As Integer
- Dim query_string As String = "SELECT * FROM Evasiones WHERE ppu='" + ppu + "' AND sentido_serv='" + sentido + "'"
- Dim cmm As New OleDbCommand(query_string, conexion)
- Dim dr As New OleDbDataAdapter(cmm)
- dr.Fill(zp_)
- While zp_.Rows.Count > cont
- val += Convert.ToInt32(zp_.Rows(cont)("pax_validan_p1"))
- p1 += Convert.ToInt32(zp_.Rows(cont)("pax_evaden_p1"))
- p2 += Convert.ToInt32(zp_.Rows(cont)("pax_evaden_p2"))
- p3 += Convert.ToInt32(zp_.Rows(cont)("pax_evaden_p3"))
- p4 = Convert.ToInt32(validacampo(zp_.Rows(cont)("pax_evaden_p4")))
- Dim zp_str As String = Convert.ToString(zp_.Rows(cont)("zona_paga"))
- Dim new_str As String = Mid(zp_str, 1, 6)
- If zp_str <> "" And Mid(new_str, 1, 3) = "PAX" Then
- Dim a As Object = Split(new_str, " ")
- If Mid(a(1), 2, 1) = "," Then
- zp += Convert.ToInt32(Mid(a(1), 1, 1))
- Else
- zp += Convert.ToInt32(a(1))
- End If
- End If
- cont += 1
- End While
- evasores = p1 + p2 + p3 + p4
- totalusuarios = val + p1 + p2 + p3 + p4
- array(0) = cont
- array(1) = zp
- array(2) = val
- array(3) = evasores
- array(4) = totalusuarios
- Return array
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement