public AppObjectList <PlanningRate> GetPlanningRates() { CalendarWeek CalWk = null; PlanningRate PlnRat = null; string sRatLst = null; int nPos = -1; //--- Get the planning rates sRatLst = GetItemFieldTextValue(FldName_RatLst); if (PlanningRates == null) { PlanningRates = new AppObjectList <PlanningRate>(); for (int nIdx = 0; nIdx < Application.GetCalendar().GetCalendarWeeks().Count; nIdx++) { CalWk = Application.GetCalendar().GetCalendarWeeks().GetAt(nIdx); nPos = nIdx * 4; PlnRat = new PlanningRate ( this, nPos < sRatLst.Length ? Int32.Parse(sRatLst.Substring(nPos, 3), NumberStyles.HexNumber) : 0, CalWk.OrderIndex ); PlanningRates.Add(PlnRat); } } return(PlanningRates); }
public AppObjectList <CalendarWeek> GetCalendarWeeks() { CalendarWeek CalWk = null; DateTime dtDay = Global.DateTimeNull; int nWkIdx = Global.IntegerNull; //--- Check calendar weeks not exist if (CalendarWeeks == null) { //--- Init the calendar weeks CalendarWeeks = new AppObjectList <CalendarWeek>(); //--- Init and add the calendar weeks for (dtDay = FirstPlanningDay, nWkIdx = 0; dtDay <= LastPlanningDay; dtDay = dtDay.AddDays(7), nWkIdx++) { //--- Init the calendar week and add to the calendar weeks CalWk = new CalendarWeek(this, dtDay, nWkIdx); CalendarWeeks.Add(CalWk); } } return(CalendarWeeks); }