private DataTable MontarDataTablePeloTitulo() { FormularioDB db = new FormularioDB(); List <Formulario.Formulario> lista = db.Carrega(null, "#Titulo = '" + cpTitulo.Texto + "'"); DataTable oDT = FuncoesTypes.ConverteListaParaDataTable(lista); return(oDT); }
private DataTable MontarDataTablePeloVazio() { FormularioDB db = new FormularioDB(); List <Formulario.Formulario> lista = db.Carrega(null, ""); DataTable oDT = FuncoesTypes.ConverteListaParaDataTable(lista); return(oDT); }
private void PegaValorDoFormConsulta() { string sTreinamentoId = Funcoes.Funcoes.VB.Trim(Request.QueryString["fid"]); Formulario.Formulario form = new Formulario.Formulario(); FormularioDB db = new FormularioDB(); if (string.IsNullOrEmpty(sTreinamentoId) || !Funcoes.Funcoes.VB.IsNumeric(sTreinamentoId)) { MensagemErroTreinamento.Texto = "Formulario não encontrado"; MensagemErroTreinamento.Exibir(); pnlFormulario.Visible = false; } else { form.FormularioID = int.Parse(sTreinamentoId); if (db.Carrega(null, ref form)) { PreencheCamposFormManutencao(form); } } }
private bool ExcluirRegistros() { Banco.Conexao conexao = new Banco.Conexao(); bool bRetorno = true; try { Formulario.FormularioDB formularioDB = new FormularioDB(); conexao.AbreConexao(); conexao.IniciaTransacao(); Formulario.Formulario formulario = new Formulario.Formulario(); foreach (string lista in grdRegistros.CodigosSelecionados) { formulario.FormularioID = int.Parse(lista); bRetorno = formularioDB.Exclui(conexao, formulario); if (!bRetorno) { break; } } if (bRetorno) { conexao.TerminaTransacao(); } else { conexao.DesfazTransacao(); } } catch (Exception) { msgAlert.Texto = "Erro ao excluir"; msgAlert.Exibir(); conexao.FechaConexao(); } return(bRetorno); }