示例#1
0
        public void CalculateBalance()
        {
            using (var core = new StandardBusinessLayer(DataCache)) {
                core.Connect();

                decimal balanceAmount = core.CalculateBalance();
                balanceToolStripStatusLabel.Text = "Balans: " + balanceAmount.ToString("#,##0.00") + " kr";
                if (balanceAmount.CompareTo(0m) == 0)
                {
                    balanceToolStripStatusLabel.ForeColor = System.Drawing.Color.Black;
                    Guesser.ClearGuess();
                }
                else
                {
                    balanceToolStripStatusLabel.ForeColor = System.Drawing.Color.Red;
                }

                decimal totalWealth = core.CalculateTotalWealth();
                TotalWealthToolStripStatusLabel.Text = "Total förmögenhet: " + totalWealth.ToString("#,##0.00") + " kr";
            }
        }