private void GerarArquivoP() { try { acbrPAF.PafP.RegistroP1.RazaoSocial = txtRazaoSocial.Text; acbrPAF.PafP.RegistroP1.UF = txtUF.Text; acbrPAF.PafP.RegistroP1.CNPJ = txtCNPJ.Text; acbrPAF.PafP.RegistroP1.IE = txtIE.Text; acbrPAF.PafP.RegistroP1.IM = txtIM.Text; for (int i = 0; i < 10; i++) { ACBrPAFRegistroP2 ItemP2 = new ACBrPAFRegistroP2(); ItemP2.COD_MERC_SERV = (string)GerarDados('S', 6); ItemP2.DESC_MERC_SERV = (string)GerarDados('S', 6); ItemP2.UN_MED = (string)GerarDados('S', 2); ItemP2.IAT = (string)GerarDados('S', 6); ItemP2.IPPT = (string)GerarDados('S', 6); ItemP2.ST = (string)GerarDados('S', 6); ItemP2.ALIQ = (decimal)GerarDados('D', 6); ItemP2.VL_UNIT = (decimal)GerarDados('D', 6); ItemP2.RegistroValido = true; acbrPAF.PafP.RegistroP2.Add(ItemP2); ItemP2 = null; } if (acbrPAF.SaveFileTXT_P(@"\PAF_P.txt")) { WriteResp("Arquivo PAF_P gerado com sucesso"); } else { WriteResp("Arquivo PAF_P não foi gerado"); } } catch (Exception exception) { messageToolStripStatusLabel.Text = "Exception"; descriptionToolStripStatusLabel.Text = exception.Message; } }
private void PAF_Preenche_P() { acbrPAF.PafP.RegistroP1.RazaoSocial = txtRazaoSocial.Text; acbrPAF.PafP.RegistroP1.UF = txtUF.Text; acbrPAF.PafP.RegistroP1.CNPJ = txtCNPJ.Text; acbrPAF.PafP.RegistroP1.IE = txtIE.Text; acbrPAF.PafP.RegistroP1.IM = txtIM.Text; for (int i = 0; i < 10; i++) { ACBrPAFRegistroP2 ItemP2 = new ACBrPAFRegistroP2(); ItemP2.COD_MERC_SERV = (string)GerarDados('S', 6); ItemP2.DESC_MERC_SERV = (string)GerarDados('S', 6); ItemP2.UN_MED = (string)GerarDados('S', 2); ItemP2.IAT = (string)GerarDados('S', 6); ItemP2.IPPT = (string)GerarDados('S', 6); ItemP2.ST = (string)GerarDados('S', 6); ItemP2.ALIQ = (decimal)GerarDados('D', 6); ItemP2.VL_UNIT = (decimal)GerarDados('D', 6); ItemP2.RegistroValido = true; acbrPAF.PafP.RegistroP2.Add(ItemP2); ItemP2 = null; } }