private void BindData()
    {
        if (ddlLottery.Items.Count < 1)
        {
            return;
        }

        DataTable dt = new DAL.Views.V_SchemeSchedules().Open("", "LotteryID = " + Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue) + " and Schedule >= 100 and QuashStatus = 0 and Buyed = 0 and EndTime < GetDate() and not [ID] in (select SchemeID from T_SchemesSendToCenter where HandleResult <> 1)", "[Money] desc");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);

            return;
        }

        dt.Columns.Add("LocateWaysAndMultiples", System.Type.GetType("System.String"));

        string BuyContent = "";
        string CnLocateWaysAndMultiples = "";

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            dt.Rows[i]["Money"] = double.Parse(dt.Rows[i]["Money"].ToString()).ToString("N");

            if (new SZJS.Lottery()[SZJS.Lottery.ZCDC.sID].CheckPlayType(int.Parse(dt.Rows[i]["PlayTypeID"].ToString())))
            {
                dt.Rows[i]["Multiple"] = 0;

                try
                {
                    BuyContent = "";
                    CnLocateWaysAndMultiples = "";

                    if (new SZJS.Lottery()[SZJS.Lottery.ZCDC.sID].GetSchemeSplit(dt.Rows[i]["LotteryNumber"].ToString(), ref BuyContent, ref CnLocateWaysAndMultiples))
                    {
                        dt.Rows[i]["LocateWaysAndMultiples"] = CnLocateWaysAndMultiples;
                    }
                    else
                    {
                        dt.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                    }
                }
                catch
                {
                    dt.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                }
            }

            dt.AcceptChanges();
        }

        g.DataSource = dt;
        g.DataBind();
    }
Beispiel #2
0
    private void BindData()
    {
        if (ddlLottery.Items.Count < 1)
        {
            return;
        }

        string Condition = "LotteryID = " + Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue) + " and QuashStatus = 0 and Buyed = 0 and isOpened = 0";

        if (tbQuash.Text.Trim() != "")
        {
            if (rb1.Checked)
            {
                Condition += " and SchemeNumber = '" + Shove._Web.Utility.FilteSqlInfusion(tbQuash.Text.Trim()) + "'";
            }
            else
            {
                Condition += " and InitiateName = '" + Shove._Web.Utility.FilteSqlInfusion(tbQuash.Text.Trim()) + "'";
            }
        }

        DataTable dt = new DAL.Views.V_SchemeSchedules().Open("", Condition, "[Money] desc");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_SchemeQuash");

            return;
        }
        
        dt.Columns.Add("LocateWaysAndMultiples", System.Type.GetType("System.String"));

        string BuyContent = "";
        string CnLocateWaysAndMultiples = "";

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            dt.Rows[i]["Money"] = double.Parse(dt.Rows[i]["Money"].ToString()).ToString("N");

            if (new SLS.Lottery()[SLS.Lottery.ZCDC.sID].CheckPlayType(int.Parse(dt.Rows[i]["PlayTypeID"].ToString())))
            {
                dt.Rows[i]["Multiple"] = 0;

                try
                {
                    BuyContent = "";
                    CnLocateWaysAndMultiples = "";

                    if (new SLS.Lottery()[SLS.Lottery.ZCDC.sID].GetSchemeSplit(dt.Rows[i]["LotteryNumber"].ToString(), ref BuyContent, ref CnLocateWaysAndMultiples))
                    {
                        dt.Rows[i]["LocateWaysAndMultiples"] = CnLocateWaysAndMultiples;
                    }
                    else
                    {
                        dt.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                    }
                }
                catch
                {
                    dt.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                }
            }
            else if (Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue) == "72" || Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue) == "73")
            {
                dt.Rows[i]["LotteryNumber"] = "查看详细信息";
            }

            dt.AcceptChanges();
        }

        g.DataSource = dt;
        g.DataBind();
    }
