//Get para pegar as propriedades atribuir valores e mostrar depois public InvestimentList <DirectTreasure> Get() { //Nova instancia de lista de tesouro direto var directTreasureList = new InvestimentList <DirectTreasure>(); //Intanciando radom para valores aleatorios Random random = new Random(); //Gerando 6 tesouro direto for (int i = 0; i < 6; i++) { var valuesinitials = Enum.GetNames(typeof(InitialsTypeDirectTreasure)); var type = Enum.GetNames(typeof(TypeDirectTreasure)); //Nova instancia de tesouro direto DirectTreasure directTreasure = new DirectTreasure(); directTreasure.Name = $"Tesouro direto{i + 1}"; directTreasure.Description = $"Descrição teste{i + 1}"; directTreasure.MonthlyProfitability = random.Next(1, 45); directTreasure.Initials = valuesinitials[random.Next(valuesinitials.Length)]; directTreasure.Price = random.NextDouble() * 200; directTreasure.TypeDirectTreasure = type[random.Next(type.Length)]; directTreasureList.SetInvestment(directTreasure); } //Retornando a lista return(directTreasureList); }
public InvestimentList <StockExchangeShares> Get() { //Nova intancia de lista de ações var stockExchangeSharesList = new InvestimentList <StockExchangeShares>(); //intancia de classe random para valores aleatorios Random random = new Random(); // For para gerar novas ações for (int i = 0; i < 6; i++) { var initialsStockEx = Enum.GetNames(typeof(InitialsStockExchangeShare)); //Nova instancia de ação atribuindo dados a ela var stockExchangeShares = new StockExchangeShares(); stockExchangeShares.Name = $"Teste{i}"; stockExchangeShares.Pl = random.NextDouble() * 10; stockExchangeShares.Roe = random.NextDouble() * 10; stockExchangeShares.SharePrice = random.NextDouble() * 100; stockExchangeShares.MonthlyProfitability = random.Next(10, 50); stockExchangeShares.Initials = initialsStockEx[random.Next(initialsStockEx.Length)]; stockExchangeShares.Description = "Ação teste"; stockExchangeShares.TypeStockExchangeShares = "on"; stockExchangeSharesList.SetInvestment(stockExchangeShares); } return(stockExchangeSharesList); }
public InvestimentList <Investments> Get() { // Intancia de uma nova lista de investimentos (InvestimentList) var investimentList = new InvestimentList <Investments>(); // Intanciando a classe Random para gerar valores de rentabilidade aleatorios e siglas aleatorias; Random random = new Random(); //Gerando nova lista de investimentos com 6 for (int i = 0; i < 6; i++) { //Intanciando classes de investimentos var directTreasure = new DirectTreasure(); var investmentFunds = new InvestmentFunds(); var stockExchangeShares = new StockExchangeShares(); //Adicionando suas caracteristicas var initialsStockEx = Enum.GetNames(typeof(InitialsStockExchangeShare)); stockExchangeShares.Name = $"Ação{i}"; stockExchangeShares.MonthlyProfitability = random.Next(10, 50); stockExchangeShares.Initials = initialsStockEx[random.Next(initialsStockEx.Length)]; stockExchangeShares.Description = "Ação teste"; investmentFunds.Name = $"Fundo de Investimento{i + 1}"; investmentFunds.MonthlyProfitability = 21; investmentFunds.Description = "Teste Descrição"; investmentFunds.Initials = "SLA"; var valuesinitials = Enum.GetNames(typeof(InitialsTypeDirectTreasure)); directTreasure.Name = $"Tesouro direto{i + 1}"; directTreasure.Description = $"Descrição teste{i + 1}"; directTreasure.MonthlyProfitability = random.Next(1, 45); directTreasure.Initials = valuesinitials[random.Next(valuesinitials.Length)]; investimentList.SetInvestment(stockExchangeShares); investimentList.SetInvestment(directTreasure); investimentList.SetInvestment(investmentFunds); } return(investimentList); }
//Get para pegar as propriedades e atribuir valores e exibilos public InvestimentList <InvestmentFunds> Get() { //Nova instancia Lista de fundo de investimentos var investmentFundsList = new InvestimentList <InvestmentFunds>(); // Classe radom para valores aleatorios Random random = new Random(); //Gerando 6 fundos de investimentos com suas propridades for (int i = 0; i < 6; i++) { InvestmentFunds investmentFunds = new InvestmentFunds(); investmentFunds.Name = $"Teste{i}"; investmentFunds.MonthlyProfitability = 21; investmentFunds.Manager = managers[random.Next(managers.Length)]; investmentFunds.Description = "Teste Descrição"; investmentFunds.QuotaPrice = random.NextDouble() * 200; investmentFunds.TypeInvestmentFund = typesfunds[random.Next(typesfunds.Length)]; investmentFunds.Initials = "SLA"; investmentFundsList.SetInvestment(investmentFunds); } // retornando a lista de fundo de investimento return(investmentFundsList); }
public InvestimentList <DirectTreasure> Set(InvestimentList <DirectTreasure> directTreasureList) { return(directTreasureList); }
public InvestimentList <Investments> Set(InvestimentList <Investments> investimentList) { return(investimentList); }
public InvestimentList <StockExchangeShares> Set(InvestimentList <StockExchangeShares> stockExchangeSharesList) { return(stockExchangeSharesList); }