public string Excluir(TRegistro_PlanoReferencial val) { System.Collections.Hashtable hs = new System.Collections.Hashtable(1); hs.Add("@P_CD_REFERENCIA", val.Cd_referencia); return(this.executarProc("EXCLUI_CTB_PLANOREFERENCIAL", hs)); }
public string Gravar(TRegistro_PlanoReferencial val) { System.Collections.Hashtable hs = new System.Collections.Hashtable(8); hs.Add("@P_CD_REFERENCIA", val.Cd_referencia); hs.Add("@P_CD_REFERENCIAPAI", val.Cd_referenciapai); hs.Add("@P_NOME", val.Nome); hs.Add("@P_DT_INI", val.Dt_ini); hs.Add("@P_DT_FIN", val.Dt_fin); hs.Add("@P_TP_CONTA", val.Tp_conta); hs.Add("@P_NIVEL", val.Nivel); hs.Add("@P_NATUREZA", val.Natureza); return(this.executarProc("IA_CTB_PLANOREFERENCIAL", hs)); }
public TList_PlanoReferencial Select(TpBusca[] vBusca, Int32 vTop, string vNM_Campo) { TList_PlanoReferencial lista = new TList_PlanoReferencial(); 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_PlanoReferencial reg = new TRegistro_PlanoReferencial(); if (!reader.IsDBNull(reader.GetOrdinal("cd_referencia"))) { reg.Cd_referencia = reader.GetString(reader.GetOrdinal("cd_referencia")); } if (!reader.IsDBNull(reader.GetOrdinal("nome"))) { reg.Nome = reader.GetString(reader.GetOrdinal("nome")); } if (!reader.IsDBNull(reader.GetOrdinal("cd_referenciapai"))) { reg.Cd_referenciapai = reader.GetString(reader.GetOrdinal("cd_referenciapai")); } if (!reader.IsDBNull(reader.GetOrdinal("nomepai"))) { reg.Nomepai = reader.GetString(reader.GetOrdinal("nomepai")); } if (!reader.IsDBNull(reader.GetOrdinal("dt_ini"))) { reg.Dt_ini = reader.GetDateTime(reader.GetOrdinal("dt_ini")); } if (!reader.IsDBNull(reader.GetOrdinal("dt_fin"))) { reg.Dt_fin = reader.GetDateTime(reader.GetOrdinal("dt_fin")); } if (!reader.IsDBNull(reader.GetOrdinal("tp_conta"))) { reg.Tp_conta = reader.GetString(reader.GetOrdinal("tp_conta")); } if (!reader.IsDBNull(reader.GetOrdinal("nivel"))) { reg.Nivel = reader.GetDecimal(reader.GetOrdinal("nivel")); } if (!reader.IsDBNull(reader.GetOrdinal("natureza"))) { reg.Natureza = reader.GetString(reader.GetOrdinal("natureza")); } lista.Add(reg); } } finally { reader.Close(); reader.Dispose(); if (podeFecharBco) { this.deletarBanco_Dados(); } } return(lista); }