Esempio n. 1
0
        public void Deleta(TRegistro_CadRota vRegistro)
        {
            Hashtable hs = new Hashtable(1);

            hs.Add("@P_ID_ROTA", vRegistro.Id_rota);

            executarProc("EXCLUI_DIV_ROTA", hs);
        }
Esempio n. 2
0
        public string Grava(TRegistro_CadRota vRegistro)
        {
            Hashtable hs = new Hashtable(2);

            hs.Add("@P_ID_ROTA", vRegistro.Id_rota);
            hs.Add("@P_DS_ROTA", vRegistro.Ds_rota);

            return(executarProc("IA_DIV_ROTA", hs));
        }
Esempio n. 3
0
        public TList_CadRota  Select(TpBusca[] vBusca, Int32 vTop, string vNM_Campo)
        {
            TList_CadRota lista         = new TList_CadRota();
            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_CadRota reg = new TRegistro_CadRota();
                    if (!reader.IsDBNull(reader.GetOrdinal("Id_rota")))
                    {
                        reg.Id_rota = reader.GetDecimal(reader.GetOrdinal("Id_rota"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("Ds_rota")))
                    {
                        reg.Ds_rota = reader.GetString(reader.GetOrdinal("Ds_rota"));
                    }
                    lista.Add(reg);
                }
            }
            finally
            {
                reader.Close();
                reader.Dispose();
                if (podeFecharBco)
                {
                    this.deletarBanco_Dados();
                }
            }
            return(lista);
        }