Beispiel #1
0
        public void FillData(string url, long id, long matchid, string bookies, int count)
        {
            OddsCheckerCrawler crawlcheck = MdiParent as OddsCheckerCrawler;

            try
            {
                CrawlEachMarket crawl = new CrawlEachMarket();
                // string msg = crawl.DeleteMarketOdds(id);
                //  crawl.CrawlMarkets(url, id, matchid);

                DataGridView dataGridView1 = new DataGridView();
                DataTable    dt            = crawl.CrawlMarkets(url, id, matchid, bookies).Tables[0];
                DataRow      newrow        = dt.NewRow();
                dt.Rows.InsertAt(newrow, dt.Rows.Count);
                dataGridView1.DataSource = dt;
                //dataGridView1.DataSource = crawl.GetMarketOdds(id, bookies);
                dataGridView1.AutoSizeColumnsMode         = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
                dataGridView1.AutoSizeRowsMode            = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
                dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
                //dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
                //dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
                dataGridView1.AllowUserToDeleteRows = false;
                dataGridView1.AllowUserToAddRows    = false;
                dataGridView1.BackgroundColor       = SystemColors.ControlLightLight;
                dataGridView1.BorderStyle           = BorderStyle.None;
                dataGridView1.RowHeadersVisible     = false;

                dataGridView1.CellDoubleClick     += dataGridView1_CellDoubleClick;
                dataGridView1.CellValueChanged    += dataGridView1_CellValueChanged;
                dataGridView1.DataBindingComplete += dataGridView1_DataBindingComplete;
                dataGridView1.Width = flowLayoutPanel1.Width - 30;
                dataGridView1.Name  = Convert.ToString(id) + "," + Convert.ToString(matchid);
                //dataGridView1.Anchor = AnchorStyles.Bottom | AnchorStyles.Top;
                if (InvokeRequired)
                {
                    Action a = () =>
                    {
                        flowLayoutPanel1.Controls.Add(dataGridView1);
                        countthread++;
                        if (countthread.Equals(count))
                        {
                            crawlcheck.SetProgress(false);
                            crawlcheck.IsCouponProcessRunning = false;
                        }
                    };
                    BeginInvoke(a);
                }
            }
            catch (Exception ex)
            {
                if (InvokeRequired)
                {
                    Action b = () =>
                    {
                        crawlcheck.SetProgress(false);
                        crawlcheck.IsProcessRunning = false;
                    }; BeginInvoke(b);
                }
            }
        }
        protected void FillData(string link, long id, long matchid)
        {
            CrawlEachMarket crawl = new CrawlEachMarket();
            string msg = crawl.DeleteMarketOdds(id);
            crawl.CrawlMarkets(link, id, matchid);
            dataGridView1.DataSource = crawl.GetMarketOdds(id);
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                row.Cells[0].Value = String.Empty;
            }
            //int totalRowHeight = dataGridView1.ColumnHeadersHeight;

            //foreach (DataGridViewRow row in dataGridView1.Rows)
            //    totalRowHeight += row.Height+5;

            //dataGridView1.Height = totalRowHeight;
            //this.Height = dataGridView1.Height + 100;
        }
Beispiel #3
0
        protected void FillData(string link, long id, long matchid)
        {
            CrawlEachMarket crawl = new CrawlEachMarket();
            string          msg   = crawl.DeleteMarketOdds(id);

            crawl.CrawlMarkets(link, id, matchid);
            dataGridView1.DataSource = crawl.GetMarketOdds(id);
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                row.Cells[0].Value = String.Empty;
            }
            //int totalRowHeight = dataGridView1.ColumnHeadersHeight;

            //foreach (DataGridViewRow row in dataGridView1.Rows)
            //    totalRowHeight += row.Height+5;

            //dataGridView1.Height = totalRowHeight;
            //this.Height = dataGridView1.Height + 100;
        }
