public int GeneratePeriodId() { if (Periods.Count > 0) { return(Periods.Max(c => c.PeriodId) + 1); } return(1); }