Пример #1
0
        public string Deleta(TRegistro_param_x_Historico vRegistro)
        {
            Hashtable hs = new Hashtable(3);

            hs.Add("@P_ID_PARAM", vRegistro.Id_param);
            hs.Add("@P_ID_DRE", vRegistro.Id_dre);
            hs.Add("@P_CD_HISTORICO", vRegistro.Cd_historico);

            return(this.executarProc("EXCLUI_FIN_PARAMDRE_X_HISTORICO", hs));
        }
Пример #2
0
        public TList_param_x_Historico Select(TpBusca[] vBusca, Int32 vTop, string vNM_Campo, string vOrderBy)
        {
            TList_param_x_Historico lista  = new TList_param_x_Historico();
            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, vOrderBy));
                while (reader.Read())
                {
                    TRegistro_param_x_Historico reg = new TRegistro_param_x_Historico();

                    if (!reader.IsDBNull(reader.GetOrdinal("ID_DRE")))
                    {
                        reg.Id_dre = reader.GetDecimal(reader.GetOrdinal("ID_DRE"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("id_param")))
                    {
                        reg.Id_param = reader.GetDecimal(reader.GetOrdinal("id_param"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("Cd_historico")))
                    {
                        reg.Cd_historico = reader.GetString(reader.GetOrdinal("Cd_historico"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("Ds_historico")))
                    {
                        reg.Ds_historico = reader.GetString(reader.GetOrdinal("Ds_historico"));
                    }
                    lista.Add(reg);
                }
            }
            finally
            {
                reader.Close();
                reader.Dispose();
                if (podeFecharBco)
                {
                    this.deletarBanco_Dados();
                }
            }
            return(lista);
        }