public virtual void LoadAp() { int KhabarovskStation = 4; DateTime currDate = DateTime.Now; DateTime startDate = new DateTime(currDate.Year, currDate.Month, 1); DateTime endDate = new DateTime(currDate.Year, currDate.Month, DateTime.DaysInMonth(currDate.Year, currDate.Month)); List <CodeUmagf> theUmagfList = (List <CodeUmagf>)CodeUmagf.GetByPeriod(KhabarovskStation, startDate, endDate); for (int i = 1; i <= endDate.Day; i++) { CodeUmagf theCode = null; if (theUmagfList.Count(x => x.DD == i) > 0) { theCode = theUmagfList.First(x => x.DD == i); } else { theCode = new CodeUmagf(); theCode.ak = 1000; theCode.DD = i; theCode.MM = currDate.Month; theCode.YYYY = currDate.Year; } this.theListCodeUmagf.Add(theCode); } }
public static IList <CodeUmagf> GetByPeriod(int station, DateTime dateStart, DateTime dateEnd) { return(CodeUmagf.GetByPeriod(station, dateStart.Year, dateStart.Month, dateStart.Day, dateEnd.Year, dateEnd.Month, dateEnd.Day)); }