/// <summary>
        /// Initializes a new instance of the <see cref="BankAccount"/> class.
        /// Constructor of the class.
        /// </summary>
        /// <param name="firstName">First name of the owner of the account.</param>
        /// <param name="lastName">Last name of the owner of the account.</param>
        /// <param name="billNumber">The number of the bill.</param>
        /// <param name="billBalance">The balance of the bill.</param>
        /// <param name="typeOfBill">Type of the bill.</param>
        public BankAccount(string firstName, string lastName, long billNumber, decimal billBalance, TypeOfBill typeOfBill)
        {
            this.owner = new OwnerInfo()
            {
                FirstName = firstName, LastName = lastName
            };
            if (billNumber.ToString().Length != 16)
            {
                throw new ArgumentException("Bill number should contain 16 digits.");
            }
            else
            {
                this.billNumber = billNumber;
            }

            if (billBalance < 0)
            {
                throw new ArgumentException("Bill balance can't be less than zero.");
            }
            else
            {
                this.bills.Add(billBalance);
            }

            this.type     = typeOfBill;
            this.isClosed = IsClosed.Open;
            this.billStorage.AddBillToStorage(this);
        }
Пример #2
0
 public int GeneratePlus(TypeOfBill type)
 {
     return(type.CostOfBalance * 2);
 }
Пример #3
0
 public int GenerateMinus(TypeOfBill type)
 {
     return(type.RefillOfBalance * 3);
 }