Beispiel #3
0
    private void BindData()
    {
        if (ddlIsuse.Items.Count < 1)
        {
            return;
        }

        string SQL = "";

        if (ddlType.Visible)
        {
            if (ddlType.SelectedValue == "金额")
            {
                SQL = "Money desc ";
            }
            else if (ddlType.SelectedValue == "过关方式")
            {
                SQL = "PlayTypeID desc ";
            }
            else if (ddlType.SelectedValue == "时间")
            {
                SQL = "SystemEndTime desc ";
            }
        }

        DataTable dt = new DAL.Views.V_SchemeSchedules().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue) + " and Schedule >= 100 and QuashStatus = 0 and Buyed = 0 and isOpened = 0", "[Money] desc");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_PrintOutput");

            return;
        }

        if (ddlLottery.SelectedValue == "72")
        {
            DataTable dtMatch = new DAL.Tables.T_PassRate().Open("", "", "");
            DataRow[] dr      = null;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i]["Money"] = double.Parse(dt.Rows[i]["Money"].ToString()).ToString("N");

                if (dt.Rows[i]["LotteryNumber"].ToString().IndexOf("A0") >= 0)
                {
                    dt.Rows[i]["PlayTypeName"] = dt.Rows[i]["PlayTypeName"].ToString() + "**" + "单关";
                }
                else
                {
                    dt.Rows[i]["PlayTypeName"] = dt.Rows[i]["PlayTypeName"].ToString() + "**" + "过关";
                }

                string str = dt.Rows[i]["LotteryNumber"].ToString();

                if (string.IsNullOrEmpty(str))
                {
                    continue;
                }

                string   Number  = str.Split(';')[1].Replace("][", "|").Substring(1, str.Split(';')[1].Length - 2);
                string[] Numbers = Number.Split('|');
                string   MatchID = "";

                for (int j = 0; j < Numbers.Length; j++)
                {
                    if (Numbers[j].IndexOf("(") < 0)
                    {
                        continue;
                    }

                    MatchID += Shove._Convert.StrToLong(Numbers[j].Substring(0, Numbers[j].IndexOf("(")), 1).ToString() + ",";
                }

                if (MatchID.EndsWith(","))
                {
                    MatchID = MatchID.Substring(0, MatchID.Length - 1);
                }

                dr = dtMatch.Select("MatchID in (" + MatchID + ")", "StopSellTime");

                if (dr.Length < 1)
                {
                    continue;
                }

                dt.Rows[i]["LotteryNumber"] = "查看详细信息";
                dt.Rows[i]["SystemEndTime"] = dr[0]["StopSellTime"].ToString();

                dt.AcceptChanges();
            }
        }

        DataTable dtNew = dt.Clone();

        DataRow[] drs = dt.Select("", SQL);
        foreach (DataRow dr in drs)
        {
            dtNew.ImportRow(dr);
        }

        g.DataSource = dtNew;
        g.DataBind();

        btnDownload.Enabled     = (dt.Rows.Count > 0);
        btnDownload_txt.Enabled = (dt.Rows.Count > 0);

        btnBuyAll.Visible = (dt.Rows.Count > 0);

        fileUp.Disabled   = (dt.Rows.Count < 1);
        btnUpload.Enabled = (dt.Rows.Count > 0);
    }
