public string Excluir(TRegistro_AlocacaoItem val) { System.Collections.Hashtable hs = new System.Collections.Hashtable(2); hs.Add("@P_ID_ENTREGA", val.Id_entrega); hs.Add("@P_ID_ALMOX", val.Id_almox); return(this.executarProc("EXCLUI_AMX_ALOCACAOITEM", hs)); }
public TList_AlocacaoItem Select(Utils.TpBusca[] vBusca, Int32 vTop, string vNM_Campo) { TList_AlocacaoItem lista = new TList_AlocacaoItem(); 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_AlocacaoItem reg = new TRegistro_AlocacaoItem(); if (!reader.IsDBNull(reader.GetOrdinal("id_entrega"))) { reg.Id_entrega = reader.GetDecimal(reader.GetOrdinal("id_entrega")); } if (!reader.IsDBNull(reader.GetOrdinal("id_almox"))) { reg.Id_almox = reader.GetDecimal(reader.GetOrdinal("id_almox")); } lista.Add(reg); } } finally { reader.Close(); reader.Dispose(); if (podeFecharBco) { this.deletarBanco_Dados(); } } return(lista); }