private Dictionary <string, string> GetSessionBasedParameters(LotteryDetails lotteryDetails, IHtmlDocument documentPreLoading)
        {
            Dictionary <string, string> parameters = GenerateParameters(lotteryDetails);

            IEnumerable <IElement> tableElement = null;

            string[] queryParamName = new string[] { "__EVENTTARGET", "__EVENTARGUMENT",
                                                     "__VIEWSTATE", "__VIEWSTATEGENERATOR", "__EVENTVALIDATION" };

            foreach (String query in queryParamName)
            {
                tableElement = documentPreLoading.All.Where(x => x.NodeName.Equals("Input", StringComparison.OrdinalIgnoreCase) &&
                                                            x.Id.Equals(query, StringComparison.OrdinalIgnoreCase));
                if (tableElement.Any())
                {
                    foreach (IElement element in tableElement)
                    {
                        parameters.Add(query, element.GetAttribute("value"));
                        break;
                    }
                }
                else
                {
                    parameters.Add(query, "");
                }
            }

            return(parameters);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initialization function, we put our initialization code here as this fires when the page loads.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            //Read the csv file stored along with the code. This implementation would change if the data source was dynamically changing
            string[] str = File.ReadAllLines(Server.MapPath("649.csv"));

            //Parse the csv file by splitting strings using comma as delimiter
            for (int i = 1; i < str.Length; i++)
            {
                string[] temp = str[i].Split(',');
                //Only consider draws where seq numbers was 0
                if (Convert.ToInt32(temp[2]) == 0)
                {
                    var tempLotteryDeets = new LotteryDetails
                    {
                        drawNumber     = Convert.ToInt32(temp[1]),
                        date           = DateTime.Parse(temp[3].Replace("\"", "")),
                        winningNumbers = new List <int>()
                        {
                            Convert.ToInt32(temp[4]), Convert.ToInt32(temp[5]), Convert.ToInt32(temp[6]), Convert.ToInt32(temp[7]), Convert.ToInt32(temp[8]), Convert.ToInt32(temp[9])
                        },
                        bonusNumber = Convert.ToInt32(temp[10])
                    };
                    //After parsing, save the lotter details into our
                    lotteryDetails.Add(tempLotteryDeets);
                }
            }
            //Save texboxes in a list for easy reference as well.
            textboxes = new List <TextBox>()
            {
                TextBox1, TextBox2, TextBox3, TextBox4, TextBox5, TextBox6
            };
        }
        private List <LotteryDrawResult> GetScrapeResults(LotteryDetails lotteryDetails, IHtmlDocument document)
        {
            List <LotteryDrawResult> lotteryDrawResultArr = new List <LotteryDrawResult>();
            IEnumerable <IElement>   tableElement         = null;

            tableElement = document.All.Where(x => x.ClassName == "Grid search-lotto-result-table" &&
                                              x.Id == "cphContainer_cpContent_GridView1");
            if (tableElement.Any())
            {
                IElement tbody = tableElement.First();
                foreach (INode node in tbody.ChildNodes)
                {
                    foreach (INode tr in node.ChildNodes.Skip(1))
                    {
                        INodeList tds = tr.ChildNodes;
                        LotteryDrawResultSetup setup = new LotteryDrawResultSetup();
                        if (tr.ChildNodes.Length >= 5)
                        {
                            setup.PutNumberSequence(tr.ChildNodes[2].TextContent);
                            setup.DrawDate   = DateTime.ParseExact(tr.ChildNodes[3].TextContent, "M/d/yyyy", CultureInfo.InvariantCulture);
                            setup.JackpotAmt = double.Parse(tr.ChildNodes[4].TextContent);
                            setup.Winners    = int.Parse(tr.ChildNodes[5].TextContent);
                            setup.GameCode   = lotteryDetails.GameCode;
                            lotteryDrawResultArr.Add(setup);
                        }
                    }
                }
            }
            return(lotteryDrawResultArr);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
 private void OpenLotteryGame(GameMode gameMode)
 {
     this.lotteryDetails = new LotteryDetails(gameMode);
     ReinitateLotteryServices();
     Application.DoEvents();
     InitializesFormContent();
     this.lotteryDataServices.SaveLastOpenedLottery();
 }
 public ReportDataServices(LotteryDetails lotteryDetails)
 {
     this.lotteryDetails        = lotteryDetails;
     this.lotteryDataDerivation = new LotteryDataDerivation(GameMode);
     this.lotteryTicketPanelDao = LotteryTicketPanelDaoImpl.GetInstance();
     this.lotteryOutletDao      = LotteryOutletDaoImpl.GetInstance();
     this.lotteryBetDao         = LotteryBetDaoImpl.GetInstance();
     this.userSettingDao        = UserSettingDaoImpl.GetInstance();
     this.lotteryScheduleDao    = LotteryScheduleDaoImpl.GetInstance();
     this.lotteryWinningBetDao  = LotteryWinningBetDaoImpl.GetInstance();
     this.lotteryDataWorker     = new LotteryDataWorker();
     this.lotteryDrawResultDao  = LotteryDrawResultDaoImpl.GetInstance();
 }
Ejemplo n.º 7
0
 public LotteryDataServices(LotteryDetails lotteryDetails)
 {
     this.lotteryDetails               = lotteryDetails;
     this.userSetting                  = new UserSettings();
     this.lotteryDataDerivation        = new LotteryDataDerivation(this.LotteryDetails.GameMode);
     this.lotteryTicketPanelDao        = LotteryTicketPanelDaoImpl.GetInstance();
     this.lotteryOutletDao             = LotteryOutletDaoImpl.GetInstance();
     this.lotteryBetDao                = LotteryBetDaoImpl.GetInstance();
     this.userSettingDao               = UserSettingDaoImpl.GetInstance();
     this.lotteryScheduleDao           = LotteryScheduleDaoImpl.GetInstance();
     this.lotteryWinningBetDao         = LotteryWinningBetDaoImpl.GetInstance();
     this.lotteryDataWorker            = new LotteryDataWorker();
     this.lotteryDrawResultDao         = LotteryDrawResultDaoImpl.GetInstance();
     this.lotterySeqGenDao             = LotterySequenceGenDaoImpl.GetInstance();
     this.lotteryWinningCombinationDao = LotteryWinningCombinationDaoImpl.GetInstance();
 }
        private Dictionary <string, string> GenerateParameters(LotteryDetails lotteryDetails)
        {
            var parameters = new Dictionary <string, string>
            {
                { "ctl00$ctl00$cphContainer$cpContent$ddlStartMonth", sinceWhenToScrape.ToString("MMMM") },                       //e.g. January
                { "ctl00$ctl00$cphContainer$cpContent$ddlStartDate", sinceWhenToScrape.ToString("d ").Trim() },                   //e.g. 1
                { "ctl00$ctl00$cphContainer$cpContent$ddlStartYear", sinceWhenToScrape.ToString("yyyy") },                        //e.g. 2021
                { "ctl00$ctl00$cphContainer$cpContent$ddlEndMonth", DateTime.Now.ToString("MMMM") },                              //e.g. January
                { "ctl00$ctl00$cphContainer$cpContent$ddlEndDay", DateTime.Now.ToString("d ").Trim() },                           // //e.g. 12
                { "ctl00$ctl00$cphContainer$cpContent$ddlEndYear", DateTime.Now.ToString("yyyy") },                               // //e.g. 2020
                { "ctl00$ctl00$cphContainer$cpContent$ddlSelectGame", lotteryDetails.Lottery.GetWebScrapeGameCode().ToString() }, //e.g. 18 for 6/58, refer to PCSO Website for the number
                { "ctl00$ctl00$cphContainer$cpContent$btnSearch", "Search+Lotto" },
                { "ctl00$ctl00$cphContainer$cpRightSidebar$TodaysNationalDraw$hSuspensionFrom", "2020/03/17" },
                { "ctl00$ctl00$cphContainer$cpRightSidebar$TodaysNationalDraw$hSuspensionTo", "2020/08/07" }
            };

            return(parameters);
        }
Ejemplo n.º 9
0
        private List <DashboardReportItemSetup> GetLotteryBetsCurrentMonth()
        {
            DateTime today = DateTime.Now;
            List <DashboardReportItemSetup> itemsList = new List <DashboardReportItemSetup>();
            LotteryDetails    lotteryDetails          = LotteryDataServices.LotteryDetails;
            List <LotteryBet> lotteryBetList          = LotteryDataServices.GetLotteryBetsByMonthy(lotteryDetails.GameMode, today.Year, today.Month);
            List <DateTime[]> weeklyRangeList         = DateTimeConverterUtils.GetWeeklyDateRange(today.Year, today.Month);

            int weekNumber = 1;

            foreach (DateTime[] weekRange in weeklyRangeList)
            {
                DateTime startDate = weekRange[0].AddDays(-1);//initially -1 to solve iteration problem below
                DateTime endDate   = weekRange[1];

                double sumAmount = 0;
                do
                {
                    startDate = startDate.AddDays(1);
                    foreach (LotteryBet bet in lotteryBetList)
                    {
                        if (bet.GetTargetDrawDate().Day == startDate.Day)
                        {
                            sumAmount += bet.GetBetAmount();
                        }
                    }
                } while (startDate.Day != endDate.Day);

                String key = ResourcesUtils.GetMessage("drpt_lot_bet_current_month_desc", weekNumber++.ToString(),
                                                       weekRange[0].ToString("MMM"), weekRange[0].ToString("dd"), weekRange[1].ToString("dd"));
                String value = sumAmount.ToString("C");
                DashboardReportItemSetup dshSetup = GenModel(key, value);
                dshSetup.GroupKeyName = ResourcesUtils.GetMessage("drpt_lot_bet_current_month_group_lbl",
                                                                  today.Year.ToString(), today.ToString("MMM"));
                if (sumAmount <= 0.00)
                {
                    dshSetup.ReportItemDecoration.FontColor = ReportItemDecoration.COLOR_NO_FOCUS;
                }

                itemsList.Add(dshSetup);
            }

            return(itemsList);
        }
        public void StartScraping(List <LotteryDetails> lotteriesDetailsArr)
        {
            this.lotteriesDetailsArr = lotteriesDetailsArr;
            LotteryDrawResultDao lotteryDao = LotteryDrawResultDaoImpl.GetInstance();

            try
            {
                foreach (LotteryDetails lotteryDetails in this.lotteriesDetailsArr)
                {
                    this.currentLotteryDetailsProcess = lotteryDetails;
                    RaiseEvent(LottoWebScrapingStages.INIT);
                    this.sinceWhenToScrape = lotteryDao.GetLatestDrawDate(lotteryDetails.GameMode);
                    ScrapeWebsite(lotteryDetails, GenerateParameters(lotteryDetails));
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 11
0
        public void PubThirdTable(HtmlDocument htmlDoc, lotterydetail lotterydetail, string gameCode)
        {
            var ThirdTablenode    = htmlDoc.DocumentNode.SelectNodes("//table[@class='kj_tablelist02']")[2];
            var ThirdTable_trnode = ThirdTablenode.SelectNodes("tr");
            int trIndex           = 1;

            foreach (HtmlNode item3 in ThirdTable_trnode)  //循环第二个table的tr
            {
                int lnode = ThirdTable_trnode.Count() + 1;

                if (2 < trIndex && trIndex < lnode)
                {
                    IEnumerable <HtmlNode> getTdList = item3.SelectNodes("td");
                    int tdIndex           = 1;
                    var jq4LotteryDetails = new LotteryDetails();
                    var ttcx4Detail       = new ttcx4Details();

                    foreach (var tdItem in getTdList)
                    {
                        switch (tdIndex)
                        {
                        case 1:
                            jq4LotteryDetails.openPrize = Regex.Replace(tdItem.InnerHtml, @"\s", "");
                            break;

                        case 2:
                            jq4LotteryDetails.openWinNumber = Regex.Replace(tdItem.InnerHtml, @"\s", "");
                            break;

                        case 3:
                            jq4LotteryDetails.openSingleBonus = Regex.Replace(tdItem.InnerHtml, @"\s", "");
                            break;
                        }
                        tdIndex = tdIndex + 1;
                    }
                    lotterydetail.openLotteryDetails.Add(jq4LotteryDetails);
                }
                trIndex = trIndex + 1;
            }
        }
        internal async void ScrapeWebsite(LotteryDetails lotteryDetails, Dictionary <string, string> parameters)
        {
            try
            {
                RaiseEvent(LottoWebScrapingStages.CONNECTING);
                IHtmlDocument documentForSession = await GetWebsiteDOMAsync(GenerateParameters(lotteryDetails));

                RaiseEvent(LottoWebScrapingStages.SESSION_CREATION);
                Dictionary <string, string> sessionParam = GetSessionBasedParameters(lotteryDetails, documentForSession);
                RaiseEvent(LottoWebScrapingStages.SEARCHING_DATA);
                IHtmlDocument document = await GetWebsiteDOMAsync(sessionParam);

                RaiseEvent(LottoWebScrapingStages.SCRAPING);
                List <LotteryDrawResult> lotteryDrawResultArr = GetScrapeResults(lotteryDetails, document);

                int countCtr = 1;
                LotteryDrawResultDao lotteryDao = LotteryDrawResultDaoImpl.GetInstance();
                foreach (LotteryDrawResult scrapeResult in lotteryDrawResultArr.ToList())
                {
                    LotteryDrawResult result = lotteryDao.GetLotteryDrawResultByDrawDate(lotteryDetails.GameMode, scrapeResult.GetDrawDate());
                    if (result == null && !scrapeResult.IsDrawResulSequenceEmpty())
                    {
                        newRecordsCount++;
                        lotteryDao.InsertDrawDate(scrapeResult);
                    }
                    RaiseEvent(LottoWebScrapingStages.INSERT, ConverterUtils.GetPercentageFloored(countCtr++, lotteryDrawResultArr.Count), scrapeResult.GetExtractedDrawnResultDetails());
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                RaiseEvent(LottoWebScrapingStages.ERROR, 0, ex.Message);
            }
            finally
            {
                RaiseEvent(LottoWebScrapingStages.FINISH);
            }
        }
Ejemplo n.º 13
0
        public async Task <int> LoadWin310LotteryDetal(string number)
        {
            int count = 0;
            List <lotterydetail> lotterydetails = new List <lotterydetail>();
            var    onode       = CommonHelper.LoadGziphtml(Url_310winKJ + "zucai/14changshengfucai/kaijiang_zc_" + number + ".html", CollectionUrlEnum.url_caike).DocumentNode.SelectSingleNode("//select[@id='dropIssueNum']").SelectNodes("option");
            var    node        = StNode(onode);
            string LotteryCode = ChangeLotteryCode(number);

            foreach (var item in node)
            {
                lotterydetail lotterydetail = new lotterydetail();
                var           htmlDoc       = CommonHelper.LoadGziphtml(Url_310winKJ + "Info/Result/Soccer.aspx?load=ajax&typeID=" + number + "&IssueID=" + item.Key, CollectionUrlEnum.url_caike);
                var           jObject       = JObject.Parse(htmlDoc.Text);
                lotterydetail.expect = jObject["IssueNum"].ToString().Remove(0, 2);


                var IssueNo = _ILotteryDetailService.GetIssue(lotterydetail.expect);
                if (IssueNo == null)
                {
                    break;
                }
                lotterydetail.Sys_IssueId = IssueNo.Id;
                lotterydetail.openTime    = jObject["AwardTime"].ToString();
                lotterydetail.endTime     = jObject["CashInStopTime"].ToString();
                lotterydetail.Url_Type    = (int)CollectionUrlEnum.url_caike;
                string Bottom = jObject["Bottom"].ToString();

                var oldIssueItem = _ILotteryDetailService.GetCodelotterydetail(LotteryCode, lotterydetail.expect);
                if (oldIssueItem != null)
                {
                    string CurrentSales = oldIssueItem.CurrentSales;
                    bool   tf           = NeedReGet(CurrentSales);
                    if (!tf)
                    {
                        continue;
                    }
                }

                lotterydetail.SalesVolume = String.Format("{0:N0}", Convert.ToInt32(Regex.Replace(Bottom.Split(',')[0].Split(':')[1], @"[^\d.\d]", ""))) + "元";
                if (LotteryCode == "sfc")
                {
                    lotterydetail.SalesVolume += "|" + String.Format("{0:N0}", Convert.ToInt32(Regex.Replace(Bottom.Split(',')[1].Split(',')[0].Split(':')[1], @"[^\d.\d]", ""))) + "元";
                    lotterydetail.PoolRolling  = String.Format("{0:N0}", Convert.ToInt32(Regex.Replace(Bottom.Split(',')[2].Split(':')[1], @"[^\d.\d]", ""))) + "元";
                }
                else
                {
                    lotterydetail.PoolRolling = String.Format("{0:N0}", Convert.ToInt32(Regex.Replace(Bottom.Split(',')[1].Split(':')[1], @"[^\d.\d]", ""))) + "元";
                }

                foreach (var list in jObject["Table"])
                {
                    var teams = new Team();
                    teams.TeamTitle = list["HomeTeam"].ToString() + "VS" + list["GuestTeam"].ToString();
                    teams.openTeam  = list["HomeTeam"].ToString();
                    if (LotteryCode == "zc6" || LotteryCode == "jq4")
                    {
                        teams.openCode = list["Result_1"].ToString();
                        if (LotteryCode == "zc6")
                        {
                            teams.halfull = "半";
                        }
                    }
                    else
                    {
                        teams.openCode = list["Result"].ToString();
                    }

                    lotterydetail.teams.Add(teams);

                    if (LotteryCode == "zc6" || LotteryCode == "jq4")
                    {
                        teams           = new Team();
                        teams.TeamTitle = list["HomeTeam"].ToString() + "VS" + list["GuestTeam"].ToString();
                        teams.openTeam  = list["HomeTeam"].ToString();
                        teams.openCode  = list["Result_2"].ToString();
                        if (LotteryCode == "zc6")
                        {
                            teams.halfull = "全";
                        }

                        lotterydetail.teams.Add(teams);
                    }
                }
                foreach (var list in jObject["Bonus"])
                {
                    var BonusLotteryDetails = new LotteryDetails();
                    BonusLotteryDetails.openPrize       = list["Grade"].ToString();
                    BonusLotteryDetails.openWinNumber   = list["BasicStakes"].ToString();
                    BonusLotteryDetails.openSingleBonus = String.Format("{0:N0}", Convert.ToInt32(Regex.Replace(list["BasicBonus"].ToString(), @"[^\d.\d]", "")));
                    lotterydetail.openLotteryDetails.Add(BonusLotteryDetails);
                }
                lotterydetails.Add(lotterydetail);
            }
            count = await _ILotteryDetailService.AddLotteryDetal(lotterydetails, LotteryCode);

            return(count);
        }
Ejemplo n.º 14
0
        public void PubSecondTable(HtmlDocument htmlDoc, lotterydetail lotterydetail, string gameCode)
        {
            var SecondTablenode    = htmlDoc.DocumentNode.SelectNodes("//table[@class='kj_tablelist02']")[1];
            var SecondTable_trnode = SecondTablenode.SelectNodes("tr");
            int trIndex            = 1;

            foreach (HtmlNode item3 in SecondTable_trnode)  //循环第二个table的tr
            {
                int lnode    = SecondTable_trnode.Count();
                int minLnode = 0;
                if (gameCode == "ttcx4")
                {
                    minLnode = 1;
                    lnode    = 3;
                }
                else if (gameCode == "pls" || gameCode == "sfc" || gameCode == "jq4" || gameCode == "zc6" || gameCode == "qxc" || gameCode == "plw" || gameCode == "qlc" || gameCode == "ssq")
                {
                    minLnode = 2;
                    lnode    = SecondTable_trnode.Count();
                }
                else
                {
                    minLnode = 2;
                    lnode    = SecondTable_trnode.Count() + 1;
                }
                if (minLnode < trIndex && trIndex < lnode)
                {
                    IEnumerable <HtmlNode> getTdList = item3.SelectNodes("td");
                    int tdIndex           = 1;
                    var jq4LotteryDetails = new LotteryDetails();
                    var ttcx4Detail       = new ttcx4Details();
                    if (gameCode == "ttcx4")
                    {
                        foreach (var tdItem in getTdList)
                        {
                            switch (tdIndex)
                            {
                            case 1:
                                ttcx4Detail.Betting = Regex.Replace(tdItem.InnerHtml, @"\s", "");
                                break;

                            case 2:
                                ttcx4Detail.openPrize = Regex.Replace(tdItem.InnerHtml, @"\s", "");
                                break;

                            case 3:
                                ttcx4Detail.openCode = Regex.Replace(tdItem.InnerHtml, @"\s", "");
                                break;

                            case 4:
                                ttcx4Detail.directlySelection = Regex.Replace(tdItem.InnerHtml, @"\s", "");
                                break;

                            case 5:
                                ttcx4Detail.GroupSelection24 = Regex.Replace(tdItem.InnerHtml, @"\s", "");
                                break;

                            case 6:
                                ttcx4Detail.GroupSelection12 = Regex.Replace(tdItem.InnerHtml, @"\s", "");
                                break;

                            case 7:
                                ttcx4Detail.GroupSelection6 = Regex.Replace(tdItem.InnerHtml, @"\s", "");
                                break;

                            case 8:
                                ttcx4Detail.GroupSelection4 = Regex.Replace(tdItem.InnerHtml, @"\s", "");
                                break;
                            }
                            tdIndex = tdIndex + 1;
                        }
                        lotterydetail.ttcx4Details.Add(ttcx4Detail);
                    }
                    else
                    {
                        foreach (var tdItem in getTdList)
                        {
                            switch (tdIndex)
                            {
                            case 1:
                                jq4LotteryDetails.openPrize = Regex.Replace(tdItem.InnerHtml, @"\s", "");
                                break;

                            case 2:
                                jq4LotteryDetails.openWinNumber = Regex.Replace(tdItem.InnerHtml, @"\s", "");
                                break;

                            case 3:
                                jq4LotteryDetails.openSingleBonus = Regex.Replace(tdItem.InnerHtml, @"\s", "");
                                break;
                            }
                            tdIndex = tdIndex + 1;
                        }
                    }
                    lotterydetail.openLotteryDetails.Add(jq4LotteryDetails);
                }
                trIndex = trIndex + 1;
            }
        }
Ejemplo n.º 15
0
        public static List <zc6> GetZc6ByRule(string urlNumber)
        {
            List <zc6> jq4Lists = new List <zc6>();

            if (Convert.ToInt32(urlNumber) > 18171)
            {
                var     html = "http://kaijiang.500.com/shtml/zc6/" + urlNumber + ".shtml";
                HtmlWeb web  = new HtmlWeb();
                CommonHelper.Gzip(web);
                var htmlDoc = web.Load(html);

                var firstTableNode    = htmlDoc.DocumentNode.SelectNodes("//table[@class='kj_tablelist02']")[0];
                var firstTable_trnode = firstTableNode.SelectNodes("tr");
                int k         = 1;
                zc6 jq4       = new zc6();
                var listTeams = new List <Team>();
                foreach (HtmlNode item in firstTable_trnode)  //循环第一个table的tr
                {
                    var zc6 = new zc6();
                    switch (k)
                    {
                    case 1:
                        var    Date     = item.SelectSingleNode("//span[@class='span_right']").InnerHtml;
                        string openTime = Date.Split(':')[1].Split('兑')[0];
                        string EndTime  = Date.Split(':')[2];

                        jq4.expect   = urlNumber;
                        jq4.openTime = openTime;
                        jq4.endTime  = EndTime;
                        jq4Lists.Add(jq4);
                        break;

                    case 2:

                        for (int i = 0; i < item.SelectNodes("td").Count; i++)
                        {
                            var teams = new Team();
                            teams.TeamTitle = item.SelectNodes("td")[i].Attributes["title"].Value.Replace("&nbsp;", "");
                            teams.openTeam  = item.SelectNodes("td")[i].InnerHtml;
                            listTeams.Add(teams);
                            listTeams.Add(teams);
                        }

                        break;

                    case 3:
                        for (int i = 0; i < item.SelectNodes("td").Count; i++)
                        {
                            listTeams[i].halfull = item.SelectNodes("td")[i].InnerHtml;
                        }
                        break;

                    case 4:
                        for (int i = 0; i < item.SelectNodes("td").Count; i++)
                        {
                            listTeams[i].openCode = item.SelectNodes("td")[i].SelectSingleNode("./span").InnerHtml;
                        }
                        break;

                    case 5:
                        //取列数据
                        IEnumerable <HtmlNode> getSpanList = item.SelectSingleNode("td").SelectNodes("span");
                        int spanNumber = 1;
                        foreach (var spanItem in getSpanList)
                        {
                            switch (spanNumber)
                            {
                            case 1:
                                jq4.SalesVolume = spanItem.InnerHtml;
                                break;

                            case 2:
                                jq4.PoolRolling = spanItem.InnerHtml;
                                break;
                            }
                            spanNumber = spanNumber + 1;
                        }
                        string SalesVolume = item.InnerHtml;
                        break;
                    }

                    k = k + 1;
                }
                var SecondTablenode    = htmlDoc.DocumentNode.SelectNodes("//table[@class='kj_tablelist02']")[1];
                var SecondTable_trnode = SecondTablenode.SelectNodes("tr");
                int trIndex            = 1;
                foreach (HtmlNode item in SecondTable_trnode)  //循环第二个table的tr
                {
                    int lnode = SecondTable_trnode.Count();
                    if (2 < trIndex && trIndex < lnode)
                    {
                        IEnumerable <HtmlNode> getTdList = item.SelectNodes("td");
                        int tdIndex           = 1;
                        var jq4LotteryDetails = new LotteryDetails();
                        foreach (var tdItem in getTdList)
                        {
                            switch (tdIndex)
                            {
                            case 1:
                                jq4LotteryDetails.openPrize = tdItem.InnerHtml;
                                break;

                            case 2:
                                jq4LotteryDetails.openWinNumber = tdItem.InnerHtml;
                                break;

                            case 3:
                                jq4LotteryDetails.openSingleBonus = tdItem.InnerHtml;
                                break;
                            }
                            tdIndex = tdIndex + 1;
                        }
                        foreach (var item3 in jq4Lists)
                        {
                            item3.openLotteryDetails.Add(jq4LotteryDetails);
                        }
                    }
                    trIndex = trIndex + 1;
                }
                jq4.teams.AddRange(listTeams);
            }
            return(jq4Lists);
        }
Ejemplo n.º 16
0
        public MainForm()
        {
            InitializeComponent();
            this.lotteryDetails         = GameFactory.GetPreviousOpenGameInstance();
            this.processingStatusLogFrm = new ProcessingStatusLogFrm();
            this.Text        = String.Format("{0} - {1}", ResourcesUtils.GetMessage("mainf_title"), AppSettings.GetAppVersionWithPrefix());
            this.label1.Text = ResourcesUtils.GetMessage("mainf_labels_1");
            this.label3.Text = ResourcesUtils.GetMessage("mainf_labels_2");
            this.label4.Text = ResourcesUtils.GetMessage("mainf_labels_3");
            this.label5.Text = ResourcesUtils.GetMessage("mainf_labels_4");

            this.toolStripProcessingLogs.Text = ResourcesUtils.GetMessage("mainf_labels_46");
            this.groupBox1.Text           = ResourcesUtils.GetMessage("mainf_labels_7");
            this.groupBox2.Text           = ResourcesUtils.GetMessage("mainf_labels_8");
            this.label2.Text              = ResourcesUtils.GetMessage("mainf_labels_9");
            this.label6.Text              = ResourcesUtils.GetMessage("mainf_labels_10");
            this.label7.Text              = ResourcesUtils.GetMessage("mainf_labels_47");
            this.label7.Text              = ResourcesUtils.GetMessage("mainf_labels_48");
            this.linkFilterGoBet.Text     = ResourcesUtils.GetMessage("mainf_labels_11");
            this.linkLabelFilterDraw.Text = ResourcesUtils.GetMessage("mainf_labels_12");

            this.fileToolStripMenuItem.Text     = ResourcesUtils.GetMessage("mainf_labels_13");
            this.ticketToolStripMenuItem.Text   = ResourcesUtils.GetMessage("mainf_labels_14");
            this.reportsToolStripMenuItem.Text  = ResourcesUtils.GetMessage("mainf_labels_15");
            this.settingsToolStripMenuItem.Text = ResourcesUtils.GetMessage("mainf_labels_16");
            this.othersToolStripMenuItem.Text   = ResourcesUtils.GetMessage("mainf_labels_17");

            this.openLotteryToolStripMenuItem.Text           = ResourcesUtils.GetMessage("mainf_labels_18");
            this.exitToolStripMenuItem.Text                  = ResourcesUtils.GetMessage("mainf_labels_19");
            this.seqGenToolStripMenuItem.Text                = ResourcesUtils.GetMessage("mainf_labels_20");
            this.addBetToolStripMenuItem.Text                = ResourcesUtils.GetMessage("mainf_labels_21");
            this.modifyBetToolStripMenuItem.Text             = ResourcesUtils.GetMessage("mainf_labels_22");
            this.modifyClaimStatusToolStripMenuItem.Text     = ResourcesUtils.GetMessage("mainf_labels_23");
            this.moveDrawDateToolStripMenuItem1.Text         = ResourcesUtils.GetMessage("mainf_labels_24");
            this.lossProfitToolStripMenuItem.Text            = ResourcesUtils.GetMessage("mainf_labels_25");
            this.lotterySettingToolStripMenuItem.Text        = ResourcesUtils.GetMessage("mainf_labels_26");
            this.checkWinningBetsToolStripMenuItem.Text      = ResourcesUtils.GetMessage("mainf_labels_27");
            this.checkLotteryUpdatesToolStripMenuItem.Text   = ResourcesUtils.GetMessage("mainf_labels_28");
            this.machineLearningToolStripMenuItem.Text       = ResourcesUtils.GetMessage("mainf_labels_29");
            this.aboutToolStripMenuItem1.Text                = ResourcesUtils.GetMessage("mainf_labels_30");
            this.toolStripBtnNewBet.ToolTipText              = ResourcesUtils.GetMessage("mainf_labels_31");
            this.toolStripBtnDefaultViewListing.ToolTipText  = ResourcesUtils.GetMessage("mainf_labels_32");
            this.toolStripBtnModifyBet.ToolTipText           = ResourcesUtils.GetMessage("mainf_labels_33");
            this.toolStripModifyClaimStatus.ToolTipText      = ResourcesUtils.GetMessage("mainf_labels_34");
            this.toolStripBtnMoveDrawDate.ToolTipText        = ResourcesUtils.GetMessage("mainf_labels_35");
            this.machineLearningToolStripButton2.ToolTipText = ResourcesUtils.GetMessage("mainf_labels_36");
            this.pickGeneratorToolStripButton2.ToolTipText   = ResourcesUtils.GetMessage("mainf_labels_37");
            this.toolStripBtnWinBets.ToolTipText             = ResourcesUtils.GetMessage("mainf_labels_38");
            this.toolStripBtnDownloadResults.ToolTipText     = ResourcesUtils.GetMessage("mainf_labels_39");

            this.tabPageBetFilter.Text  = ResourcesUtils.GetMessage("mainf_labels_49");
            this.tabPageDrawFilter.Text = ResourcesUtils.GetMessage("mainf_labels_50");

            this.LOG_STATUS_MODULE_NAME_WEBSCRAP       = ResourcesUtils.GetMessage("mainf_labels_51");
            this.LOG_STATUS_MODULE_NAME_GRID_CONTENT   = ResourcesUtils.GetMessage("mainf_labels_52");
            this.LOG_STATUS_MODULE_NAME_FIELD_DETAILS  = ResourcesUtils.GetMessage("mainf_labels_53");
            this.LOG_STATUS_MODULE_NAME_WINNING_BETS   = ResourcesUtils.GetMessage("mainf_labels_54");
            this.LOG_STATUS_MODULE_NAME_DRAWN_RESULT   = ResourcesUtils.GetMessage("mainf_labels_55");
            this.LOG_STATUS_MODULE_NAME_CLIPBOARD_COPY = ResourcesUtils.GetMessage("mainf_labels_56");
            this.LOG_STATUS_MODULE_NAME_APP_UPDATE     = ResourcesUtils.GetMessage("mainf_labels_58");

            AddProcessingStatusLogs(LOG_STATUS_MODULE_NAME_WEBSCRAP, ResourcesUtils.GetMessage("mainf_labels_5"));
            dashboardContentIndention = ResourcesUtils.DashboardReportGroupedContentIndention;
            ReinitateLotteryServices();
            GenerateLotteriesGameMenu();
            InitializesFormContent();
            RefreshSubscription();
            this.applicationUpdateProcessor = ApplicationUpdateProcessor.GetInstance();
            this.applicationUpdateProcessor.PatchingProcessingLogs += ApplicationUpdateProcessor_PatchingProcessingLogs;
            this.HandleCreated += MainForm_HandleCreated;
        }