/// <summary> /// The Save method first checks whether the current object exists already in the /// internal data structure, if not it will add the object. /// </summary> public Boolean Save() { if (this.transactionID > 0) { return(DataTransaction.Update(this) > 0); } else { this.transactionID = DataTransaction.Add(this); return(this.transactionID > 0); } }
/// <summary> /// The static Add method interacts with the DataLayer in order to /// add a received object to the internal structure. /// </summary> /// <param name="transaction">The transaction object that you want to add</param> public static void Add(Transaction transaction) { DataTransaction.Add(transaction); }