private void BindData() { if (this.ddlLottery.Items.Count >= 1) { DataTable dt = new Views.V_Experts().Open("", "SiteID = " + base._Site.ID.ToString() + ((this.ddlLottery.SelectedValue == "0") ? "" : (" and LotteryID = " + Utility.FilteSqlInfusion(this.ddlLottery.SelectedValue))), ""); if (dt == null) { PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName); } else { PF.DataGridBindData(this.g, dt, this.gPager); } } }
public static DataTable GetZCExpertList(int LotteryID) { DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(ZCExpert + LotteryID.ToString()); if ((cacheAsDataTable == null) || (cacheAsDataTable.Rows.Count == 0)) { cacheAsDataTable = new Views.V_Experts().Open("UserName,UserID,LotteryName", "[ON]=1 and [isCommend]=1 and LotteryID=" + LotteryID, ""); if (cacheAsDataTable == null) { return(cacheAsDataTable); } cacheAsDataTable.Columns.Add("ID", typeof(int)); int num = 1; foreach (DataRow row in cacheAsDataTable.Rows) { row["ID"] = num; num++; } Cache.SetCache(ZCExpert + LotteryID.ToString(), cacheAsDataTable, 180); } return(cacheAsDataTable); }