Imports System.Collections.Generic
Imports System.Text
Imports System.Data.SqlClient
Imports System.Data

Public Class clsTier

    Private _CODIGO_TIER As Integer
    Public Property CODIGO_TIER() As Integer
        Get
            Return _CODIGO_TIER
        End Get
        Set(ByVal value As Integer)
            _CODIGO_TIER = value
        End Set
    End Property



    Private _NOME_TIER As String
    Public Property NOME_TIER() As String
        Get
            Return _NOME_TIER
        End Get
        Set(ByVal value As String)
            _NOME_TIER = value
        End Set
    End Property



    Public Function SelectTIER() As DataSet
        Dim clsBanco As New clsBanco
        Dim strsql As String
        strsql = "SELECT * FROM TBL_TIER"
        Return clsBanco.RetornaDataSet(strsql.ToString)

    End Function


    Public Sub DeleteTIER(ByVal IntCodigo As Integer)
        Dim clsBanco As New clsBanco
        Dim strsql As String
        strsql = "DELETE FROM TBL_TIER"
        strsql = "WHERE CODIGO_TIER  =  " & IntCodigo
        clsBanco.ExecutaComando(strsql.ToString)
    End Sub




    Public Sub UpdateTIER(ByVal IntCodigo As Integer)
        Dim clsBanco As New clsBanco

        Dim strsql As String

        strsql = "UPDATE TBL_TIER  SET "
        strsql = strsql & "NOME_TIER= '" & _NOME_TIER & "'"
        strsql = strsql & " WHERE CODIGO_TIER = " & IntCodigo

        clsBanco.ExecutaComando(strsql.ToString)
    End Sub




    Public Sub InsertTIER()
        Dim clsBanco As New clsBanco

        Dim strsql As String

        strsql = "INSERT INTO TBL_TIER("
        strsql = strsql & "NOME_TIER"
        strsql = strsql & ")VALUES("
        strsql = strsql & "'" & _NOME_TIER & "'"
        strsql = strsql & ")"

        clsBanco.ExecutaComando(strsql.ToString)
    End Sub
End Class

