private void BB_Buscar_Click(object sender, EventArgs e) { if (tabControl1.SelectedIndex == 0) { TList_RegLanDuplicata lDup = TCN_LanDuplicata.Busca(CD_Empresa.Text, nr_lancto.Text, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, false, string.Empty, string.Empty, string.Empty, "A", string.Empty, string.Empty, true, 0, string.Empty, null); //Buscr Centro Resultado lDup.ForEach(p => p.lCustoLancto = TCN_DuplicataXCCusto.BuscarCusto(p.Cd_empresa, p.Nr_lancto.ToString(), null)); BS_Duplicata.DataSource = lDup; } else { } }
private void ImprimirDuplicata() { if (BS_Duplicata.Current != null) { //Buscar parcela TList_RegLanDuplicata lDup = TCN_LanDuplicata.Busca((BS_Duplicata.Current as TRegistro_LanDuplicata).Cd_empresa, (BS_Duplicata.Current as TRegistro_LanDuplicata).Nr_lancto.ToString(), string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, false, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, false, 0, string.Empty, null); lDup[0].Parcelas = new TCD_LanParcela().Select( new Utils.TpBusca[] { new Utils.TpBusca() { vNM_Campo = "a.cd_empresa", vOperador = "=", vVL_Busca = "'" + lDup[0].Cd_empresa.Trim() + "'" }, new Utils.TpBusca() { vNM_Campo = "a.nr_lancto", vOperador = "=", vVL_Busca = "" + lDup[0].Nr_lancto + "" } }, 0, string.Empty, string.Empty, string.Empty); if (lDup.Count > 0) { using (FormRelPadrao.TFGerenciadorImpressao fImp = new FormRelPadrao.TFGerenciadorImpressao()) { //Buscar dados Empresa CamadaDados.Diversos.TList_CadEmpresa lEmpresa = CamadaNegocio.Diversos.TCN_CadEmpresa.Busca(lDup[0].Cd_empresa, string.Empty, string.Empty, null); //Buscar dados do sacado CamadaDados.Financeiro.Cadastros.TList_CadClifor lSacado = CamadaNegocio.Financeiro.Cadastros.TCN_CadClifor.Busca_Clifor(lDup[0].Cd_clifor, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, false, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, 0, null); //Buscar endereco sacado if (lSacado.Count > 0) { lSacado[0].lEndereco = CamadaNegocio.Financeiro.Cadastros.TCN_CadEndereco.Buscar(lDup[0].Cd_clifor, lDup[0].Cd_endereco, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, 0, null); } fImp.St_enabled_enviaremail = true; fImp.pCd_clifor = lDup[0].Cd_clifor; fImp.pMensagem = "DUPLICATAS DO DOCUMENTO Nº" + lDup[0].Nr_docto; if ((fImp.ShowDialog() == DialogResult.OK) || (fImp.pSt_enviaremail)) { TCN_LayoutDuplicata.Imprime_Duplicata(Altera_Relatorio, lDup[0].Parcelas, lEmpresa, lSacado, fImp.pSt_imprimir, fImp.pSt_visualizar, fImp.pSt_exportPdf, fImp.Path_exportPdf, fImp.pSt_enviaremail, fImp.pDestinatarios, "DUPLICATAS(S) DO DOCUMENTO Nº " + lDup[0].Nr_docto, fImp.pDs_mensagem); Altera_Relatorio = false; } } } } }