I'm doing a WebService to access a procedure I've done. I'm having trouble being new to the area. First I made the class with public properties that would store the values for more part pass to procedure which in turn will enter data in the bank.
There's my class
Public Class clsMaquinario
Private _container As String
Private _statusMaq As String
Private _usuario As String
Private _data As String
Public Property Container() As String
Get
Return _container
End Get
Set(ByVal value As String)
_container = value
End Set
End Property
Public Property StatusMaq() As String
Get
Return _statusMaq
End Get
Set(ByVal value As String)
_statusMaq = value
End Set
End Property
Public Property Usario() As String
Get
Return _usuario
End Get
Set(ByVal value As String)
_usuario = value
End Set
End Property
Public Property Data() As String
Get
Return _data
End Get
Set(ByVal value As String)
_data = value
End Set
End Property
End Class
I'm doing this based on another one ready. My question is the following, I put the method to access the bank and execute the procedure in the class itself? And if so, how? Because I have an example that I was given to follow only without procedure, sending the direct select to the Bank. The example is this:
Function LIB_VAZIO_EXPORTACAO_INTERNO(ByVal Container As String) As clsLibVazioExportacao
Dim StrSql As String
Dim libVazio As New clsLibVazioExportacao
Dim rscmdAux As SqlClient.SqlDataReader
Dim acessa As New AcessoDAO.Banco
Try
StrSql = ""
StrSql = StrSql & "Select Cod_Armador, Nome_Armador, Conteiner, Tipo_Iso, "
StrSql = StrSql & "Tipo, Tara, Mgw, N_Booking, N_Lacre, Cod_Porto, "
StrSql = StrSql & "Nome_Porto, Dt_Saida, Nome_Exportador, Num_Intercambio "
StrSql = StrSql & "from v_lib_exportacao_interno "
StrSql = StrSql & "where Conteiner = '" & Container & "'"
rscmdAux = acessa.RetornaDataReader(StrSql)
............
Return libVazio
End Function