public string Excluir(TRegistro_Pergunta val) { System.Collections.Hashtable hs = new System.Collections.Hashtable(1); hs.Add("@P_ID_PERGUNTA", val.Id_pergunta); return(executarProc("EXCLUI_FAT_PERGUNTA", hs)); }
public string Gravar(TRegistro_Pergunta val) { System.Collections.Hashtable hs = new System.Collections.Hashtable(3); hs.Add("@P_ID_PERGUNTA", val.Id_pergunta); hs.Add("@P_DS_PERGUNTA", val.Ds_pergunta); hs.Add("@P_CANCELADO", val.Cancelado); return(executarProc("IA_FAT_PERGUNTA", hs)); }
public TList_Pergunta Select(Utils.TpBusca[] vBusca, int vTop, string vNm_Campo) { TList_Pergunta lista = new TList_Pergunta(); System.Data.SqlClient.SqlDataReader reader = null; bool podeFecharBco = false; if (Banco_Dados == null) { podeFecharBco = CriarBanco_Dados(false); } try { reader = ExecutarBusca(SqlCodeBusca(vBusca, Convert.ToInt16(vTop), vNm_Campo)); while (reader.Read()) { TRegistro_Pergunta reg = new TRegistro_Pergunta(); if (!reader.IsDBNull(reader.GetOrdinal("id_pergunta"))) { reg.Id_pergunta = reader.GetDecimal(reader.GetOrdinal("id_pergunta")); } if (!reader.IsDBNull(reader.GetOrdinal("ds_pergunta"))) { reg.Ds_pergunta = reader.GetString(reader.GetOrdinal("ds_pergunta")); } if (!reader.IsDBNull(reader.GetOrdinal("cancelado"))) { reg.Cancelado = reader.GetBoolean(reader.GetOrdinal("cancelado")); } lista.Add(reg); } } finally { reader.Close(); reader.Dispose(); if (podeFecharBco) { deletarBanco_Dados(); } } return(lista); }