private void btGerarViaRec_Click(object sender, EventArgs e) { string vXML = ""; if (mmXml.Text != "") { vXML = mmXml.Text; mmXml.Text = spdNFe.ConverterLoteParaXML(vXML, NFeX.LayoutConv.lkRec, "pl_009"); } else { ofdAbrirArquivos.InitialDirectory = Application.StartupPath; ofdAbrirArquivos.Filter = "Arquivos XML (*.xml)|*.xml"; if (ofdAbrirArquivos.ShowDialog() == DialogResult.OK) { if (ofdAbrirArquivos.FileName != "") { vXML = ofdAbrirArquivos.FileName; mmXml.Text = File.ReadAllText(vXML); mmXml.Text = spdNFe.ConverterLoteParaXML(vXML, NFeX.LayoutConv.lkRec, "pl_009"); } } } edtID.Text = LerTagXML(mmXml.Text, "NFe", 44); }
private void BtnGerarTX2_Click(object sender, EventArgs e) { spdNFe.VersaoManual = "6.0"; _NumeroLote = "1"; if (!String.IsNullOrEmpty(txtXML.Text.Trim())) { txtXML.Text = spdNFe.ConverterLoteParaXML(txtXML.Text, LayoutConv.lkDic, "pl_009"); } else { openFileDialog.InitialDirectory = Application.StartupPath; if (openFileDialog.ShowDialog() == DialogResult.OK) { var fullPath = openFileDialog.FileName; txtXML.Text = File.ReadAllText(fullPath); txtXML.Text = spdNFe.ConverterLoteParaXML(txtXML.Text, LayoutConv.lkDic, "pl_009"); } } //mmXml.Text = spdNFe.ConverterLoteParaXml(_XML, lkTXTDataSet, pl_009); }