public DateTime getRevBeginDate(DateTime EffDate) { HandicapSchedule HandicapSchedule = _context.HandicapSchedule.Where(r => r.Date < EffDate).OrderByDescending(r => r.Date).FirstOrDefault(); if (HandicapSchedule != null && HandicapSchedule.Date != null) { return(HandicapSchedule.Date.Date); } return(EffDate); }
public DateTime getNextEffDate() { DateTime currEffDate = DateTime.Today.Date; HandicapSchedule HandicapSchedule = _context.HandicapSchedule.Where(r => r.Date > currEffDate).OrderBy(r => r.Date).FirstOrDefault(); if (HandicapSchedule != null && HandicapSchedule.Date != null) { return(HandicapSchedule.Date); } return(currEffDate); }
public DateTime getNextDate(int GhinNumber) { DateTime maxDate = DateTime.Today.Date; var Handicap = _context.Handicap.Where(r => r.GhinNumber == GhinNumber).OrderByDescending(r => r.Date).FirstOrDefault(); if (Handicap != null) { maxDate = Handicap.Date.Date; } HandicapSchedule HandicapSchedule = _context.HandicapSchedule.Where(r => r.Date > maxDate).OrderBy(r => r.Date).FirstOrDefault(); if (HandicapSchedule != null && HandicapSchedule.Date != null) { return(HandicapSchedule.Date); } return(maxDate); }