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

Public Class clsSegmento
    Private _CODIGO_SEG As Integer
    Public Property CODIGO_SEG() As Integer
        Get
            Return _CODIGO_SEG
        End Get
        Set(ByVal value As Integer)
            _CODIGO_SEG = value
        End Set
    End Property
    Private _NOME_SEG As String
    Public Property NOME_SEG() As String
        Get
            Return _NOME_SEG
        End Get
        Set(ByVal value As String)
            _NOME_SEG = value
        End Set
    End Property
    Public Function SelectSEGMENTO() As DataSet
        Dim clsBanco As New clsBanco
        Dim strsql As String
        strsql = "SELECT * FROM TBL_SEGMENTO"
        Return clsBanco.RetornaDataSet(strsql.ToString)

    End Function
    Public Sub DeleteSEGMENTO(ByVal IntCodigo As Integer)
        Dim clsBanco As New clsBanco
        Dim strsql As String
        strsql = "DELETE FROM TBL_SEGMENTO"
        strsql = "WHERE CODIGO_SEG  =  " & IntCodigo
        clsBanco.ExecutaComando(strsql.ToString)
    End Sub
    Public Sub UpdateSEGMENTO(ByVal IntCodigo As Integer)
        Dim clsBanco As New clsBanco

        Dim strsql As String

        strsql = "UPDATE TBL_SEGMENTO  SET "
        strsql = strsql & "NOME_SEG= '" & _NOME_SEG & "'"
        strsql = strsql & " WHERE CODIGO_SEG = " & IntCodigo

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

        Dim strsql As String

        strsql = "INSERT INTO TBL_SEGMENTO("
        strsql = strsql & "NOME_SEG"
        strsql = strsql & ")VALUES("
        strsql = strsql & "'" & _NOME_SEG & "'"
        strsql = strsql & ")"

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

