public Account GetOrCreateAccount(RealmsRecord record, Department currentDepartment) { var account = Accounts.SingleOrDefault(a => a.Name == record.Account.Trim()); if (account == null) { return(new Account(record, currentDepartment)); } return(account); }
// Ctor public Account(RealmsRecord record, Department department) { Name = record.Account.Trim(); Department = department; Department.Accounts.Add(this); Actuals = new List <double> (); Budgets = new List <double> (); Variances = new List <double> (); }