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

Public Class clsCheckMate
    Private _CODIGO_CHECK As Integer
    Public Property CODIGO_CHECK() As Integer
        Get
            Return _CODIGO_CHECK
        End Get
        Set(ByVal value As Integer)
            _CODIGO_CHECK = value
        End Set
    End Property
    Private _NOME_CHECK As String
    Public Property NOME_CHECK() As String
        Get
            Return _NOME_CHECK
        End Get
        Set(ByVal value As String)
            _NOME_CHECK = value
        End Set
    End Property
    Public Function SelectCHECKMATE() As DataSet
        Dim clsBanco As New clsBanco
        Dim strsql As String
        strsql = "SELECT * FROM TBL_CHECKMATE"
        Return clsBanco.RetornaDataSet(strsql.ToString)

    End Function

    Public Function SelectCheckMateForCombo() As DataSet
        Dim clsBanco As New clsBanco
        Dim strsql As String
        strsql = "SELECT CODIGO_CHECK, NOME_CHECK FROM TBL_CHECKMATE ORDER BY CODIGO_CHECK"
        Return clsBanco.RetornaDataSet(strsql.ToString)

    End Function


    Public Sub DeleteCheckMate(ByVal IntCodigo As Integer)
        Dim clsBanco As New clsBanco
        Dim strsql As String
        strsql = "DELETE FROM TBL_CheckMate"
        strsql = "WHERE CODIGO_CHECK  =  " & IntCodigo
        clsBanco.ExecutaComando(strsql.ToString)
    End Sub
    Public Sub UpdateCheckMate(ByVal IntCodigo As Integer)
        Dim clsBanco As New clsBanco

        Dim strsql As String

        strsql = "UPDATE TBL_CheckMate  SET "
        strsql = strsql & "NOME_CHECK= '" & _NOME_CHECK & "'"
        strsql = strsql & " WHERE CODIGO_CHECK = " & IntCodigo

        clsBanco.ExecutaComando(strsql.ToString)
    End Sub
    Public Sub InsertCheckMate()
        Dim clsBanco As New clsBanco

        Dim strsql As String

        strsql = "INSERT INTO TBL_CHECKMATE("
        strsql = strsql & "NOME_CHECK"
        strsql = strsql & ")VALUES("
        strsql = strsql & "'" & _NOME_CHECK & "'"
        strsql = strsql & ")"

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