Beispiel #4
0
    private void BindData()
    {
        if (ddlIsuse.Items.Count < 1)
        {
            return;
        }

        string SQL = "";

        if (ddlType.Visible)
        {
            if (ddlType.SelectedValue == "金额")
            {
                SQL = "Money desc ";
            }
            else if (ddlType.SelectedValue == "过关方式")
            {
                SQL = "PlayTypeID desc ";
            }
            else if (ddlType.SelectedValue == "时间")
            {
                SQL = "SystemEndTime desc ";
            }
        }

        DataTable dt = new DAL.Views.V_SchemeSchedules().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue) + " and Schedule >= 100 and QuashStatus = 0 and Buyed = 0 and isOpened = 0", "[Money] desc");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_PrintOutput");

            return;
        }

        if (ddlLottery.SelectedValue == "72")
        {
            DataTable dtMatch = new DAL.Tables.T_PassRate().Open("", "", "");
            DataRow[] dr = null;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i]["Money"] = double.Parse(dt.Rows[i]["Money"].ToString()).ToString("N");

                if (dt.Rows[i]["LotteryNumber"].ToString().IndexOf("A0") >= 0)
                {
                    dt.Rows[i]["PlayTypeName"] = dt.Rows[i]["PlayTypeName"].ToString() + "**" + "单关";
                }
                else
                {
                    dt.Rows[i]["PlayTypeName"] = dt.Rows[i]["PlayTypeName"].ToString() + "**" + "过关";
                }

                string str = dt.Rows[i]["LotteryNumber"].ToString();

                if (string.IsNullOrEmpty(str))
                {
                    continue;
                }

                string Number = str.Split(';')[1].Replace("][", "|").Substring(1, str.Split(';')[1].Length - 2);
                string[] Numbers = Number.Split('|');
                string MatchID = "";

                for (int j = 0; j < Numbers.Length; j++)
                {
                    if (Numbers[j].IndexOf("(") < 0)
                    {
                        continue;
                    }

                    MatchID += Shove._Convert.StrToLong(Numbers[j].Substring(0, Numbers[j].IndexOf("(")), 1).ToString() + ",";
                }

                if (MatchID.EndsWith(","))
                {
                    MatchID = MatchID.Substring(0, MatchID.Length - 1);
                }

                dr = dtMatch.Select("MatchID in (" + MatchID + ")", "StopSellTime");

                if (dr.Length < 1)
                {
                    continue;
                }

                dt.Rows[i]["LotteryNumber"] = "查看详细信息";
                dt.Rows[i]["SystemEndTime"] = dr[0]["StopSellTime"].ToString();

                dt.AcceptChanges();
            }
        }

        DataTable dtNew = dt.Clone();

        DataRow[] drs = dt.Select("",SQL);
        foreach (DataRow dr in drs)
        {
            dtNew.ImportRow(dr);
        }

        g.DataSource = dtNew;
        g.DataBind();

        btnDownload.Enabled = (dt.Rows.Count > 0);
        btnDownload_txt.Enabled = (dt.Rows.Count > 0);

        btnBuyAll.Visible = (dt.Rows.Count > 0);

        fileUp.Disabled = (dt.Rows.Count < 1);
        btnUpload.Enabled = (dt.Rows.Count > 0);
    }
 private void BindData()
 {
     if (this.ddlLottery.Items.Count >= 1)
     {
         string condition = "LotteryID = " + Utility.FilteSqlInfusion(this.ddlLottery.SelectedValue) + " and QuashStatus = 0 and Buyed = 0 and isOpened = 0";
         if (this.tbQuash.Text.Trim() != "")
         {
             if (this.rb1.Checked)
             {
                 condition = condition + " and SchemeNumber = '" + Utility.FilteSqlInfusion(this.tbQuash.Text.Trim()) + "'";
             }
             else
             {
                 condition = condition + " and InitiateName = '" + Utility.FilteSqlInfusion(this.tbQuash.Text.Trim()) + "'";
             }
         }
         DataTable table = new Views.V_SchemeSchedules().Open("", condition, "[Money] desc");
         if (table == null)
         {
             PF.GoError(4, "数据库繁忙,请重试", "Admin_SchemeQuash");
         }
         else
         {
             table.Columns.Add("LocateWaysAndMultiples", Type.GetType("System.String"));
             string buyContent = "";
             string cnLocateWaysAndMultiples = "";
             for (int i = 0; i < table.Rows.Count; i++)
             {
                 table.Rows[i]["Money"] = double.Parse(table.Rows[i]["Money"].ToString()).ToString("N");
                 if (new Lottery()["45"].CheckPlayType(int.Parse(table.Rows[i]["PlayTypeID"].ToString())))
                 {
                     table.Rows[i]["Multiple"] = 0;
                     try
                     {
                         buyContent = "";
                         cnLocateWaysAndMultiples = "";
                         if (new Lottery()["45"].GetSchemeSplit(table.Rows[i]["LotteryNumber"].ToString(), ref buyContent, ref cnLocateWaysAndMultiples))
                         {
                             table.Rows[i]["LocateWaysAndMultiples"] = cnLocateWaysAndMultiples;
                         }
                         else
                         {
                             table.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                         }
                     }
                     catch
                     {
                         table.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                     }
                 }
                 table.AcceptChanges();
             }
             this.g.DataSource = table;
             this.g.DataBind();
         }
     }
 }
