public string Excluir(TRegistro_AbastFrota_X_CCusto val) { System.Collections.Hashtable hs = new System.Collections.Hashtable(2); hs.Add("@P_ID_ABASTECIMENTO", val.Id_abastecimento); hs.Add("@P_ID_CCUSTOLAN", val.Id_ccustolan); return(this.executarProc("EXCLUI_FIN_ABASTFROTA_X_CCUSTO", hs)); }
public TList_AbastFrota_X_CCusto Select(Utils.TpBusca[] vBusca, Int32 vTop, string vNM_Campo) { TList_AbastFrota_X_CCusto lista = new TList_AbastFrota_X_CCusto(); System.Data.SqlClient.SqlDataReader reader = null; bool podeFecharBco = false; if (Banco_Dados == null) { podeFecharBco = this.CriarBanco_Dados(false); } try { reader = this.ExecutarBusca(this.SqlCodeBusca(vBusca, Convert.ToInt16(vTop), vNM_Campo)); while (reader.Read()) { TRegistro_AbastFrota_X_CCusto reg = new TRegistro_AbastFrota_X_CCusto(); if (!reader.IsDBNull(reader.GetOrdinal("ID_Abastecimento"))) { reg.Id_abastecimento = reader.GetDecimal(reader.GetOrdinal("ID_Abastecimento")); } if (!reader.IsDBNull(reader.GetOrdinal("ID_CCustoLan"))) { reg.Id_ccustolan = reader.GetDecimal(reader.GetOrdinal("ID_CCustoLan")); } lista.Add(reg); } } finally { reader.Close(); reader.Dispose(); if (podeFecharBco) { this.deletarBanco_Dados(); } } return(lista); }