NFe.ConvertTxt.NFeW.GerarEntrega C# (CSharp) Method

GerarEntrega() private method

GerarEntrega
private GerarEntrega ( NFe NFe, XmlElement root ) : void
NFe NFe
root System.Xml.XmlElement
return void
        private void GerarEntrega(NFe NFe, XmlElement root)
        {
            if (!string.IsNullOrEmpty(NFe.entrega.xLgr))
            {
                XmlElement e0 = doc.CreateElement("entrega");
                root.AppendChild(e0);
                nodeCurrent = e0;

                if (string.IsNullOrEmpty(NFe.entrega.CNPJ) && string.IsNullOrEmpty(NFe.entrega.CPF))
                    throw new Exception("CNPJ/CPF inválido no segmento [F]");

                if (!string.IsNullOrEmpty(NFe.entrega.CNPJ))
                    wCampo(NFe.entrega.CNPJ, TpcnTipoCampo.tcStr, TpcnResources.CNPJ);
                else
                    wCampo(NFe.entrega.CPF, TpcnTipoCampo.tcStr, TpcnResources.CPF);
                wCampo(NFe.entrega.xLgr, TpcnTipoCampo.tcStr, TpcnResources.xLgr);
                wCampo(NFe.entrega.nro, TpcnTipoCampo.tcStr, TpcnResources.nro);
                wCampo(NFe.entrega.xCpl, TpcnTipoCampo.tcStr, TpcnResources.xCpl, ObOp.Opcional);
                wCampo(NFe.entrega.xBairro, TpcnTipoCampo.tcStr, TpcnResources.xBairro);
                wCampo(NFe.entrega.cMun, TpcnTipoCampo.tcInt, TpcnResources.cMun, ObOp.Obrigatorio, 7);
                wCampo(NFe.entrega.xMun, TpcnTipoCampo.tcStr, TpcnResources.xMun);
                wCampo(NFe.entrega.UF, TpcnTipoCampo.tcStr, TpcnResources.UF);
            }
        }
        /// <summary>