Exemple #1
0
        public string Deleta(TRegistro_Cad_OriginacaoCustoHeadge vRegistro)
        {
            Hashtable hs = new Hashtable(3);

            hs.Add("@P_ID_ORIGINACAO", vRegistro.ID_Originacao);
            hs.Add("@P_ID_HEADGE", vRegistro.ID_Headge);
            hs.Add("@P_ID_LANCTOHEADGE", vRegistro.ID_LanctoHeadge);

            return(this.executarProc("EXCLUI_GRO_ORIGINACAO_X_CUSTOHEADGE", hs));
        }
Exemple #2
0
        public TList_Cad_OriginacaoCustoHeadge Select(TpBusca[] vBusca, Int32 vTop, string vNM_Campo)
        {
            TList_Cad_OriginacaoCustoHeadge lista = new TList_Cad_OriginacaoCustoHeadge();
            SqlDataReader reader        = null;
            bool          podeFecharBco = false;

            if (Banco_Dados == null)
            {
                this.CriarBanco_Dados(false);
                podeFecharBco = true;
            }

            try
            {
                reader = this.ExecutarBusca(this.SqlCodeBusca(vBusca, Convert.ToInt16(vTop), vNM_Campo));
                while (reader.Read())
                {
                    TRegistro_Cad_OriginacaoCustoHeadge reg = new TRegistro_Cad_OriginacaoCustoHeadge();

                    if (!reader.IsDBNull(reader.GetOrdinal("ID_Originacao")))
                    {
                        reg.ID_Originacao = reader.GetDecimal(reader.GetOrdinal("ID_Originacao"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("ID_Headge")))
                    {
                        reg.ID_Headge = reader.GetDecimal(reader.GetOrdinal("ID_Headge"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("ID_LanctoHeadge")))
                    {
                        reg.ID_LanctoHeadge = reader.GetDecimal(reader.GetOrdinal("ID_LanctoHeadge"));
                    }

                    lista.Add(reg);
                }
            }
            finally
            {
                reader.Close();
                reader.Dispose();
                if (podeFecharBco)
                {
                    this.deletarBanco_Dados();
                }
            }
            return(lista);
        }