Esempio n. 1
0
        public NFe()
        {
            ide = new Ide();
            emit = new Emit();
            dest = new Dest();
            avulsa = new Avulsa();
            entrega = new Entrega();
            autXML = new List<ConvertTxt.autXML>();
            retirada = new Retirada();
            det = new List<Det>();
            Transp = new Transp();
            Cobr = new Cobr();
            InfAdic = new InfAdic();
            cana = new Cana();
            protNFe = new protNFe();
            ///
            /// NFC-e
            pag = new List<pag>();

            infNFe.Versao = (decimal)2.0;
        }
Esempio n. 2
0
        public NFe()
        {
            ide      = new Ide();
            emit     = new Emit();
            dest     = new Dest();
            avulsa   = new Avulsa();
            entrega  = new Entrega();
            autXML   = new List <ConvertTxt.autXML>();
            retirada = new Retirada();
            det      = new List <Det>();
            Transp   = new Transp();
            Cobr     = new Cobr();
            InfAdic  = new InfAdic();
            cana     = new Cana();
            protNFe  = new protNFe();
            ///
            /// NFC-e
            pag = new List <pag>();

            infNFe.Versao = (decimal)2.0;
        }
Esempio n. 3
0
        /// <summary>
        /// GerarInfAdic
        /// </summary>
        /// <param name="InfAdic"></param>
        /// <param name="root"></param>
        private void GerarInfAdic(InfAdic InfAdic, XmlElement root)
        {
            if ((!string.IsNullOrEmpty(InfAdic.infAdFisco)) ||
                (!string.IsNullOrEmpty(InfAdic.infCpl)) ||
                (InfAdic.obsCont.Count > 0) ||
                (InfAdic.obsFisco.Count > 0) ||
                (InfAdic.procRef.Count > 0))
            {
                XmlElement nodeinfAdic = doc.CreateElement("infAdic");
                root.AppendChild(nodeinfAdic);
                nodeCurrent = nodeinfAdic;

                wCampo(InfAdic.infAdFisco, TpcnTipoCampo.tcStr, TpcnResources.infAdFisco, ObOp.Opcional);
                wCampo(InfAdic.infCpl, TpcnTipoCampo.tcStr, TpcnResources.infCpl, ObOp.Opcional);
                //
                //(**)GerarInfAdicObsCont;
                //
                if (InfAdic.obsCont.Count > 10)
                    this.cMensagemErro += "obsCont: Excedeu o máximo permitido de 10" + Environment.NewLine;

                foreach (obsCont obsCont in InfAdic.obsCont)
                {
                    XmlElement nodeobsCont = doc.CreateElement("obsCont");
                    XmlAttribute xmlItem = doc.CreateAttribute(TpcnResources.xCampo.ToString());
                    xmlItem.Value = obsCont.xCampo;
                    nodeobsCont.Attributes.Append(xmlItem);
                    nodeinfAdic.AppendChild(nodeobsCont);
                    nodeCurrent = nodeobsCont;
                    wCampo(obsCont.xTexto, TpcnTipoCampo.tcStr, TpcnResources.xTexto);
                }
                //
                //(**)GerarInfAdicObsFisco;
                //
                if (InfAdic.obsFisco.Count > 10)
                    this.cMensagemErro += "obsFisco: Excedeu o máximo permitido de 10" + Environment.NewLine;

                foreach (obsFisco obsFisco in InfAdic.obsFisco)
                {
                    XmlElement nodeobsFisco = doc.CreateElement("obsFisco");
                    XmlAttribute xmlItem = doc.CreateAttribute(TpcnResources.xCampo.ToString());
                    xmlItem.Value = obsFisco.xCampo;
                    nodeobsFisco.Attributes.Append(xmlItem);
                    nodeinfAdic.AppendChild(nodeobsFisco);
                    nodeCurrent = nodeobsFisco;
                    wCampo(obsFisco.xTexto, TpcnTipoCampo.tcStr, TpcnResources.xTexto);
                }
                //
                //(**)GerarInfAdicProcRef;
                //
                foreach (procRef procRef in InfAdic.procRef)
                {
                    XmlElement nodeprocRef = doc.CreateElement("procRef");
                    nodeinfAdic.AppendChild(nodeprocRef);
                    nodeCurrent = nodeprocRef;

                    wCampo(procRef.nProc, TpcnTipoCampo.tcStr, TpcnResources.nProc);
                    wCampo(procRef.indProc, TpcnTipoCampo.tcStr, TpcnResources.indProc);
                }
            }
        }