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

GerarCompra() private method

GerarCompra
private GerarCompra ( Compra compra, XmlElement root ) : void
compra Compra
root System.Xml.XmlElement
return void
        private void GerarCompra(Compra compra, XmlElement root)
        {
            if (!string.IsNullOrEmpty(compra.xNEmp) || !string.IsNullOrEmpty(compra.xPed) || !string.IsNullOrEmpty(compra.xCont))
            {
                nodeCurrent = doc.CreateElement("compra");
                root.AppendChild(nodeCurrent);

                /// incluida a opcao->opcional
                wCampo(compra.xNEmp, TpcnTipoCampo.tcStr, TpcnResources.xNEmp, ObOp.Opcional);
                wCampo(compra.xPed, TpcnTipoCampo.tcStr, TpcnResources.xPed, ObOp.Opcional);
                wCampo(compra.xCont, TpcnTipoCampo.tcStr, TpcnResources.xCont, ObOp.Opcional);
            }
        }