📄 answerlist.cs
字号:
namespace PowerEasy.WebSite.Survey
{
using PowerEasy.Model.Survey;
using PowerEasy.Survey;
using PowerEasy.Web.UI;
using System;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class AnswerList : AdminPage
{
protected SurveyFieldInfo fieldInfo;
protected HtmlForm form1;
protected Label LblTitle;
protected int questionId;
protected Repeater RptAnswerList;
protected int surveyId;
private void BindData()
{
this.RptAnswerList.DataSource = SurveyRecord.GetQuestionAnswer(this.surveyId, "Q" + this.questionId.ToString());
this.RptAnswerList.DataBind();
}
protected void Page_Load(object sender, EventArgs e)
{
this.surveyId = BasePage.RequestInt32("SurveyID");
this.questionId = BasePage.RequestInt32("QuestionID");
if ((this.surveyId != 0) && (this.questionId != 0))
{
this.fieldInfo = SurveyField.GetFieldInfoById(this.surveyId, this.questionId);
this.LblTitle.Text = "当前问卷:" + SurveyManager.GetSurveyById(this.surveyId).SurveyName + " / 当前问题:" + this.fieldInfo.QuestionContent;
this.BindData();
}
}
protected void RptAnswerList_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if ((e.Item.ItemType == ListItemType.AlternatingItem) || (e.Item.ItemType == ListItemType.Item))
{
Literal literal = e.Item.FindControl("LtrAnswerList") as Literal;
string dataItem = e.Item.DataItem as string;
if (!string.IsNullOrEmpty(dataItem))
{
literal.Text = "<td style='height:20px;'>" + dataItem + "</td>";
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -