private List <DashboardReportItemSetup> GetNextDrawDates() { List <DashboardReportItemSetup> itemsList = new List <DashboardReportItemSetup>(); int ctrDays = 14; LotterySchedule lotterySchedule = LotteryDataServices.GetLotterySchedule(); DateTime dateStartingTommorow = DateTime.Now.AddDays(1); int idxLabel = 1; for (int ctr = 1; ctr <= ctrDays; ctr++) { if (lotterySchedule.IsDrawDateMatchLotterySchedule(dateStartingTommorow)) { String key = String.Format("{0} ({1})", ResourcesUtils.GetMessage("drpt_next_lottery_sched"), idxLabel++); String value = DateTimeConverterUtils.ConvertToFormat(dateStartingTommorow, DateTimeConverterUtils.DATE_FORMAT_LONG); DashboardReportItemSetup itm2 = GenModel(key, value); itm2.GroupKeyName = ResourcesUtils.GetMessage("drpt_lottery_schedules"); itemsList.Add(itm2); } dateStartingTommorow = dateStartingTommorow.AddDays(1); } return(itemsList); }
private List <DashboardReportItemSetup> GetPreviousDrawDates() { List <DashboardReportItemSetup> itemsList = new List <DashboardReportItemSetup>(); int ctrDays = 14; LotterySchedule lotterySchedule = LotteryDataServices.GetLotterySchedule(); DateTime dateLastXDays = DateTime.Now.AddDays(-ctrDays); int idxLabel = 1; //for one week schedule only for (int ctr = 1; ctr <= ctrDays; ctr++) { if (lotterySchedule.IsDrawDateMatchLotterySchedule(dateLastXDays)) { String key = String.Format("{0} ({1})", ResourcesUtils.GetMessage("drpt_prev_lottery_sched"), idxLabel++); String value = DateTimeConverterUtils.ConvertToFormat(dateLastXDays, DateTimeConverterUtils.DATE_FORMAT_LONG); DashboardReportItemSetup dshSetup = GenModel(key, value); dshSetup.ReportItemDecoration.FontColor = ReportItemDecoration.COLOR_NO_FOCUS; dshSetup.GroupKeyName = ResourcesUtils.GetMessage("drpt_lottery_schedules"); itemsList.Add(dshSetup); } dateLastXDays = dateLastXDays.AddDays(1); } return(itemsList); }