private void BindScoring() { if (_User == null) { return; } string CacheKeyName = "Room_UserScoring_" + _User.ID.ToString(); DataTable dt = Shove._Web.Cache.GetCacheAsDataTable(CacheKeyName); if (dt == null) { dt = new DAL.Views.V_UserScoringDetails().Open("ID,[DateTime],[Scoring],OperatorType", "[UserID] = " + _User.ID.ToString() + "", "[DateTime] desc, [ID]"); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试(732)", this.GetType().FullName); return; } Shove._Web.Cache.SetCache(CacheKeyName, dt, 60); } gScoring.DataSource = dt; gScoring.DataBind(); this.lblScoreInCount.Text = inScoreCount.ToString(); this.lblScoreOutCount.Text = outScoreCount.ToString(); this.lblScoreInMoney.Text = inScoreMoney.ToString("N"); this.lblScoreOutMoney.Text = outScoreMoney.ToString("N"); }
private void BindScoring() { if (base._User != null) { string key = "Room_UserScoring_" + base._User.ID.ToString(); DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key); if (cacheAsDataTable == null) { cacheAsDataTable = new Views.V_UserScoringDetails().Open("ID,[DateTime],[Scoring],OperatorType", "[UserID] = " + base._User.ID.ToString(), "[DateTime] desc, [ID]"); if (cacheAsDataTable == null) { PF.GoError(4, "数据库繁忙,请重试(732)", base.GetType().FullName); return; } Shove._Web.Cache.SetCache(key, cacheAsDataTable, 60); } this.gScoring.DataSource = cacheAsDataTable; this.gScoring.DataBind(); this.lblScoreInCount.Text = this.inScoreCount.ToString(); this.lblScoreOutCount.Text = this.outScoreCount.ToString(); this.lblScoreInMoney.Text = this.inScoreMoney.ToString("N"); this.lblScoreOutMoney.Text = this.outScoreMoney.ToString("N"); } }