public TransactionViewItem(RestApi.Portfolios.TransactionsResponse.TransactionItem transaction)
 {
     Id              = transaction.Id;
     Stock           = new StockViewItem(transaction.Stock);
     TransactionDate = transaction.TransactionDate;
     Description     = transaction.Description;
 }
コード例 #2
0
        private decimal AddAssetCategory(IEnumerable <Holding> holdings, AssetCategory category)
        {
            decimal total = 0m;

            foreach (var holding in holdings)
            {
                if (holding.Stock.Category == category)
                {
                    var stock  = new StockViewItem(holding.Stock);
                    var series = new PieSeries()
                    {
                        Title  = stock.FormattedCompanyName,
                        Values = new ChartValues <ObservableValue>()
                        {
                            new ObservableValue((double)holding.Value)
                        },
                        LabelPoint = LabelFormatter
                    };
                    IndividualStocks.Add(series);

                    total += holding.Value;
                }
            }

            return(total);
        }
 public HoldingSettingsItem(HoldingProperties properties)
 {
     Stock            = new StockViewItem(properties.Stock);
     StartDate        = properties.StartDate;
     EndDate          = properties.EndDate;
     ParticipateInDrp = properties.ParticipatingInDrp;
 }
 public CorporateActionViewModel(CorporateActionsResponse.CorporateActionItem corporateAction)
 {
     Id          = corporateAction.Id;
     ActionDate  = corporateAction.ActionDate;
     Stock       = new StockViewItem(corporateAction.Stock);
     Description = corporateAction.Description;
 }
        public UnrealisedGainViewItem(SimpleUnrealisedGainsItem item)
        {
            Stock          = new StockViewItem(item.Stock);
            AquisitionDate = item.AquisitionDate;
            Units          = item.Units;
            CostBase       = item.CostBase;
            MarketValue    = item.MarketValue;
            CapitalGain    = item.CapitalGain;

            if (item.DiscountMethod == CGTMethod.Discount)
            {
                DiscountMethod = "Discount";
                DiscoutedGain  = item.DiscoutedGain;
            }
            else if (item.DiscountMethod == CGTMethod.Indexation)
            {
                DiscountMethod = "Indexation";
                DiscoutedGain  = 0.00m;
            }
            else
            {
                DiscountMethod = "Other";
                DiscoutedGain  = 0.00m;
            }
        }
        public IncomeItemViewModel(IncomeResponse.IncomeItem income)
        {
            Stock = new StockViewItem(income.Stock);

            UnfrankedAmount = income.UnfrankedAmount;
            FrankedAmount   = income.FrankedAmount;
            FrankingCredits = income.FrankingCredits;
            NetIncome       = income.NetIncome;
            GrossIncome     = income.GrossIncome;
        }
 public StockPerformanceItem(PortfolioPerformanceResponse.HoldingPerformanceItem holdingPerformance)
 {
     Stock          = new StockViewItem(holdingPerformance.Stock);
     OpeningBalance = holdingPerformance.OpeningBalance;
     Purchases      = holdingPerformance.Purchases;
     Sales          = holdingPerformance.Sales;
     Dividends      = holdingPerformance.Dividends;
     CapitalGain    = holdingPerformance.CapitalGain;
     ClosingBalance = holdingPerformance.ClosingBalance;
     DRPCashBalance = holdingPerformance.DRPCashBalance;
     TotalReturn    = holdingPerformance.TotalReturn;
     IRR            = holdingPerformance.IRR;
 }
コード例 #8
0
 public CGTEventViewModel(CgtLiabilityResponse.CgtLiabilityEvent cgtEvent)
 {
     Stock          = new StockViewItem(cgtEvent.Stock);
     EventDate      = cgtEvent.EventDate;
     CostBase       = cgtEvent.CostBase;
     AmountReceived = cgtEvent.AmountReceived;
     CapitalGain    = cgtEvent.CapitalGain;
     if (cgtEvent.Method == CgtMethod.Discount)
     {
         Method = "Discount";
     }
     else if (cgtEvent.Method == CgtMethod.Indexation)
     {
         Method = "Indexation";
     }
     else
     {
         Method = "Other";
     }
 }
        private async void PopulateAvailableStocks()
        {
            AvailableStocks.Clear();

            var stocks = await _RestClient.Stocks.Get();

            foreach (var stock in stocks.OrderBy(x => x.AsxCode))
            {
                var stockItem = new StockViewItem(stock.Id, stock.AsxCode, stock.Name);
                AvailableStocks.Add(stockItem);
                if (!stock.StapledSecurity)
                {
                    foreach (var childSecurity in stock.ChildSecurities)
                    {
                        stockItem = new StockViewItem(stock.Id, childSecurity.AsxCode, childSecurity.Name);
                        AvailableStocks.Add(stockItem);
                    }
                }
            }
        }
コード例 #10
0
        public ParcelCostBaseViewItem(DetailedUnrealisedGainsItem item)
        {
            Stock          = new StockViewItem(item.Stock);
            AquisitionDate = item.AquisitionDate;
            Units          = item.Units;
            CostBase       = item.CostBase;

            ParcelAudit = new ObservableCollection <ParcelCostBaseAuditViewItem>();

            foreach (var cgtEvent in item.CGTEvents)
            {
                var parcelAuditItem = new ParcelCostBaseAuditViewItem()
                {
                    Date        = cgtEvent.Date,
                    Description = cgtEvent.Description,
                    Units       = cgtEvent.Units,
                    Amount      = cgtEvent.CostBaseChange,
                    CostBase    = cgtEvent.CostBase
                };

                ParcelAudit.Add(parcelAuditItem);
            }
        }
コード例 #11
0
 public StockPerformanceItem(string name)
 {
     Stock = new StockViewItem(Guid.Empty, "", name);
 }
コード例 #12
0
 public HoldingItemViewModel(Holding holding)
 {
     Stock         = new StockViewItem(holding.Stock);
     Units         = holding.Units;
     ChangeInValue = new ChangeInValue(holding.Cost, holding.Value);
 }
コード例 #13
0
 public HoldingItemViewModel(string companyName, int units, decimal cost, decimal marketValue)
 {
     Stock         = new StockViewItem(Guid.Empty, "", companyName);
     Units         = units;
     ChangeInValue = new ChangeInValue(cost, marketValue);
 }