Exemplo n.º 1
0
        private List <DashboardReportItemSetup> GetLatestDrawResultsJackpotPerLotteryGame()
        {
            List <DashboardReportItemSetup> itemsList         = new List <DashboardReportItemSetup>();
            List <LotteryDrawResult>        latestDrawResults = LotteryDataServices.GetLatestDrawResults();
            List <Lottery> lotteriesGameList = LotteryDataServices.GetLotteries();

            foreach (LotteryDrawResult draw in latestDrawResults)
            {
                if (draw == null)
                {
                    continue;
                }
                Lottery lottery    = lotteriesGameList.Find((lotteryObj) => (int)lotteryObj.GetGameMode() == draw.GetGameCode());
                String  valueLabel = "drpt_lot_draw_jackpot_winners_lbl";
                if (draw.GetWinnersCount() > 1)
                {
                    valueLabel += "_plural";
                }

                String key   = lottery.GetDescription();
                String value = (draw.HasWinners()) ?
                               ResourcesUtils.GetMessage(valueLabel,
                                                         draw.GetJackpotAmtFormatted(), draw.GetWinnersCount().ToString()) :
                               draw.GetJackpotAmtFormatted();
                DashboardReportItemSetup itm = GenModel(key, value);
                itm.GroupKeyName = ResourcesUtils.GetMessage("drpt_lot_draw_jackpot_lbl");
                itm.ReportItemDecoration.IsHyperLink = true;
                itm.DashboardReportItemAction        = DashboardReportItemActions.OPEN_LOTTERY_GAME;
                itm.Tag = lottery.GetGameMode();
                itemsList.Add(itm);
            }
            return(itemsList);
        }
Exemplo n.º 2
0
        private List <DashboardReportItemSetup> GetLotteriesNextBetDrawDate()
        {
            List <DashboardReportItemSetup> itemsList         = new List <DashboardReportItemSetup>();
            List <LotteryDrawResult>        latestDrawResults = LotteryDataServices.GetLatestDrawResults();
            List <Lottery> lotteriesGameList = LotteryDataServices.GetLotteries();

            foreach (Lottery lottery in lotteriesGameList)
            {
                if (lottery == null)
                {
                    continue;
                }
                LotteryDataServices lotteryDataServicesTMP = new LotteryDataServices(new LotteryDetails(lottery.GetGameMode()));
                String   valueLabel   = "drpt_lot_next_drawdate_per_lottery_value";
                DateTime nextDrawDate = lotteryDataServicesTMP.GetNextDrawDate();
                if (nextDrawDate.Date.CompareTo(DateTime.Now.Date) == 0)
                {
                    valueLabel += "_today";
                }

                String key   = lottery.GetDescription();
                String value = ResourcesUtils.GetMessage(valueLabel,
                                                         DateTimeConverterUtils.ConvertToFormat(nextDrawDate,
                                                                                                DateTimeConverterUtils.STANDARD_DATE_FORMAT_WITH_DAYOFWEEK));

                DashboardReportItemSetup itm = GenModel(key, value);
                itm.GroupKeyName = ResourcesUtils.GetMessage("drpt_lot_next_drawdate_per_lottery_lbl");
                itm.ReportItemDecoration.IsHyperLink = true;
                itm.DashboardReportItemAction        = DashboardReportItemActions.OPEN_LOTTERY_GAME;
                itm.Tag = lottery.GetGameMode();
                itemsList.Add(itm);
            }
            return(itemsList);
        }
Exemplo n.º 3
0
        private List <DashboardReportItemSetup> GetLatestDrawResultsPerLotteryGame()
        {
            List <DashboardReportItemSetup> itemsList         = new List <DashboardReportItemSetup>();
            List <LotteryDrawResult>        latestDrawResults = LotteryDataServices.GetLatestDrawResults();
            List <Lottery> lotteriesGameList = LotteryDataServices.GetLotteries();

            foreach (LotteryDrawResult draw in latestDrawResults)
            {
                if (draw == null)
                {
                    continue;
                }
                Lottery  lottery       = lotteriesGameList.Find((lotteryObj) => (int)lotteryObj.GetGameMode() == draw.GetGameCode());
                DateTime today         = DateTime.Now;
                TimeSpan diffWithToday = today - draw.GetDrawDate();
                String   key           = lottery.GetDescription();
                String   value         = ResourcesUtils.GetMessage("drpt_lot_draw_value",
                                                                   DateTimeConverterUtils.ConvertToFormat(draw.GetDrawDate(),
                                                                                                          DateTimeConverterUtils.STANDARD_DATE_FORMAT_WITH_DAYOFWEEK),
                                                                   ((int)diffWithToday.TotalDays).ToString());
                DashboardReportItemSetup itm = GenModel(key, value);
                itm.GroupKeyName = ResourcesUtils.GetMessage("drpt_lot_draw_group_lbl");
                itm.ReportItemDecoration.IsHyperLink = true;
                itm.DashboardReportItemAction        = DashboardReportItemActions.OPEN_LOTTERY_GAME;
                itm.Tag = lottery.GetGameMode();
                itemsList.Add(itm);
            }
            return(itemsList);
        }