Esta classe utiliza métodos POST para fazer requisições
Наследование: IDisposable
Пример #1
0
        public string EmitirNF(string file, TipoAmbiente tpAmb, bool cancelamento = false)
        {
            string result = "";

            using (POSTRequest post = new POSTRequest
            {
                Proxy = Proxy
            })
            {
                //                                                                                                    informe 1 para retorno em xml
                result = post.PostForm("http://sync.nfs-e.net/datacenter/include/nfw/importa_nfw/nfw_import_upload.php?eletron=1", new Dictionary <string, string> {
                    { "login", Usuario },            //CPF/CNPJ, sem separadores}
                    { "senha", Senha },              //Senha de acesso ao sistema: www.nfse.
                    { "cidade", Cidade.ToString() }, //Código da cidade na receita federal (TOM), pesquisei o código em http://www.ekwbrasil.com.br/municipio.php3.
                    { "f1", file }                   //Endereço físico do arquivo
                });
            }

            if (!cancelamento)
            {
                GerarRetorno(file, result, Propriedade.Extensao(Propriedade.TipoEnvio.EnvLoteRps).EnvioXML,
                             Propriedade.Extensao(Propriedade.TipoEnvio.EnvLoteRps).RetornoXML);
            }
            else
            {
                GerarRetorno(file, result, Propriedade.Extensao(Propriedade.TipoEnvio.PedCanNFSe).EnvioXML,
                             Propriedade.Extensao(Propriedade.TipoEnvio.PedCanNFSe).RetornoXML);
            }

            return(result);
        }
Пример #2
0
        public string EmitirNF(string file, TipoAmbiente tpAmb, bool cancelamento = false)
        {
            string result = "";

            using(POSTRequest post = new POSTRequest
                {
                    Proxy = Proxy
                })
            {                 
                //                                                                                                    informe 1 para retorno em xml
                result = post.PostForm("http://sync.nfs-e.net/datacenter/include/nfw/importa_nfw/nfw_import_upload.php?eletron=1", new Dictionary<string, string> {
                     {"login", Usuario  },  //CPF/CNPJ, sem separadores}
                     {"senha", Senha},      //Senha de acesso ao sistema: www.nfse.
                     {"cidade", Cidade.ToString()},   //Código da cidade na receita federal (TOM), pesquisei o código em http://www.ekwbrasil.com.br/municipio.php3.
                     {"f1", file}           //Endereço físico do arquivo
                });
            }

            if(!cancelamento)
                GerarRetorno(file, result, Propriedade.ExtEnvio.EnvLoteRps, Propriedade.ExtRetorno.RetLoteRps);
            else
                GerarRetorno(file, result, Propriedade.ExtEnvio.EnvCancelamento_XML, Propriedade.ExtRetorno.CanNfse);

            return result;
        }
Пример #3
0
        private string EnviaXML(string file)
        {
            string result = "";

            using (POSTRequest post = new POSTRequest
            {
                Proxy = Proxy
            })
            {
                //                                                                                                    informe 1 para retorno em xml
                result = post.PostForm("http://sync.nfs-e.net/datacenter/include/nfw/importa_nfw/nfw_import_upload.php?eletron=1", new Dictionary <string, string> {
                    { "login", Usuario },            //CPF/CNPJ, sem separadores}
                    { "senha", Senha },              //Senha de acesso ao sistema: www.nfse.
                    { "cidade", Cidade.ToString() }, //Código da cidade na receita federal (TOM), pesquisei o código em http://www.ekwbrasil.com.br/municipio.php3.
                    { "f1", file }                   //Endereço físico do arquivo
                });
            }

            return(result);
        }