private void btnTransmitir_Click(object sender, EventArgs e) { lblNotificacoes.Text = string.Empty; if (string.IsNullOrEmpty(txtEmpenho.Text.Trim())) { lblNotificacoes.Text = "Favor preencher o nĂºmero do empenho."; txtEmpenho.Focus(); } if (dgvLotesAjuste.Rows.Count == 0) { lblNotificacoes.Text = "Favor selecionar os itens do ajuste."; return; } // MessageBox.Show(Empenho.ToString()); /*** * TODO: se tipo for contrato, buscar dados; */ Empenho.CodigoAudespLicitacao = txtCodigoAudespLicitacao.Text.Trim(); Empenho.NumeroLicitacao = txtLicitacao.Text.Trim(); //var fornecedor = new Fornecedor //{ // Nome = "Master Hospitalar Teste" //}; //Empenho.Fornecedor = fornecedor; string xsdLocation = ConfigurationManager.AppSettings["XSDLocation"]; string filename = $@"Schema\xml\Ajuste_{Empenho.CodigoAjuste}_{Empenho.NumeroEmpenho}.xml"; var ajusteModulo = new AjusteModulo(Empenho, xsdLocation, filename); var xmlService = new XmlService(); var xmlAjuste = xmlService.GerarXml(ajusteModulo); MessageBox.Show(xmlAjuste.ToString()); //AjusteXML ajusteXML = new AjusteXML(Empenho); //ajusteXML.GerarXML(); }