banktransaction.cs

来自「csharp-solution,C#高效编程源码」· CS 代码 · 共 30 行

CS
30
字号

    using System;

    /// <summary>
    ///   A BankTransaction is created every time a deposit or withdrawal occurs on a BankAccount
    ///   A BankTransaction records the amount of money involved, together with the current date and time.
    /// </summary>
    public class BankTransaction
    {
		private readonly decimal amount;
		private readonly DateTime when;

        public BankTransaction(decimal tranAmount)
	    {
		   amount = tranAmount;
		   when = DateTime.Now;
	    }

		public decimal Amount()
		{
			return amount;
		}

		public DateTime When()
		{
			return when;
		}			 
    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?