public string Excluir(TRegistro_Abastecidas val) { System.Collections.Hashtable hs = new System.Collections.Hashtable(1); hs.Add("@P_ID_ABASTECIDA", val.Id_abastecida); return(this.executarProc("EXCLUI_FRT_ABASTECIDAS", hs)); }
public TList_Abastecidas Select(Utils.TpBusca[] vBusca, Int32 vTop, string vNM_Campo) { TList_Abastecidas lista = new TList_Abastecidas(); 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_Abastecidas reg = new TRegistro_Abastecidas(); if (!reader.IsDBNull(reader.GetOrdinal("ID_Abastecimento"))) { reg.Id_abastecimento = reader.GetDecimal(reader.GetOrdinal("ID_Abastecimento")); } if (!reader.IsDBNull(reader.GetOrdinal("CD_Empresa"))) { reg.Cd_empresa = reader.GetString(reader.GetOrdinal("CD_Empresa")); } if (!reader.IsDBNull(reader.GetOrdinal("nm_empresa"))) { reg.Nm_empresa = reader.GetString(reader.GetOrdinal("nm_empresa")); } if (!reader.IsDBNull(reader.GetOrdinal("ID_Abastecida"))) { reg.Id_abastecida = reader.GetDecimal(reader.GetOrdinal("ID_Abastecida")); } if (!reader.IsDBNull(reader.GetOrdinal("Volume"))) { reg.Volume = reader.GetDecimal(reader.GetOrdinal("Volume")); } if (!reader.IsDBNull(reader.GetOrdinal("DT_Abastecida"))) { reg.Dt_abastecida = reader.GetDateTime(reader.GetOrdinal("DT_Abastecida")); } lista.Add(reg); } } finally { reader.Close(); reader.Dispose(); if (podeFecharBco) { this.deletarBanco_Dados(); } } return(lista); }
public string Gravar(TRegistro_Abastecidas val) { System.Collections.Hashtable hs = new System.Collections.Hashtable(5); hs.Add("@P_ID_ABASTECIDA", val.Id_abastecida); hs.Add("@P_CD_EMPRESA", val.Cd_empresa); hs.Add("@P_ID_ABASTECIMENTO", val.Id_abastecimento); hs.Add("@P_VOLUME", val.Volume); hs.Add("@P_DT_ABASTECIDA", val.Dt_abastecida); return(this.executarProc("IA_FRT_ABASTECIDAS", hs)); }