Exemplo n.º 1
0
 public TRegistro_DescontoXAmostra()
 {
     this.capturapeso           = "N";
     this.capturapesobool       = false;
     this.capturareferencia     = "N";
     this.capturareferenciabool = false;
     this.Cd_protocolo          = string.Empty;
     this.Cd_protocolo_ref      = string.Empty;
     this.Cd_tabeladesconto     = string.Empty;
     this.Cd_tipoamostra        = string.Empty;
     this.Ds_protocolo          = string.Empty;
     this.Ds_protocolo_ref      = string.Empty;
     this.Ds_tabeladesconto     = string.Empty;
     this.Ds_tipoamostra        = string.Empty;
     this.Fator_conversao       = 1;
     this.informarR_P           = string.Empty;
     this.informarR_Pstr        = string.Empty;
     this.Maiorque             = decimal.Zero;
     this.Menorque             = decimal.Zero;
     this.Ps_referencia_padrao = decimal.Zero;
     this.St_registro          = "A";
     this.tipo_desconto        = string.Empty;
     this.tp_desconto          = string.Empty;
     this.Ordem    = string.Empty;
     this.lPerc    = new TList_PercDesconto();
     this.lPercDel = new TList_PercDesconto();
 }
Exemplo n.º 2
0
        public TList_PercDesconto Select(Utils.TpBusca[] vBusca, Int32 vTop, string vNM_Campo)
        {
            TList_PercDesconto lista = new TList_PercDesconto();

            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_PercDesconto reg = new TRegistro_PercDesconto();
                    if (!reader.IsDBNull(reader.GetOrdinal("cd_tabeladesconto")))
                    {
                        reg.Cd_tabeladesconto = reader.GetString(reader.GetOrdinal("cd_tabeladesconto"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("ds_tabeladesconto")))
                    {
                        reg.Ds_tabeladesconto = reader.GetString(reader.GetOrdinal("ds_tabeladesconto"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("cd_tipoamostra")))
                    {
                        reg.Cd_tipoamostra = reader.GetString(reader.GetOrdinal("cd_tipoamostra"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("ds_amostra")))
                    {
                        reg.Ds_tipoamostra = (reader.GetString(reader.GetOrdinal("ds_amostra")));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("Pc_resultado")))
                    {
                        reg.Pc_resultado = reader.GetDecimal(reader.GetOrdinal("Pc_resultado"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("Pc_descestoque")))
                    {
                        reg.Pc_descestoque = reader.GetDecimal(reader.GetOrdinal("Pc_descestoque"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("Pc_DescPagto")))
                    {
                        reg.Pc_descpagto = reader.GetDecimal(reader.GetOrdinal("Pc_DescPagto"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("Taxa_secagem")))
                    {
                        reg.Taxa_secagem = reader.GetDecimal(reader.GetOrdinal("Taxa_secagem"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("st_registro")))
                    {
                        reg.St_registro = reader.GetString(reader.GetOrdinal("st_registro"));
                    }
                    lista.Add(reg);
                }
            }
            finally
            {
                reader.Close();
                reader.Dispose();
                if (podeFecharBco)
                {
                    this.deletarBanco_Dados();
                }
            }
            return(lista);
        }