C# Class NFe.Components.Functions

ファイルを表示 Open project: akretion/uninfe Class Usage Examples

Public Methods

Method Description
CarregaEstados ( ) : ArrayList
CarregaMunicipios ( ) : ArrayList

Carrega os Estados que possuem serviço de NFE já disponível. Estes Estados são carregados a partir do XML Webservice.xml que fica na pasta do executável do UNINFE

Autor: Wandrey Mundin Ferreira Data: 01/03/2010

CarregaUF ( ) : ArrayList
CodigoParaUF ( int codigo ) : string
ComputeHexadecimal ( string input ) : string

Calcula valor hexadecimal Usado para calcular o Link do QRCode da NFCe

DeletarArquivo ( string arquivo ) : void

Excluir arquivos do HD

ExibeDocumentacao ( ) : void
ExtraiPastaNomeArq ( string arquivo, string finalArq ) : string

Extrai o nome do arquivo de uma determinada string mantendo a pasta que ele está localizado

ExtrairNomeArq ( string arquivo, string finalArq ) : string

Extrai o nome do arquivo de uma determinada string. Este não mantem a pasta que ele está localizado, fica somente o nome do arquivo.

GerarMD5 ( string valor ) : string
GetDateTime ( string value ) : System.DateTime
GetIPAddress ( ) : string

Retorna o endereço IP desta estação

GetMD5Hash ( string input ) : string

Criptografar conteúdo com MD5

GravaTxtXml ( object w, string fieldname, string content ) : void
GravarErroMover ( string file, string resultFolder, string ex ) : void

IsConnectedToInternet ( ) : bool
LerArquivo ( string cArquivo ) : List

Le arquivos no formato TXT Retorna uma lista do conteudo do arquivo

LerTag ( XmlElement Elemento, string NomeTag ) : string

Busca o nome de uma determinada TAG em um Elemento do XML para ver se existe, se existir retorna seu conteúdo com um ponto e vírgula no final do conteúdo.

LerTag ( XmlElement Elemento, string NomeTag, bool RetornaPontoVirgula ) : string

Busca o nome de uma determinada TAG em um Elemento do XML para ver se existe, se existir retorna seu conteúdo, com ou sem um ponto e vírgula no final do conteúdo.

LerTag ( XmlElement Elemento, string NomeTag, string defaultValue ) : string
Move ( string arquivoOrigem, string arquivoDestino ) : void

Mover arquivo para uma determinada pasta

OnlyNumbers ( object text ) : object

Remove caracteres não-numéricos e retorna.

OnlyNumbers ( object text, string removeChars ) : object

Remove caracteres não-numéricos e retorna.

PadraoNFSe ( int municipio ) : PadroesNFSe
PopulateClasse ( object classe, object origem ) : bool
SetProperty ( object _this, string propName, object value ) : bool
SetProperty ( object _this, PropertyInfo propertyInfo, object value ) : void
StringXmlToStream ( string strXml ) : MemoryStream

Método responsável por converter uma String contendo a estrutura de um XML em uma Stream para ser lida pela XMLDocument

Conteúdo do método foi fornecido pelo Marcelo da desenvolvedores.net

StringXmlToStreamUTF8 ( string strXml ) : MemoryStream
UFParaCodigo ( string uf ) : int
WriteLog ( string msg, bool gravarStackTrace, bool geraLog, string CNPJEmpresa ) : void
XmlToString ( string parNomeArquivo ) : string

Método responsável por ler o conteúdo de um XML e retornar em uma string

_FindEmpresaByThread ( ) : int

Retorna a empresa pela thread atual

Private Methods

Method Description
CopyObjectTo ( this Source, object Destino ) : void
FileInUse ( string file ) : bool
InternetGetConnectedState ( int &Description, int ReservedValue ) : bool
populateClasse ( object classe, string origem ) : bool

Method Details

CarregaEstados() public static method

public static CarregaEstados ( ) : ArrayList
return System.Collections.ArrayList

CarregaMunicipios() public static method

Carrega os Estados que possuem serviço de NFE já disponível. Estes Estados são carregados a partir do XML Webservice.xml que fica na pasta do executável do UNINFE
Autor: Wandrey Mundin Ferreira Data: 01/03/2010
public static CarregaMunicipios ( ) : ArrayList
return System.Collections.ArrayList

CarregaUF() public static method

public static CarregaUF ( ) : ArrayList
return System.Collections.ArrayList

CodigoParaUF() public static method

public static CodigoParaUF ( int codigo ) : string
codigo int
return string

ComputeHexadecimal() public static method

Calcula valor hexadecimal Usado para calcular o Link do QRCode da NFCe
public static ComputeHexadecimal ( string input ) : string
input string Valor a ser convertido
return string

DeletarArquivo() public static method

Excluir arquivos do HD
public static DeletarArquivo ( string arquivo ) : void
arquivo string
return void

ExibeDocumentacao() public static method

public static ExibeDocumentacao ( ) : void
return void

ExtraiPastaNomeArq() public static method

Extrai o nome do arquivo de uma determinada string mantendo a pasta que ele está localizado
public static ExtraiPastaNomeArq ( string arquivo, string finalArq ) : string
arquivo string string contendo o caminho e nome do arquivo que é para ser extraído o conteúdo desejado
finalArq string string contendo o final do nome do arquivo que é para ser retirado do nome
return string

