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

Public Class clsConcorrente

    Private _CODIGO_CONC As Integer
    Public Property CODIGO_CONC() As Integer
        Get
            Return _CODIGO_CONC
        End Get
        Set(ByVal value As Integer)
            _CODIGO_CONC = value
        End Set
    End Property



    Private _NOME_CONC As String
    Public Property NOME_CONC() As String
        Get
            Return _NOME_CONC
        End Get
        Set(ByVal value As String)
            _NOME_CONC = value
        End Set
    End Property



    Private _FANTASIA_CONC As String
    Public Property FANTASIA_CONC() As String
        Get
            Return _FANTASIA_CONC
        End Get
        Set(ByVal value As String)
            _FANTASIA_CONC = value
        End Set
    End Property



    Private _ENDERECO_CONC As String
    Public Property ENDERECO_CONC() As String
        Get
            Return _ENDERECO_CONC
        End Get
        Set(ByVal value As String)
            _ENDERECO_CONC = value
        End Set
    End Property



    Private _NUMERO_CONC As String
    Public Property NUMERO_CONC() As String
        Get
            Return _NUMERO_CONC
        End Get
        Set(ByVal value As String)
            _NUMERO_CONC = value
        End Set
    End Property



    Private _COMPLEMENTO_CONC As String
    Public Property COMPLEMENTO_CONC() As String
        Get
            Return _COMPLEMENTO_CONC
        End Get
        Set(ByVal value As String)
            _COMPLEMENTO_CONC = value
        End Set
    End Property



    Private _BAIRRO_CONC As String
    Public Property BAIRRO_CONC() As String
        Get
            Return _BAIRRO_CONC
        End Get
        Set(ByVal value As String)
            _BAIRRO_CONC = value
        End Set
    End Property



    Private _CEP_CONC As String
    Public Property CEP_CONC() As String
        Get
            Return _CEP_CONC
        End Get
        Set(ByVal value As String)
            _CEP_CONC = value
        End Set
    End Property



    Private _CIDADE_CONC As String
    Public Property CIDADE_CONC() As String
        Get
            Return _CIDADE_CONC
        End Get
        Set(ByVal value As String)
            _CIDADE_CONC = value
        End Set
    End Property



    Private _ESTADO_CONC As String
    Public Property ESTADO_CONC() As String
        Get
            Return _ESTADO_CONC
        End Get
        Set(ByVal value As String)
            _ESTADO_CONC = value
        End Set
    End Property



    Private _CNPJ_CONC As String
    Public Property CNPJ_CONC() As String
        Get
            Return _CNPJ_CONC
        End Get
        Set(ByVal value As String)
            _CNPJ_CONC = value
        End Set
    End Property



    Private _IE_CONC As String
    Public Property IE_CONC() As String
        Get
            Return _IE_CONC
        End Get
        Set(ByVal value As String)
            _IE_CONC = value
        End Set
    End Property



    Private _IM_CONC As String
    Public Property IM_CONC() As String
        Get
            Return _IM_CONC
        End Get
        Set(ByVal value As String)
            _IM_CONC = value
        End Set
    End Property



    Private _CONTATO_CONC As String
    Public Property CONTATO_CONC() As String
        Get
            Return _CONTATO_CONC
        End Get
        Set(ByVal value As String)
            _CONTATO_CONC = value
        End Set
    End Property



    Private _EMAIL_CONC As String
    Public Property EMAIL_CONC() As String
        Get
            Return _EMAIL_CONC
        End Get
        Set(ByVal value As String)
            _EMAIL_CONC = value
        End Set
    End Property



    Private _TELEFONE_CONC As String
    Public Property TELEFONE_CONC() As String
        Get
            Return _TELEFONE_CONC
        End Get
        Set(ByVal value As String)
            _TELEFONE_CONC = value
        End Set
    End Property



    Private _CELULAR_CONC As String
    Public Property CELULAR_CONC() As String
        Get
            Return _CELULAR_CONC
        End Get
        Set(ByVal value As String)
            _CELULAR_CONC = value
        End Set
    End Property



    Private _OBSERVACAO_CONC As String
    Public Property OBSERVACAO_CONC() As String
        Get
            Return _OBSERVACAO_CONC
        End Get
        Set(ByVal value As String)
            _OBSERVACAO_CONC = value
        End Set
    End Property



    Private _ATIVO As Boolean
    Public Property ATIVO() As Boolean
        Get
            Return _ATIVO
        End Get
        Set(ByVal value As Boolean)
            _ATIVO = 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 SelectCONCORRENTE() As DataSet
        Dim clsBanco As New clsBanco
        Dim strsql As String
        strsql = "SELECT * FROM TBL_CONCORRENTE"
        Return clsBanco.RetornaDataSet(strsql.ToString)

    End Function

    Public Function SelectConcorrenteForCombo() As DataSet
        Dim clsBanco As New clsBanco
        Dim strsql As String
        strsql = "SELECT CODIGO_CONC,NOME_CONC FROM TBL_CONCORRENTE ORDER BY NOME_CONC"
        Return clsBanco.RetornaDataSet(strsql.ToString)

    End Function


    Public Sub DeleteCONCORRENTE(ByVal IntCodigo As Integer)
        Dim clsBanco As New clsBanco
        Dim strsql As String
        strsql = "DELETE FROM TBL_CONCORRENTE"
        strsql = "WHERE CODIGO_CONC  =  " & IntCodigo
        clsBanco.ExecutaComando(strsql.ToString)
    End Sub




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

        Dim strsql As String

        strsql = "UPDATE TBL_CONCORRENTE  SET "
        strsql = strsql & "NOME_CONC= '" & _NOME_CONC & "'"
        strsql = strsql & ",FANTASIA_CONC= '" & _FANTASIA_CONC & "'"
        strsql = strsql & ",ENDERECO_CONC= '" & _ENDERECO_CONC & "'"
        strsql = strsql & ",NUMERO_CONC= '" & _NUMERO_CONC & "'"
        strsql = strsql & ",COMPLEMENTO_CONC= '" & _COMPLEMENTO_CONC & "'"
        strsql = strsql & ",BAIRRO_CONC= '" & _BAIRRO_CONC & "'"
        strsql = strsql & ",CEP_CONC= '" & _CEP_CONC & "'"
        strsql = strsql & ",CIDADE_CONC= '" & _CIDADE_CONC & "'"
        strsql = strsql & ",ESTADO_CONC= '" & _ESTADO_CONC & "'"
        strsql = strsql & ",CNPJ_CONC= '" & _CNPJ_CONC & "'"
        strsql = strsql & ",IE_CONC= '" & _IE_CONC & "'"
        strsql = strsql & ",IM_CONC= '" & _IM_CONC & "'"
        strsql = strsql & ",CONTATO_CONC= '" & _CONTATO_CONC & "'"
        strsql = strsql & ",EMAIL_CONC= '" & _EMAIL_CONC & "'"
        strsql = strsql & ",TELEFONE_CONC= '" & _TELEFONE_CONC & "'"
        strsql = strsql & ",CELULAR_CONC= '" & _CELULAR_CONC & "'"
        strsql = strsql & ",OBSERVACAO_CONC= '" & _OBSERVACAO_CONC & "'"
        strsql = strsql & ",ATIVO= " & 1
        strsql = strsql & ",ATUALIZADO= " & 1
        strsql = strsql & ",DATAATUALIZACAO= '" & _DATAATUALIZACAO & "'"
        strsql = strsql & " WHERE CODIGO_CONC = " & IntCodigo

        clsBanco.ExecutaComando(strsql.ToString)
    End Sub




    Public Sub InsertCONCORRENTE()
        Dim clsBanco As New clsBanco

        Dim strsql As String

        strsql = "INSERT INTO TBL_CONCORRENTE("
        strsql = strsql & "NOME_CONC"
        strsql = strsql & "FANTASIA_CONC"
        strsql = strsql & "ENDERECO_CONC"
        strsql = strsql & "NUMERO_CONC"
        strsql = strsql & "COMPLEMENTO_CONC"
        strsql = strsql & "BAIRRO_CONC"
        strsql = strsql & "CEP_CONC"
        strsql = strsql & "CIDADE_CONC"
        strsql = strsql & "ESTADO_CONC"
        strsql = strsql & "CNPJ_CONC"
        strsql = strsql & "IE_CONC"
        strsql = strsql & "IM_CONC"
        strsql = strsql & "CONTATO_CONC"
        strsql = strsql & "EMAIL_CONC"
        strsql = strsql & "TELEFONE_CONC"
        strsql = strsql & "CELULAR_CONC"
        strsql = strsql & "OBSERVACAO_CONC"
        strsql = strsql & "ATIVO"
        strsql = strsql & "ATUALIZADO"
        strsql = strsql & "DATAATUALIZACAO"
        strsql = strsql & ")VALUES("
        strsql = strsql & "'" & _NOME_CONC & "'"
        strsql = strsql & ",'" & _FANTASIA_CONC & "'"
        strsql = strsql & ",'" & _ENDERECO_CONC & "'"
        strsql = strsql & ",'" & _NUMERO_CONC & "'"
        strsql = strsql & ",'" & _COMPLEMENTO_CONC & "'"
        strsql = strsql & ",'" & _BAIRRO_CONC & "'"
        strsql = strsql & ",'" & _CEP_CONC & "'"
        strsql = strsql & ",'" & _CIDADE_CONC & "'"
        strsql = strsql & ",'" & _ESTADO_CONC & "'"
        strsql = strsql & ",'" & _CNPJ_CONC & "'"
        strsql = strsql & ",'" & _IE_CONC & "'"
        strsql = strsql & ",'" & _IM_CONC & "'"
        strsql = strsql & ",'" & _CONTATO_CONC & "'"
        strsql = strsql & ",'" & _EMAIL_CONC & "'"
        strsql = strsql & ",'" & _TELEFONE_CONC & "'"
        strsql = strsql & ",'" & _CELULAR_CONC & "'"
        strsql = strsql & ",'" & _OBSERVACAO_CONC & "'"
        strsql = strsql & "," & 1
        strsql = strsql & "," & 1
        strsql = strsql & ",'" & _DATAATUALIZACAO & "'"
        strsql = strsql & ")"

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

