private void BindData() { string str = "SiteID = " + _Site.ID.ToString() + " and HandleResult = " + HandleResult.Trying.ToString(); string Key = "Cps_Administrator_CpsTry"; DataTable dt = Shove._Web.Cache.GetCacheAsDataTable(Key); if (dt == null) { dt = new DAL.Views.V_CpsTrys().Open("", str, "[DateTime]"); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().FullName); return; } Shove._Web.Cache.SetCache(Key, dt, 3600); } string Condition = "1=1"; if (tbKeyWord.Text != "" && tbKeyWord.Text != "请输入代理商ID") { Condition += " and Name='" + Shove._Web.Utility.FilteSqlInfusion(tbKeyWord.Text.Trim()) + "'"; } DataTable dtData = dt.Clone(); DataRow[] drs = dt.Select(Condition); dtData.Columns.Add("Count"); for (int i = 0; i < drs.Length; i++) { dtData.Rows.Add(drs[i].ItemArray); dtData.Rows[i]["Count"] = i + 1; } PF.DataGridBindData(g, dtData, gPager); }
private void BindData() { string str = "SiteID = " + _Site.ID.ToString() + " and HandleResult = " + HandleResult.Trying.ToString(); string Key = "Cps_Administrator_CpsTry"; DataTable dt = Shove._Web.Cache.GetCacheAsDataTable(Key); if (dt == null) { dt = new DAL.Views.V_CpsTrys().Open("", str, "[DateTime]"); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().FullName); return; } Shove._Web.Cache.SetCache(Key, dt, 100000); } string Condition = "1=1"; if (tbKeyWord.Text != "" && tbKeyWord.Text != "请输入代理商ID") { Condition += " and Name='" + Shove._Web.Utility.FilteSqlInfusion(tbKeyWord.Text.Trim()) + "'"; } DataTable dtData = dt.Clone(); DataRow[] drs = dt.Select(Condition); dtData.Columns.Add("Count"); for (int i = 0; i < drs.Length; i++) { dtData.Rows.Add(drs[i].ItemArray); dtData.Rows[i]["Count"] = i + 1; } PF.DataGridBindData(g, dtData, gPager); }
private void BindData() { long TryID = Shove._Convert.StrToLong(Shove._Web.Utility.GetRequest("id"), -1); if (TryID < 1) { PF.GoError(ErrorNumber.Unknow, "参数错误", this.GetType().FullName); return; } DataTable dt = new DAL.Views.V_CpsTrys().Open("", "SiteID = " + _Site.ID.ToString() + " and [ID] = " + TryID.ToString() + " and HandleResult = " + HandleResult.Trying.ToString(), ""); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().FullName); return; } if (dt.Rows.Count < 1) { PF.GoError(ErrorNumber.Unknow, "代理商申请不存在", this.GetType().FullName); return; } tbID.Text = TryID.ToString(); tbName.Text = dt.Rows[0]["Name"].ToString(); tbContactPerson.Text = dt.Rows[0]["ContactPerson"].ToString(); tbTelephone.Text = dt.Rows[0]["Telephone"].ToString(); tbUrl.Text = dt.Rows[0]["Url"].ToString(); tbUrlName.Text = dt.Rows[0]["CpsTrysName"].ToString(); tbMobile.Text = dt.Rows[0]["Mobile"].ToString(); tbEmail.Text = dt.Rows[0]["Email"].ToString(); tbQQ.Text = dt.Rows[0]["QQ"].ToString(); Shove.ControlExt.SetDownListBoxTextFromValue(ddlCpsType, dt.Rows[0]["Type"].ToString()); tbMD5Key.Text = dt.Rows[0]["MD5Key"].ToString(); tbBonusScale.Text = dt.Rows[0]["BonusScale"].ToString(); Shove.ControlExt.SetDownListBoxTextFromValue(ddlCom, dt.Rows[0]["IsIntimeBonus"].ToString()); }