ExtrairNomeArq() public static method

Extrai o nome do arquivo de uma determinada string. Este não mantem a pasta que ele está localizado, fica somente o nome do arquivo.
public static ExtrairNomeArq ( string arquivo, string finalArq ) : string
arquivo string string contendo o caminho e nome do arquivo que é para ser extraído o conteúdo desejado
finalArq string string contendo o final do nome do arquivo que é para ser retirado do nome
return string

GerarMD5() public static method

public static GerarMD5 ( string valor ) : string
valor string
return string

GetDateTime() public static method

public static GetDateTime ( string value ) : System.DateTime
value string
return System.DateTime

GetIPAddress() public static method

Retorna o endereço IP desta estação
public static GetIPAddress ( ) : string
return string

GetMD5Hash() public static method

Criptografar conteúdo com MD5
public static GetMD5Hash ( string input ) : string
input string Conteúdo a ser criptografado
return string

GravaTxtXml() public static method

public static GravaTxtXml ( object w, string fieldname, string content ) : void
w object
fieldname string
content string
return void

GravarErroMover() public static method

public static GravarErroMover ( string file, string resultFolder, string ex ) : void
file string
resultFolder string
ex string
return void

IsConnectedToInternet() public static method

public static IsConnectedToInternet ( ) : bool
return bool

LerArquivo() public static method

Le arquivos no formato TXT Retorna uma lista do conteudo do arquivo
public static LerArquivo ( string cArquivo ) : List
cArquivo string
return List

LerTag() public static method

Busca o nome de uma determinada TAG em um Elemento do XML para ver se existe, se existir retorna seu conteúdo com um ponto e vírgula no final do conteúdo.
public static LerTag ( XmlElement Elemento, string NomeTag ) : string
Elemento System.Xml.XmlElement Elemento a ser pesquisado o Nome da TAG
NomeTag string Nome da Tag
return string

LerTag() public static method

Busca o nome de uma determinada TAG em um Elemento do XML para ver se existe, se existir retorna seu conteúdo, com ou sem um ponto e vírgula no final do conteúdo.
public static LerTag ( XmlElement Elemento, string NomeTag, bool RetornaPontoVirgula ) : string
Elemento System.Xml.XmlElement Elemento a ser pesquisado o Nome da TAG
NomeTag string Nome da Tag
RetornaPontoVirgula bool Retorna com ponto e vírgula no final do conteúdo da tag
return string

LerTag() public static method

public static LerTag ( XmlElement Elemento, string NomeTag, string defaultValue ) : string
Elemento System.Xml.XmlElement
NomeTag string
defaultValue string
return string

Move() public static method

Mover arquivo para uma determinada pasta
public static Move ( string arquivoOrigem, string arquivoDestino ) : void
arquivoOrigem string Arquivo de origem (arquivo a ser movido)
arquivoDestino string Arquivo de destino (destino do arquivo)
return void

OnlyNumbers() public static method

Remove caracteres não-numéricos e retorna.
public static OnlyNumbers ( object text ) : object
text object valor a ser convertido
return object

OnlyNumbers() public static method

Remove caracteres não-numéricos e retorna.
public static OnlyNumbers ( object text, string removeChars ) : object
text object valor a ser convertido
removeChars string
return object

PadraoNFSe() public static method

public static PadraoNFSe ( int municipio ) : PadroesNFSe
municipio int
return PadroesNFSe

PopulateClasse() public static method

public static PopulateClasse ( object classe, object origem ) : bool
classe object
origem object
return bool

SetProperty() public static method

public static SetProperty ( object _this, string propName, object value ) : bool
_this object
propName string
value object
return bool

SetProperty() public static method

public static SetProperty ( object _this, PropertyInfo propertyInfo, object value ) : void
_this object
propertyInfo System.Reflection.PropertyInfo
value object
return void

StringXmlToStream() public static method

Método responsável por converter uma String contendo a estrutura de um XML em uma Stream para ser lida pela XMLDocument
Conteúdo do método foi fornecido pelo Marcelo da desenvolvedores.net
public static StringXmlToStream ( string strXml ) : MemoryStream
strXml string
return System.IO.MemoryStream

StringXmlToStreamUTF8() public static method

public static StringXmlToStreamUTF8 ( string strXml ) : MemoryStream
strXml string
return System.IO.MemoryStream

UFParaCodigo() public static method

public static UFParaCodigo ( string uf ) : int
uf string
return int

WriteLog() public static method

public static WriteLog ( string msg, bool gravarStackTrace, bool geraLog, string CNPJEmpresa ) : void
msg string
gravarStackTrace bool
geraLog bool
CNPJEmpresa string
return void

XmlToString() public static method

Método responsável por ler o conteúdo de um XML e retornar em uma string
public static XmlToString ( string parNomeArquivo ) : string
parNomeArquivo string Caminho e nome do arquivo XML que é para pegar o conteúdo e retornar na string.
return string

_FindEmpresaByThread() public static method

Retorna a empresa pela thread atual
public static _FindEmpresaByThread ( ) : int
return int