Beispiel #1
0
            /// <summary> Update data on the screen. </summary>
            private void onUpdate()
            {
                TransactionSummary s = parent.select(history);

                this.SubItems[1].Text = CurrencyUtil.format(s.sales);
                this.SubItems[2].Text = CurrencyUtil.format(s.expenditures);
                this.SubItems[3].Text = CurrencyUtil.format(s.balance);
            }
Beispiel #2
0
 public void onSellEditChanged()
 {
     if (current != Company.Null)
     {
         tl_commitionSell.Text = CurrencyUtil.format(commitionToSell);
         tl_totIncom.Text      = CurrencyUtil.format(totalIncom);
     }
 }
Beispiel #3
0
 public void onBuyEditChanged()
 {
     if (current != Company.Null)
     {
         tl_commitionBuy.Text = CurrencyUtil.format(commitionToBuy);
         tl_totExpense.Text   = CurrencyUtil.format(totalExpense);
     }
 }
 static protected void rebuildRetainStockItem(ListViewItem item, Company com)
 {
     item.Tag = com;
     item.SubItems.Clear();
     item.Text = com.id;
     item.SubItems.AddRange(new string[] {
         com.name,
         com.type.name,
         CurrencyUtil.format(com.stockData.currentPrice),
         formatPriceChange(com.stockData.priceChange),
         CurrencyUtil.format(com.stockData.averageBoughtPrice),
         formatRate(com.stockData.dividendRatio),
         (com.stockData.dividend).ToString("N2"),
         formatNum(com.stockData.numOwn),
         CurrencyUtil.format(com.stockData.assessedAmount)
     });
 }
 static protected void rebuildMarketStockItem(ListViewItem item, Company com)
 {
     item.Tag = com;
     item.SubItems.Clear();
     item.Text = com.id;
     #region debug mode
     if (StockMarketConfig.debug)
     {
         item.SubItems.AddRange(new string[] {
             com.name,
             com.type.name,
             CurrencyUtil.format(com.stockData.currentPrice),
             formatPriceChange(com.stockData.priceChange),
             formatNum(com.stockData.numInMarket),
             formatNum(com.stockData.numTotal),
             formatRate(com.stockData.dividendRatio),
             (com.stockData.dividend).ToString(),
             formatNum(com.stockData.numOwn),
             com._scoreNormal.ToString("P1"),
             CurrencyUtil.format(com._salesReal),
             CurrencyUtil.format(com._benefit),
             com._scoreFuture.ToString("P1"),
             CurrencyUtil.format(com.stockData._properPriceU / unit)
         });
     }
     #endregion
     else
     {
         item.SubItems.AddRange(new string[] {
             com.name,
             com.type.name,
             CurrencyUtil.format(com.stockData.currentPrice),
             formatPriceChange(com.stockData.priceChange),
             formatNum(com.stockData.numInMarket),
             formatNum(com.stockData.numTotal),
             formatRate(com.stockData.dividendRatio),
             (com.stockData.dividend).ToString("N2"),
             formatNum(com.stockData.numOwn)
         });
     }
 }
Beispiel #6
0
        private void listview_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            chart.chart.removeDataSourceAt(0);
            if (listview.SelectedItems.Count == 0)
            {
                tl_totStockBuy.Text   = "";
                tl_totStockSell.Text  = "";
                tl_benefit.Text       = "";
                tl_commitionBuy.Text  = "";
                tl_commitionSell.Text = "";
                tl_priceBought.Text   = "";
                tl_totExpense.Text    = "";
                tl_totIncom.Text      = "";
                numberBuy.numberMax   = 0;
                numberSell.numberMax  = 0;
                current = Company.Null;
            }
            else
            {
                ListViewItem item = listview.SelectedItems[0];
                current = (Company)item.Tag;

                int n = current.stockData.numOwn;
                tl_totStockSell.Text = tl_totStockBuy.Text = StocksListHelper.formatNum(n);
                onBuyEditChanged();
                onSellEditChanged();
                tl_benefit.Text     = CurrencyUtil.format(current.stockData.benefitPerStock);
                tl_priceBought.Text = CurrencyUtil.format(current.stockData.averageBoughtPrice);
                numberBuy.numberMax = StockCompanyModule.calcBuyableStocks(
                    current.stockData, AccountManager.theInstance.liquidAssets);
                numberSell.numberMax = current.stockData.numOwn;

                chart.chart.addDataSource(current.stockData, Color.Blue);
            }
            chart.chart.calcRange();
            chart.chart.Invalidate();
        }
Beispiel #7
0
 private void onAccountChanged()
 {
     liquidAsset.Text = CurrencyUtil.format(manager.liquidAssets);
     debts.Text       = CurrencyUtil.format(manager.totalDebts);
 }
Beispiel #8
0
 public void onAccountChange()
 {
     tl_totCapital.Text = CurrencyUtil.format(manager.liquidAssets);
 }