Beispiel #4
0
        public void FillData2(string url, long id, long goflid, string bookies, int count)
        {
            OddsCheckerCrawler crawlcheck = MdiParent as OddsCheckerCrawler;

            try
            {
                CrawlEachMarket crawl = new CrawlEachMarket();

                DataGridView dataGridView1 = new DataGridView();
                DataTable    dt            = crawl.CrawlMarkets(url, id, goflid, bookies).Tables[0];
                DataRow      newrow        = dt.NewRow();
                dt.Rows.InsertAt(newrow, dt.Rows.Count);
                dataGridView1.DataSource                  = dt;
                dataGridView1.AutoSizeColumnsMode         = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
                dataGridView1.AutoSizeRowsMode            = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
                dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
                //dataGridView1.ColumnHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.False;
                //dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
                //dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
                dataGridView1.AllowUserToDeleteRows = false;
                dataGridView1.AllowUserToAddRows    = false;
                dataGridView1.BackgroundColor       = SystemColors.ControlLightLight;
                dataGridView1.BorderStyle           = BorderStyle.None;
                dataGridView1.RowHeadersVisible     = false;
                //dataGridView1.AutoResizeRows(DataGridViewAutoSizeRowsMode.AllCells);
                dataGridView1.CellDoubleClick     += dataGridView1_CellDoubleClick;
                dataGridView1.DataBindingComplete += dataGridView1_DataBindingComplete;
                //dataGridView1.CellClick += dataGridView1_CellClick;
                dataGridView1.CellValueChanged += dataGridView1_CellValueChanged;
                //dataGridView1.Width = flowLayoutPanel1.Width - 30;
                dataGridView1.Name = Convert.ToString(id) + "," + Convert.ToString(goflid);
                // dataGridView1.Anchor = AnchorStyles.Bottom | AnchorStyles.Top;

                if (InvokeRequired)
                {
                    Action a = () =>
                    {
                        //if (!matchid.Equals(match_id))
                        if (!flowLayoutPanel1.Controls.ContainsKey(goflid.ToString()))
                        {
                            CrawlFirstPage crawlpage = new CrawlFirstPage();
                            DataTable      dt1       = crawlpage.GetMatchInfo(goflid);
                            GroupBox       grpBox    = new GroupBox();
                            string         match     = Convert.ToString(dt1.Rows[0]["Name"]) + " (" + Convert.ToString(dt1.Rows[0]["MatchDate"]) + ")";
                            grpBox.Text     = match;
                            grpBox.Name     = goflid.ToString();
                            grpBox.AutoSize = true;
                            FlowLayoutPanel flowpanel = new FlowLayoutPanel();
                            flowpanel.FlowDirection = FlowDirection.TopDown;
                            flowpanel.Dock          = DockStyle.Fill;
                            flowpanel.WrapContents  = false;
                            flowpanel.AutoSize      = true;
                            flowpanel.Name          = goflid.ToString() + goflid.ToString();
                            grpBox.Controls.Add(flowpanel);
                            flowLayoutPanel1.Controls.Add(grpBox);
                            grpBox.Anchor = AnchorStyles.Left | AnchorStyles.Right;

                            //grpBox.Anchor = AnchorStyles.Left | AnchorStyles.Right;
                        }

                        FlowLayoutPanel panel = flowLayoutPanel1.Controls.Find(goflid.ToString() + goflid.ToString(), true).FirstOrDefault() as FlowLayoutPanel;
                        panel.Controls.Add(dataGridView1);
                        countthread++;
                        if (countthread.Equals(count))
                        {
                            crawlcheck.SetProgress(false);
                            crawlcheck.IsProcessRunning = false;
                        }
                    };
                    BeginInvoke(a);
                }
            }
            catch (Exception ex)
            {
                if (InvokeRequired)
                {
                    Action b = () =>
                    {
                        crawlcheck.SetProgress(false);
                        crawlcheck.IsProcessRunning = false;
                    }; BeginInvoke(b);
                }
            }
        }
        public void FillData(string url, long id, long matchid,string bookies,int count)
        {
            OddsCheckerCrawler crawlcheck = MdiParent as OddsCheckerCrawler;
            
            try
            {
                CrawlEachMarket crawl = new CrawlEachMarket();
                //string msg = crawl.DeleteMarketOdds(id);
                //crawl.CrawlMarkets(url, id, matchid);

                DataGridView dataGridView1 = new DataGridView();
                DataTable dt = crawl.CrawlMarkets(url, id, matchid, bookies).Tables[0];
                DataRow newrow = dt.NewRow();
                dt.Rows.InsertAt(newrow, dt.Rows.Count);
                dataGridView1.DataSource = dt; 
                dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
                dataGridView1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
                dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
                //dataGridView1.ColumnHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.False;
                //dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
                //dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
                dataGridView1.AllowUserToDeleteRows = false;
                dataGridView1.AllowUserToAddRows = false;
                dataGridView1.BackgroundColor = SystemColors.ControlLightLight;
                dataGridView1.BorderStyle = BorderStyle.None;
                dataGridView1.RowHeadersVisible = false;
                //dataGridView1.AutoResizeRows(DataGridViewAutoSizeRowsMode.AllCells);
                dataGridView1.CellDoubleClick += dataGridView1_CellDoubleClick;
                dataGridView1.DataBindingComplete += dataGridView1_DataBindingComplete;
                //dataGridView1.CellClick += dataGridView1_CellClick;
                dataGridView1.CellValueChanged += dataGridView1_CellValueChanged;
                //dataGridView1.Width = flowLayoutPanel1.Width - 30;
                dataGridView1.Name = Convert.ToString(id) + "," + Convert.ToString(matchid);
               // dataGridView1.Anchor = AnchorStyles.Bottom | AnchorStyles.Top;

                if (InvokeRequired)
                {
                    Action a = () =>
                    {
                        //if (!matchid.Equals(match_id))
                        if (!flowLayoutPanel1.Controls.ContainsKey(matchid.ToString()))
                        {
                            CrawlFirstPage crawlpage = new CrawlFirstPage();
                            DataTable dt1 = crawlpage.GetMatchInfo(matchid);
                            GroupBox grpBox = new GroupBox();
                            string match = Convert.ToString(dt1.Rows[0]["Name"])+" ("+Convert.ToString(dt1.Rows[0]["MatchDate"])+")";
                            grpBox.Text = match;
                            grpBox.Name = matchid.ToString();
                            grpBox.AutoSize = true;
                            FlowLayoutPanel flowpanel = new FlowLayoutPanel();
                            flowpanel.FlowDirection = FlowDirection.TopDown;
                            flowpanel.Dock = DockStyle.Fill;
                            flowpanel.WrapContents = false;
                            flowpanel.AutoSize = true;
                            flowpanel.Name = matchid.ToString()+matchid.ToString();
                            grpBox.Controls.Add(flowpanel);
                            flowLayoutPanel1.Controls.Add(grpBox);
                            grpBox.Anchor = AnchorStyles.Left | AnchorStyles.Right;
                            
                            //grpBox.Anchor = AnchorStyles.Left | AnchorStyles.Right;
                        }

                        FlowLayoutPanel panel = flowLayoutPanel1.Controls.Find(matchid.ToString() + matchid.ToString(), true).FirstOrDefault() as FlowLayoutPanel;
                        panel.Controls.Add(dataGridView1);
                        countthread++;
                        if (countthread.Equals(count))
                        {
                            crawlcheck.SetProgress(false);
                            crawlcheck.IsProcessRunning = false;
                        }
                    };
                    BeginInvoke(a);
                }
            }
            catch (Exception ex)
            {
                if (InvokeRequired)
                {
                    Action b = () =>
                    {
                        crawlcheck.SetProgress(false);
                        crawlcheck.IsProcessRunning = false;
                    }; BeginInvoke(b);
                   
                }

            }
           
        }
        public void FillData(string url, long id, long matchid, string bookies, int count)
        {
            OddsCheckerCrawler crawlcheck = MdiParent as OddsCheckerCrawler;

            try
            {
                CrawlEachMarket crawl = new CrawlEachMarket();
                // string msg = crawl.DeleteMarketOdds(id);
                //  crawl.CrawlMarkets(url, id, matchid);

                DataGridView dataGridView1 = new DataGridView();
                DataTable dt = crawl.CrawlMarkets(url, id, matchid, bookies).Tables[0];
                DataRow newrow = dt.NewRow();
                dt.Rows.InsertAt(newrow, dt.Rows.Count);
                dataGridView1.DataSource = dt;
                //dataGridView1.DataSource = crawl.GetMarketOdds(id, bookies);
                dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
                dataGridView1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
                dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
                //dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
                //dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
                dataGridView1.AllowUserToDeleteRows = false;
                dataGridView1.AllowUserToAddRows = false;
                dataGridView1.BackgroundColor = SystemColors.ControlLightLight;
                dataGridView1.BorderStyle = BorderStyle.None;
                dataGridView1.RowHeadersVisible = false;

                dataGridView1.CellDoubleClick += dataGridView1_CellDoubleClick;
                dataGridView1.CellValueChanged += dataGridView1_CellValueChanged;
                dataGridView1.DataBindingComplete += dataGridView1_DataBindingComplete;
                dataGridView1.Width = flowLayoutPanel1.Width - 30;
                dataGridView1.Name = Convert.ToString(id) + "," + Convert.ToString(matchid);
                //dataGridView1.Anchor = AnchorStyles.Bottom | AnchorStyles.Top;
                if (InvokeRequired)
                {
                    Action a = () =>
                    {
                        flowLayoutPanel1.Controls.Add(dataGridView1);
                        countthread++;
                        if (countthread.Equals(count))
                        {

                            crawlcheck.SetProgress(false);
                            crawlcheck.IsCouponProcessRunning = false;

                        }
                    };
                    BeginInvoke(a);
                }
            }
            catch (Exception ex)
            {
                if (InvokeRequired)
                {
                    Action b = () =>
                    {
                        crawlcheck.SetProgress(false);
                        crawlcheck.IsProcessRunning = false;
                    }; BeginInvoke(b);
                }
            }

        }