public TokenMachine(decimal dayPassPrice) { _dayPassPrice = dayPassPrice; _paymentList = new PaymentList(); _ticket = null; _card = null; _reader = null; _anAccount = 0; }
/// <summary> /// A constructor for the CustomerAccount class that takes all the attributes as parameters /// </summary> /// <param name="cardId">Smart card ID</param> /// <param name="balance">Balance in the accunt</param> /// <param name="accountId">accountID of the Account class</param> /// <param name="username">username of the Account class</param> /// <param name="password">password of the Account class</param> /// <param name="fullName">fullname of the Account class</param> /// <param name="loginStatus">loginStatus of the Account class</param> public CustomerAccount(int cardId, decimal balance, int accountId, string username, string password, string fullName, bool loginStatus) : base(accountId, username, password, fullName, loginStatus) { _cardId = cardId; _balance = balance; _savedPaymentMethods = new List <PaymentCard>(); _JourneyList = new JourneyList(); _paymentList = new PaymentList(); _transactionList = new List <PaymentList>(); _freeTravel = false; }
/// <summary> /// Adds a new payment list to the transaction list. Creates a new transaction list if one doesn't exist /// </summary> /// <param name="transaction">Transaction to be added to the transaction list</param> public void AddTransaction(PaymentList transaction) { if (_transactionList == null) { _transactionList = new List <PaymentList>(); } _transactionList.Add(transaction); new AccountList(false).UpdateAccount(this); }
protected void moneyButtonClick(object sender, EventArgs e) { Button button = sender as Button; PaymentList result = _machine.MakeCashPayment(decimal.Parse(_totalPrice), decimal.Parse(button.Text.Substring(1)), _due); if (result != null) { DialogResult = DialogResult.OK; Close(); } }
/// <summary> /// Constructor used for updating account in the file /// </summary> /// <param name="id">Account ID of the account being updated</param> public CustomerAccount(int id) { var temp = new AccountList(false).GetAccountById(id); _cardId = temp._cardId; _balance = temp._balance; _savedPaymentMethods = temp._savedPaymentMethods; _JourneyList = temp._JourneyList; _paymentList = temp._paymentList; _transactionList = temp._transactionList; _endStation = temp._endStation; _startStation = temp._startStation; _loginStatus = temp._loginStatus; _accountId = temp._accountId; _fullName = temp._fullName; _password = temp._password; _username = temp._username; }
public void Reset() { _paymentList = null; }