public string Excluir(TRegistro_Usuario_RegraEspecial val) { System.Collections.Hashtable hs = new System.Collections.Hashtable(2); hs.Add("@P_LOGIN", val.Login); hs.Add("@P_ID_REGRA", val.Id_regra); return(this.executarProc("EXCLUI_DIV_USUARIO_X_REGRAESPECIAL", hs)); }
public TList_Usuario_RegraEspecial Select(Utils.TpBusca[] vBusca, Int32 vTop, string vNM_Campo) { TList_Usuario_RegraEspecial lista = new TList_Usuario_RegraEspecial(); bool podeFecharBco = false; if (Banco_Dados == null) { this.CriarBanco_Dados(false); podeFecharBco = true; } System.Data.SqlClient.SqlDataReader reader = this.ExecutarBusca(this.SqlCodeBusca(vBusca, Convert.ToInt16(vTop), vNM_Campo)); try { while (reader.Read()) { TRegistro_Usuario_RegraEspecial cadUser = new TRegistro_Usuario_RegraEspecial(); if (!reader.IsDBNull(reader.GetOrdinal("login"))) { cadUser.Login = reader.GetString(reader.GetOrdinal("login")); } if (!reader.IsDBNull(reader.GetOrdinal("ID_Regra"))) { cadUser.Id_regra = reader.GetDecimal(reader.GetOrdinal("ID_Regra")); } if (!reader.IsDBNull(reader.GetOrdinal("DS_Regra"))) { cadUser.Ds_regra = reader.GetString(reader.GetOrdinal("DS_Regra")); } lista.Add(cadUser); } } finally { reader.Close(); reader.Dispose(); if (podeFecharBco) { this.deletarBanco_Dados(); } } return(lista); }