public void setTransactionCategory(transactionCategory category) { if (category.Equals(this.category)) { return; } this.category = category; changed = true; }
// Constructor for reinstantiation public Transaction(long TID, long accountID, long SGID, string transactionName, decimal amount, DateTime dateTransactionMade, DateTime dateTransactionEntered, bool isExpense, transactionCategory category) { this.TID = TID; this.accountID = accountID; this.SGID = SGID; this.transactionName = transactionName; this.amount = amount; this.dateTransactionMade = dateTransactionMade; this.isExpense = isExpense; this.category = category; this.dateTransactionEntered = dateTransactionEntered; this.newlyCreated = false; }
//Constructor public Transaction(long TID, long accountID, long SGID, string transactionName, decimal amount, DateTime dateTransactionMade, bool isExpense, transactionCategory category) { this.TID = TID; this.accountID = accountID; this.SGID = SGID; this.transactionName = transactionName; this.amount = amount; this.dateTransactionMade = dateTransactionMade; this.isExpense = isExpense; this.category = category; //Assign the current time using the DateTime library method Now. dateTransactionEntered = DateTime.Now; newlyCreated = true; }