Beispiel #6
0
    private void BindData()
    {
        if (ddlLottery.Items.Count < 1)
        {
            return;
        }

        string Condition = "LotteryID = " + Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue) + " and QuashStatus = 0 and Buyed = 0 and isOpened = 0";

        if (tbQuash.Text.Trim() != "")
        {
            if (rb1.Checked)
            {
                Condition += " and SchemeNumber = '" + Shove._Web.Utility.FilteSqlInfusion(tbQuash.Text.Trim()) + "'";
            }
            else
            {
                Condition += " and InitiateName = '" + Shove._Web.Utility.FilteSqlInfusion(tbQuash.Text.Trim()) + "'";
            }
        }

        DataTable dt = new DAL.Views.V_SchemeSchedules().Open("", Condition, "[Money] desc");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_SchemeQuash");

            return;
        }

        dt.Columns.Add("LocateWaysAndMultiples", System.Type.GetType("System.String"));

        string BuyContent = "";
        string CnLocateWaysAndMultiples = "";

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            dt.Rows[i]["Money"] = double.Parse(dt.Rows[i]["Money"].ToString()).ToString("N");

            if (new SZJS.Lottery()[SZJS.Lottery.ZCDC.sID].CheckPlayType(int.Parse(dt.Rows[i]["PlayTypeID"].ToString())))
            {
                dt.Rows[i]["Multiple"] = 0;

                try
                {
                    BuyContent = "";
                    CnLocateWaysAndMultiples = "";

                    if (new SZJS.Lottery()[SZJS.Lottery.ZCDC.sID].GetSchemeSplit(dt.Rows[i]["LotteryNumber"].ToString(), ref BuyContent, ref CnLocateWaysAndMultiples))
                    {
                        dt.Rows[i]["LocateWaysAndMultiples"] = CnLocateWaysAndMultiples;
                    }
                    else
                    {
                        dt.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                    }
                }
                catch
                {
                    dt.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                }
            }

            dt.AcceptChanges();
        }

        g.DataSource = dt;
        g.DataBind();
    }
 private void BindData()
 {
     if (this.ddlIsuse.Items.Count >= 1)
     {
         DataTable table = new Views.V_SchemeSchedules().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.ddlIsuse.SelectedValue) + " and Schedule >= 100 and QuashStatus = 0 and Buyed = 0 and isOpened = 0", "[Money] desc");
         if (table == null)
         {
             PF.GoError(4, "数据库繁忙,请重试", "Admin_PrintOutput");
         }
         else
         {
             table.Columns.Add("LocateWaysAndMultiples", Type.GetType("System.String"));
             string buyContent = "";
             string cnLocateWaysAndMultiples = "";
             for (int i = 0; i < table.Rows.Count; i++)
             {
                 table.Rows[i]["Money"] = double.Parse(table.Rows[i]["Money"].ToString()).ToString("N");
                 if (new Lottery()["45"].CheckPlayType(int.Parse(table.Rows[i]["PlayTypeID"].ToString())))
                 {
                     table.Rows[i]["Multiple"] = 0;
                     try
                     {
                         buyContent = "";
                         cnLocateWaysAndMultiples = "";
                         string str3 = "";
                         string scheme = table.Rows[i]["LotteryNumber"].ToString();
                         if (new Lottery()["45"].GetSchemeSplit(scheme, ref buyContent, ref cnLocateWaysAndMultiples))
                         {
                             string vote = "";
                             DataTable table2 = PF.GetZCDCBuyContent(scheme, _Convert.StrToLong(table.Rows[i]["ID"].ToString(), -1L), ref vote);
                             if (table2 == null)
                             {
                                 PF.GoError(4, "数据访问错误", base.GetType().BaseType.FullName);
                                 return;
                             }
                             foreach (DataRow row in table2.Rows)
                             {
                                 if (str3 == "")
                                 {
                                     string str6 = str3;
                                     str3 = str6 + row["No"].ToString() + " " + row["LeagueTypeName"].ToString() + " " + row["HostTeam"].ToString() + " VS " + row["QuestTeam"].ToString() + " " + row["Content"].ToString() + " " + row["LotteryResult"].ToString();
                                 }
                                 else
                                 {
                                     string str7 = str3;
                                     str3 = str7 + "<br />" + row["No"].ToString() + " " + row["LeagueTypeName"].ToString() + " " + row["HostTeam"].ToString() + " VS " + row["QuestTeam"].ToString() + " " + row["Content"].ToString() + " " + row["LotteryResult"].ToString();
                                 }
                             }
                             table.Rows[i]["LocateWaysAndMultiples"] = cnLocateWaysAndMultiples;
                         }
                         else
                         {
                             table.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                         }
                     }
                     catch
                     {
                         table.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                     }
                 }
                 table.AcceptChanges();
             }
             this.g.DataSource = table;
             this.g.DataBind();
             this.btnDownload.Enabled = table.Rows.Count > 0;
             this.btnDownload_txt.Enabled = table.Rows.Count > 0;
             this.btnBuyAll.Visible = table.Rows.Count > 0;
             this.fileUp.Disabled = table.Rows.Count < 1;
             this.btnUpload.Enabled = table.Rows.Count > 0;
         }
     }
 }
 private void BindData()
 {
     if (this.ddlLottery.Items.Count >= 1)
     {
         DataTable table = new Views.V_SchemeSchedules().Open("", "LotteryID = " + Utility.FilteSqlInfusion(this.ddlLottery.SelectedValue) + " and Schedule >= 100 and QuashStatus = 0 and Buyed = 0 and EndTime < GetDate() and not [ID] in (select SchemeID from T_SchemesSendToCenter where HandleResult <> 1)", "[Money] desc");
         if (table == null)
         {
             PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
         }
         else
         {
             table.Columns.Add("LocateWaysAndMultiples", Type.GetType("System.String"));
             string buyContent = "";
             string cnLocateWaysAndMultiples = "";
             for (int i = 0; i < table.Rows.Count; i++)
             {
                 table.Rows[i]["Money"] = double.Parse(table.Rows[i]["Money"].ToString()).ToString("N");
                 if (new Lottery()["45"].CheckPlayType(int.Parse(table.Rows[i]["PlayTypeID"].ToString())))
                 {
                     table.Rows[i]["Multiple"] = 0;
                     try
                     {
                         buyContent = "";
                         cnLocateWaysAndMultiples = "";
                         if (new Lottery()["45"].GetSchemeSplit(table.Rows[i]["LotteryNumber"].ToString(), ref buyContent, ref cnLocateWaysAndMultiples))
                         {
                             table.Rows[i]["LocateWaysAndMultiples"] = cnLocateWaysAndMultiples;
                         }
                         else
                         {
                             table.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                         }
                     }
                     catch
                     {
                         table.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                     }
                 }
                 table.AcceptChanges();
             }
             this.g.DataSource = table;
             this.g.DataBind();
         }
     }
 }
