Пример #1
0
 public belBuscaRetornoMDFe(PesquisaManifestosModel objPesquisa)
 {
     this.objPesquisa = objPesquisa;
     TConsReciMDFe objconsulta = new TConsReciMDFe();
     objconsulta.versao = Acesso.versaoMDFe;
     objconsulta.tpAmb = Acesso.TP_AMB == 1 ? TAmb.Item1 : TAmb.Item2;
     objconsulta.nRec = this.objPesquisa.recibo;
     string sPathSave = Pastas.PROTOCOLOS + "Rec_" + this.objPesquisa.numero + ".xml";
     if (File.Exists(sPathSave))
         File.Delete(sPathSave);
     XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
     ns.Add("", "http://www.portalfiscal.inf.br/mdfe");
     SerializeClassToXml.SerializeClasse<TConsReciMDFe>(objconsulta, sPathSave, ns);
     xmlConsulta = new XmlDocument();
     xmlConsulta.PreserveWhitespace = false;
     xmlConsulta.Load(sPathSave);
 }
Пример #2
0
        public belBuscaRetornoMDFe(PesquisaManifestosModel objPesquisa)
        {
            this.objPesquisa = objPesquisa;
            TConsReciMDFe objconsulta = new TConsReciMDFe();

            objconsulta.versao = Acesso.versaoMDFe;
            objconsulta.tpAmb  = Acesso.TP_AMB == 1 ? TAmb.Item1 : TAmb.Item2;
            objconsulta.nRec   = this.objPesquisa.recibo;
            string sPathSave = Pastas.PROTOCOLOS + "Rec_" + this.objPesquisa.numero + ".xml";

            if (File.Exists(sPathSave))
            {
                File.Delete(sPathSave);
            }
            XmlSerializerNamespaces ns = new XmlSerializerNamespaces();

            ns.Add("", "http://www.portalfiscal.inf.br/mdfe");
            SerializeClassToXml.SerializeClasse <TConsReciMDFe>(objconsulta, sPathSave, ns);
            xmlConsulta = new XmlDocument();
            xmlConsulta.PreserveWhitespace = false;
            xmlConsulta.Load(sPathSave);
        }