private void BindData(int Type) { DataTable dt = Shove._Web.Cache.GetCacheAsDataTable("MemberQuestionList_" + Type.ToString() + "_" + _User.ID.ToString()); if (dt == null) { switch (Type) { case 1: dt = new DAL.Views.V_Questions().Open("", "SiteID = " + _Site.ID.ToString() + " and UserID = " + _User.ID.ToString() + " and UseType = 1", "[DateTime] desc"); break; case 2: dt = new DAL.Views.V_Questions().Open("", "SiteID = " + _Site.ID.ToString() + " and UserID = " + _User.ID.ToString() + " and UseType = 1 and AnswerStatus = 0", "[DateTime] desc"); break; case 3: dt = new DAL.Views.V_Questions().Open("", "SiteID = " + _Site.ID.ToString() + " and UserID = " + _User.ID.ToString() + " and UseType = 1 and AnswerStatus = 1", "[DateTime] desc"); break; } if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().FullName); return; } Shove._Web.Cache.SetCache("MemberQuestionList_" + Type.ToString() + "_" + _User.ID.ToString(), dt); } PF.DataGridBindData(g, dt, gPager); }
protected void Page_Load(object sender, EventArgs e) { //BindData(); if (!this.IsPostBack) { labUserName.Text = _User.Name; long QuestionID = Shove._Convert.StrToLong(Shove._Web.Utility.GetRequest("id"), 0); if (QuestionID > 0) { DataTable dt = new DAL.Views.V_Questions().Open("", "id = " + QuestionID.ToString(), ""); if (dt == null || dt.Rows.Count == 0) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Room_QuestionList"); return; } if (dt.Rows.Count > 0) { labContent.Text = dt.Rows[0]["Content"].ToString(); labAnswer.Text = dt.Rows[0]["Answer"].ToString(); short AnswerStatus = Shove._Convert.StrToShort(dt.Rows[0]["AnswerStatus"].ToString(), 0); if (AnswerStatus == 0) { labAnswerDateTime.Text = "未答复"; } else if (AnswerStatus == 1) { labAnswerDateTime.Text = "处理中"; } else { labAnswerDateTime.Text = "(答复时间:" + dt.Rows[0]["AnswerDateTime"].ToString() + ")"; } } } btnType_1_Click(btnType_1, e); } }
protected void Page_Load(object sender, EventArgs e) { if (base.IsPostBack) { return; } this.labUserName.Text = base._User.Name; long num = _Convert.StrToLong(Utility.GetRequest("id"), 0L); if (num > 0L) { DataTable table = new Views.V_Questions().Open("", "id = " + num.ToString(), ""); if ((table == null) || (table.Rows.Count == 0)) { PF.GoError(4, "数据库繁忙,请重试", "Room_QuestionList"); return; } if (table.Rows.Count > 0) { this.labContent.Text = table.Rows[0]["Content"].ToString(); this.labAnswer.Text = table.Rows[0]["Answer"].ToString(); switch (_Convert.StrToShort(table.Rows[0]["AnswerStatus"].ToString(), 0)) { case 0: this.labAnswerDateTime.Text = "未答复"; goto Label_0173; case 1: this.labAnswerDateTime.Text = "处理中"; goto Label_0173; } this.labAnswerDateTime.Text = "(答复时间:" + table.Rows[0]["AnswerDateTime"].ToString() + ")"; } } Label_0173: this.btnType_1_Click(this.btnType_1, e); }
private void BindData(int Type) { DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable("MemberQuestionList_" + Type.ToString() + "_" + base._User.ID.ToString()); if (cacheAsDataTable == null) { switch (Type) { case 1: cacheAsDataTable = new Views.V_Questions().Open("", "SiteID = " + base._Site.ID.ToString() + " and UserID = " + base._User.ID.ToString() + " and UseType = 1", "[DateTime] desc"); break; case 2: cacheAsDataTable = new Views.V_Questions().Open("", "SiteID = " + base._Site.ID.ToString() + " and UserID = " + base._User.ID.ToString() + " and UseType = 1 and AnswerStatus = 0", "[DateTime] desc"); break; case 3: cacheAsDataTable = new Views.V_Questions().Open("", "SiteID = " + base._Site.ID.ToString() + " and UserID = " + base._User.ID.ToString() + " and UseType = 1 and AnswerStatus = 1", "[DateTime] desc"); break; } if (cacheAsDataTable == null) { PF.GoError(4, "数据库繁忙,请重试", base.GetType().FullName); return; } Shove._Web.Cache.SetCache("MemberQuestionList_" + Type.ToString() + "_" + base._User.ID.ToString(), cacheAsDataTable); } PF.DataGridBindData(this.g, cacheAsDataTable, this.gPager); }