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

Public Class clsClassificacao

    Private _CODIGO_CLASS As Integer
    Public Property CODIGO_CLASS() As Integer
        Get
            Return _CODIGO_CLASS
        End Get
        Set(ByVal value As Integer)
            _CODIGO_CLASS = value
        End Set
    End Property

    Private _NOME_CLASS As String
    Public Property NOME_CLASS() As String
        Get
            Return _NOME_CLASS
        End Get
        Set(ByVal value As String)
            _NOME_CLASS = value
        End Set
    End Property

    Private _ATUALIZADO As Boolean
    Public Property ATUALIZADO() As Boolean
        Get
            Return _ATUALIZADO
        End Get
        Set(ByVal value As Boolean)
            _ATUALIZADO = value
        End Set
    End Property

    Private _DATAATUALIZACAO As DateTime
    Public Property DATAATUALIZACAO() As DateTime
        Get
            Return _DATAATUALIZACAO
        End Get
        Set(ByVal value As DateTime)
            _DATAATUALIZACAO = value
        End Set
    End Property

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

    End Function

    Public Function SelectclassificacaoforCombo() As DataSet
        Dim clsBanco As New clsBanco
        Dim strsql As String
        strsql = "SELECT CODIGO_CLASS, NOME_CLASS FROM TBL_CLASSIFICACAO WHERE CODIGO_CLASS <= 5 ORDER BY CODIGO_CLASS"
        Return clsBanco.RetornaDataSet(strsql.ToString)

    End Function

    Public Sub DeleteClassificacao(ByVal IntCodigo As Integer)
        Dim clsBanco As New clsBanco
        Dim strsql As String
        strsql = "DELETE FROM TBL_CLASSIFICACAO"
        strsql = strsql & " WHERE CODIGO_CLASS  =  " & IntCodigo
        clsBanco.ExecutaComando(strsql.ToString)
    End Sub

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

        Dim strsql As String

        strsql = "UPDATE TBL_CLASSIFICACAO  SET "
        strsql = strsql & "NOME_CLASS= '" & _NOME_CLASS & "'"
        strsql = strsql & ",ATUALIZADO= " & 1
        strsql = strsql & ",DATAATUALIZACAO= '" & _DATAATUALIZACAO & "'"
        strsql = strsql & " WHERE CODIGO_CLASS = " & IntCodigo

        clsBanco.ExecutaComando(strsql.ToString)
    End Sub

    Public Sub InsertCLASSIFICACAO()
        Dim clsBanco As New clsBanco

        Dim strsql As String

        strsql = "INSERT INTO TBL_CLASSIFICACAO("
        strsql = strsql & "NOME_CLASS"
        strsql = strsql & ",ATUALIZADO"
        strsql = strsql & ",DATAATUALIZACAO"
        strsql = strsql & ")VALUES("
        strsql = strsql & "'" & _NOME_CLASS & "'"
        strsql = strsql & "," & 1
        strsql = strsql & ",'" & _DATAATUALIZACAO & "'"
        strsql = strsql & ")"

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

