示例#1
0
        public string Deleta(TRegistro_DRE vRegistro)
        {
            Hashtable hs = new Hashtable(1);

            hs.Add("@P_ID_DRE", vRegistro.Id_dre);

            return(this.executarProc("EXCLUI_FIN_DRE", hs));
        }
示例#2
0
        public string Grava(TRegistro_DRE vRegistro)
        {
            Hashtable hs = new Hashtable(2);

            hs.Add("@P_ID_DRE", vRegistro.Id_dre);
            hs.Add("@P_DS_DRE", vRegistro.ds_dre.Trim());

            return(this.executarProc("IA_FIN_DRE", hs));
        }
示例#3
0
        public TList_DRE Select(TpBusca[] vBusca, Int32 vTop, string vNM_Campo, string vOrderBy)
        {
            TList_DRE     lista         = new TList_DRE();
            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_DRE reg = new TRegistro_DRE();

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