Exemplo n.º 1
0
        /// <summary>
        /// GerarCompra
        /// </summary>
        /// <param name="compra"></param>
        /// <param name="root"></param>
        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);
            }
        }