Beispiel #9
0
    private void BindData()
    {
        if (ddlIsuse.Items.Count < 1)
        {
            return;
        }

        DataTable dt = new DAL.Views.V_SchemeSchedules().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue) + " and Schedule >= 100 and QuashStatus = 0 and Buyed = 0 and isOpened = 0", "[Money] desc");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_PrintOutput");

            return;
        }

        dt.Columns.Add("LocateWaysAndMultiples", System.Type.GetType("System.String"));

        string BuyContent = "";
        string CnLocateWaysAndMultiples = "";

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            dt.Rows[i]["Money"] = double.Parse(dt.Rows[i]["Money"].ToString()).ToString("N");

            if (new SZJS.Lottery()[SZJS.Lottery.ZCDC.sID].CheckPlayType(int.Parse(dt.Rows[i]["PlayTypeID"].ToString())))
            {
                dt.Rows[i]["Multiple"] = 0;

                try
                {
                    BuyContent = "";
                    CnLocateWaysAndMultiples = "";

                    string BuyNumberContent = "";

                    string str = dt.Rows[i]["LotteryNumber"].ToString();;
                    if (new SZJS.Lottery()[SZJS.Lottery.ZCDC.sID].GetSchemeSplit(str, ref BuyContent, ref CnLocateWaysAndMultiples))
                    {
                        string    vote  = "";
                        DataTable dtnew = PF.GetZCDCBuyContent(str, Shove._Convert.StrToLong(dt.Rows[i]["ID"].ToString(), -1), ref vote);

                        if (dtnew == null)
                        {
                            PF.GoError(ErrorNumber.DataReadWrite, "数据访问错误", this.GetType().BaseType.FullName);

                            return;
                        }

                        foreach (DataRow dr in dtnew.Rows)
                        {
                            if (BuyNumberContent == "")
                            {
                                BuyNumberContent += dr["No"].ToString() + " " + dr["LeagueTypeName"].ToString() + " " + dr["HostTeam"].ToString() + " VS " + dr["QuestTeam"].ToString() + " " + dr["Content"].ToString() + " " + dr["LotteryResult"].ToString();
                            }
                            else
                            {
                                BuyNumberContent += "<br />" + dr["No"].ToString() + " " + dr["LeagueTypeName"].ToString() + " " + dr["HostTeam"].ToString() + " VS " + dr["QuestTeam"].ToString() + " " + dr["Content"].ToString() + " " + dr["LotteryResult"].ToString();
                            }
                        }

                        dt.Rows[i]["LocateWaysAndMultiples"] = CnLocateWaysAndMultiples;
                    }
                    else
                    {
                        dt.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                    }
                }
                catch
                {
                    dt.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                }
            }

            dt.AcceptChanges();
        }

        g.DataSource = dt;
        g.DataBind();

        btnDownload.Enabled     = (dt.Rows.Count > 0);
        btnDownload_txt.Enabled = (dt.Rows.Count > 0);

        btnBuyAll.Visible = (dt.Rows.Count > 0);

        fileUp.Disabled   = (dt.Rows.Count < 1);
        btnUpload.Enabled = (dt.Rows.Count > 0);
    }