questiondetail.cs
来自「动易SiteFactory™ 网上商店系统1.0源代码」· CS 代码 · 共 59 行
CS
59 行
namespace PowerEasy.WebSite.Admin.Survey
{
using PowerEasy.Controls;
using PowerEasy.Model.Survey;
using PowerEasy.Survey;
using PowerEasy.Web.UI;
using System;
using System.Collections.Generic;
using System.Web.UI.WebControls;
public class QuestionDetail : AdminPage
{
protected ExtendedGridView EgvQuestionDetail;
protected HiddenField HdnSurveyId;
protected Label LblTitle;
protected ExtendedSiteMapPath SmpNavigator;
protected void EgvQuestionDetail_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
SurveyFieldInfo dataItem = e.Row.DataItem as SurveyFieldInfo;
e.Row.Cells[0].Text = Convert.ToString((int) (((this.EgvQuestionDetail.PageIndex * this.EgvQuestionDetail.PageCount) + e.Row.RowIndex) + 1));
e.Row.Cells[2].Text = SurveyField.GetQuestionType(dataItem.QuestionType);
e.Row.Cells[3].Text = BasePage.RequestString("SurveyName");
}
}
private IList<SurveyFieldInfo> GetDataSource()
{
if (string.IsNullOrEmpty(BasePage.RequestString("SurveyID")))
{
return null;
}
if ((((IList<SurveyFieldInfo>) base.Cache["SurveyFieldInfoList"]) == null) || (this.HdnSurveyId.Value != BasePage.RequestString("SurveyID")))
{
base.Cache["SurveyFieldInfoList"] = SurveyField.GetFieldList(BasePage.RequestInt32("SurveyID"));
this.HdnSurveyId.Value = BasePage.RequestString("SurveyID");
}
return (base.Cache["SurveyFieldInfoList"] as IList<SurveyFieldInfo>);
}
protected void Page_Load(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(BasePage.RequestString("SurveyName")))
{
this.LblTitle.Text = "当前问卷:" + BasePage.RequestString("SurveyName");
}
if (!base.IsPostBack)
{
this.EgvQuestionDetail.DataSource = this.GetDataSource();
this.EgvQuestionDetail.DataBind();
this.HdnSurveyId.Value = BasePage.RequestString("SurveyID");
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?