Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region "Método SELECT OBJECT BY Cliente (com ID diferente)"
- Public Shared Function SelectObject_ByTipoDiffID(ByVal theNome As String, ByVal theID As String, ByVal theTecnico As String, ByVal theValor As String, ByVal theNotas As String,
- ByVal theEstado As String, ByVal theProblema As String, ByVal theIntervencao As String,
- ByVal theData_Hora_Entrega As String, ByVal theData_Hora_Entrada As String, ByVal theEquipamento As String) As AssistenciasInfo
- Dim result As AssistenciasInfo = Nothing
- Dim myDBConnection As SqlConnection = Nothing
- Dim myDBCommand As SqlCommand
- Dim dr As SqlDataReader = Nothing
- Dim statement As String = "SP_AssistenciasSelectBy_DiffID"
- Try
- myDBConnection = New SqlConnection(ClientesUtils.ConnectionString)
- myDBConnection.Open()
- myDBCommand = New SqlCommand
- myDBCommand.Connection = myDBConnection
- myDBCommand.CommandText = statement.ToString
- myDBCommand.CommandType = CommandType.StoredProcedure
- With myDBCommand.Parameters
- '.Add(New SqlParameter("@ID", SqlDbType.Int))
- .Add(New SqlParameter("@NomeCliente", SqlDbType.NVarChar))
- .Add(New SqlParameter("@Equipamento", SqlDbType.NVarChar))
- .Add(New SqlParameter("@Problema", SqlDbType.NVarChar))
- .Add(New SqlParameter("@Data_Hora_Entrada", SqlDbType.NVarChar))
- .Add(New SqlParameter("@Data_Hora_Entrega", SqlDbType.NVarChar))
- .Add(New SqlParameter("@Tecnico", SqlDbType.NVarChar))
- .Add(New SqlParameter("@Intervencao", SqlDbType.NVarChar))
- .Add(New SqlParameter("@Valor", SqlDbType.NVarChar))
- .Add(New SqlParameter("@Notas", SqlDbType.NVarChar))
- .Add(New SqlParameter("@Estado_Reparacao", SqlDbType.NVarChar))
- End With
- 'myDBCommand.Parameters("@ID").Value = theid
- myDBCommand.Parameters("@NomeCliente").Value = theNome
- myDBCommand.Parameters("@Equipamento").Value = theEquipamento
- myDBCommand.Parameters("@Problema").Value = theProblema
- myDBCommand.Parameters("@Data_Hora_Entrada").Value = theData_Hora_Entrada
- myDBCommand.Parameters("@Data_Hora_Entrega").Value = theData_Hora_Entrega
- myDBCommand.Parameters("@Tecnico").Value = theTecnico
- myDBCommand.Parameters("@Intervencao").Value = theIntervencao
- myDBCommand.Parameters("@Valor").Value = theValor
- myDBCommand.Parameters("@Notas").Value = theNotas
- myDBCommand.Parameters("@Estado_Reparacao").Value = theEstado
- dr = myDBCommand.ExecuteReader()
- If dr.HasRows Then
- If dr.Read Then
- result = BuildObjectFromRow(dr)
- End If
- End If
- Catch ex As Exception
- Finally
- If Not dr Is Nothing Then
- dr.Close()
- End If
- If Not myDBConnection Is Nothing And
- myDBConnection.State = ConnectionState.Open Then
- myDBConnection.Close()
- End If
- End Try
- Return result
- End Function
- #End Region
Add Comment
Please, Sign In to add comment