예제 #1
0
        private void LoadTreeView(long matchid,string couponid)
        {
            GenerateCoupon coupon = new GenerateCoupon();
            DataTable dt = coupon.GetAvailableMarkets(matchid, couponid).Tables[0];
            TreeNode tnmarket = new TreeNode("Available Markets");
            foreach (DataRow row in dt.Rows)
            {
                TreeNode tn_market = new TreeNode(row["bettingmarket"].ToString());
                tn_market.Name = row["id"].ToString() + "," + row["matchid"].ToString() + "," + row["bettinglink"].ToString(); // +"," + row["couponid"].ToString(); ;
                tnmarket.Nodes.Add(tn_market);
            }

            treeView1.Nodes.Add(tnmarket);
        }
예제 #2
0
 private void btnaddmarket_Click(object sender, EventArgs e)
 {
     if (flowLayoutPanel1.Controls.Count > 0)
     {
         long matchid = Convert.ToInt64(txtmatchdate.Name);
         string couponid = lblmatchnotset.Name;
         GenerateCoupon coupon = new GenerateCoupon();
         DataSet ds = coupon.GetAvailableMarkets(matchid, couponid);
         if (ds.Tables[0].Rows.Count > 0)
         {
             Form childForm = new AddMarket(matchid, couponid);
             childForm.MdiParent = this.MdiParent;
             //childForm.Text = "Window " + childFormNumber++;
             childForm.Show();
         }
         else
         {
             MessageBox.Show("All markets are priced");
         }
     }
     else
     {
         MessageBox.Show("Data not available!");
     }
 }