Exemple #1
0
 private void SetupLotteryWinningAmtFields()
 {
     cmbLWPAGameMode.Items.Clear();
     cmbLWPAGameMode.Items.AddRange(lotteryDataServices.GetLotteries().ToArray());
     if (cmbLWPAGameMode.Items.Count > 0)
     {
         cmbLWPAGameMode.SelectedItem = cmbLWPAGameMode.Items[0];
     }
 }
Exemple #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);
        }
Exemple #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);
        }
Exemple #4
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);
        }
Exemple #5
0
        private List <DashboardReportItemSetup> GetLotteryBetsInQueue()
        {
            List <DashboardReportItemSetup> itemsList = new List <DashboardReportItemSetup>();
            LotteryDetails lotteryDetails             = LotteryDataServices.LotteryDetails;

            foreach (Lottery lottery in LotteryDataServices.GetLotteries())
            {
                if (lotteryDetails.GameMode != lottery.GetGameMode())
                {
                    List <LotteryBet> lotteryBetList = LotteryDataServices.GetLotterybetsQueued(lottery.GetGameMode());
                    if (lotteryBetList.Count <= 0)
                    {
                        continue;
                    }
                    foreach (LotteryBet bet in lotteryBetList)
                    {
                        String key   = DateTimeConverterUtils.ConvertToFormat(bet.GetTargetDrawDate(), DateTimeConverterUtils.STANDARD_DATE_FORMAT_WITH_DAYOFWEEK);
                        String value = bet.GetGNUFormat();
                        DashboardReportItemSetup dshSetup = GenModel(key, value);
                        dshSetup.DashboardReportItemAction = DashboardReportItemActions.OPEN_LOTTERY_GAME;
                        dshSetup.Tag            = lottery.GetGameMode();
                        dshSetup.GroupTaskLabel = ResourcesUtils.GetMessage("drpt_lot_bet_group_lbl_task");
                        dshSetup.GroupKeyName   = ResourcesUtils.GetMessage("drpt_lot_bet_group_lbl", lottery.GetDescription(), lotteryBetList.Count.ToString());
                        dshSetup.ReportItemDecoration.IsHyperLink = true;
                        itemsList.Add(dshSetup);
                    }
                }
            }
            return(itemsList);
        }