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

Public Class clsCargo

    Private _CODIGO_CARGO As Integer
    Public Property CODIGO_CARGO() As Integer
        Get
            Return _CODIGO_CARGO
        End Get
        Set(ByVal value As Integer)
            _CODIGO_CARGO = value
        End Set
    End Property



    Private _NOME_CARGO As String
    Public Property NOME_CARGO() As String
        Get
            Return _NOME_CARGO
        End Get
        Set(ByVal value As String)
            _NOME_CARGO = value
        End Set
    End Property



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

    End Function


    Public Sub DeleteCARGO(ByVal IntCodigo As Integer)
        Dim clsBanco As New clsBanco
        Dim strsql As String
        strsql = "DELETE FROM TBL_CARGO"
        strsql = "WHERE CODIGO_CARGO  =  " & IntCodigo
        clsBanco.ExecutaComando(strsql.ToString)
    End Sub




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

        Dim strsql As String

        strsql = "UPDATE TBL_CARGO  SET "
        strsql = strsql & "NOME_CARGO= '" & _NOME_CARGO & "'"
        strsql = strsql & " WHERE CODIGO_CARGO = " & IntCodigo

        clsBanco.ExecutaComando(strsql.ToString)
    End Sub




    Public Sub InsertCARGO()
        Dim clsBanco As New clsBanco

        Dim strsql As String

        strsql = "INSERT INTO TBL_CARGO("
        strsql = strsql & "NOME_CARGO"
        strsql = strsql & ")VALUES("
        strsql = strsql & "'" & _NOME_CARGO & "'"
        strsql = strsql & ")"

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

