📄 polls.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Zeroone.FileSystem;
using Zeroone.Custom;
public partial class Admin_Poll_Polls : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
string pollRoorPath = "/zeroone-polls/";
if (!CategoryController.Exists(pollRoorPath))
{
Category pollCategory = new Category();
pollCategory.Name = "投票";
pollCategory.Path = pollRoorPath;
pollCategory.Create();
}
//多选/单选
if (!DocumentCustomPropertyController.Instance().Exists(pollRoorPath, "AllowMultiple"))
{
CustomProperty property = new CustomProperty();
property.Name = "AllowMultiple";
property.DefaultValue = false;
property.PropertyType = typeof(Boolean);
property.SerializeAs = CustomSerializeAs.String;
property.Path = pollRoorPath;
DocumentCustomPropertyController.Instance().AddCustomProperty(property);
}
ddlPllCategoies.DataSource = CategoryController.GetChildCategories(pollRoorPath);
ddlPllCategoies.DataBind();
ListItem item = new ListItem("所有分类",pollRoorPath);
ddlPllCategoies.Items.Insert(0, item);
//投票
rptPolls.DataSource = DocumentController.GetDocuments(pollRoorPath, 100);
rptPolls.DataBind();
}
}
protected void ddlPllCategoies_SelectedIndexChanged(object sender, EventArgs e)
{
rptPolls.DataSource = DocumentController.GetDocuments(ddlPllCategoies.SelectedValue, 100);
rptPolls.DataBind();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -