📄 customform_item.aspx.cs
字号:
//======================================================
//== (c)2008 aspxcms inc by NeTCMS v1.0 ==
//== Forum:bbs.aspxcms.com ==
//== Website:www.aspxcms.com ==
//======================================================
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 NetCMS.Model;
namespace NetCMS.Web.manage.Sys
{
public partial class CustomForm_Item : NetCMS.Web.UI.ManagePage
{
protected void Page_Load(object sender, EventArgs e)
{
this.PageNavigator1.OnPageChange += new PageChangeHandler(PageNavigator1_PageChage);
if (!Page.IsPostBack)
{
NetCMS.Content.CustomForm cf = new NetCMS.Content.CustomForm();
if (Request.Form["Option"] != null && Request.Form["ID"] != null
&& Request.Form["Option"] == "DeleteItem")
{
try
{
int itid = int.Parse(Request.Form["ID"]);
cf.DeleteFormItem(itid);
Response.Write("1%操作成功!");
}
catch (Exception ex)
{
Response.Write("0%" + ex.Message);
}
Response.End();
}
if (Request.QueryString["id"] == null || Request.QueryString["id"] == string.Empty)
{
PageError("参数不完整!", "CustomForm.aspx");
}
int id = int.Parse(Request.QueryString["id"]);
this.HlkCreate.NavigateUrl = "CustomForm_Item_Add.aspx?formid=" + id;
this.LtrFormName.Text = cf.GetFormName(id);
DataListBind(1);
}
}
private void PageNavigator1_PageChage(object sender, int PageIndex)
{
DataListBind(PageIndex);
}
private void DataListBind(int PageIndex)
{
SQLConditionInfo si = new SQLConditionInfo("@formid", int.Parse(Request.QueryString["id"]));
int nRCount, nPCount;
DataTable tb = NetCMS.Content.Pagination.GetPage(this.GetType().Name, PageIndex, 20, out nRCount, out nPCount, si);
this.PageNavigator1.PageCount = nPCount;
this.PageNavigator1.PageIndex = PageIndex;
this.PageNavigator1.RecordCount = nRCount;
this.RptData.DataSource = tb;
this.RptData.DataBind();
}
protected string GetTypeName(object obj)
{
if (obj == null || obj == DBNull.Value)
return "";
else
{
try
{
return CustomFormItemInfo.GetFieldTypeName((EnumCstmFrmItemType)Enum.Parse(typeof(EnumCstmFrmItemType), obj.ToString()));
}
catch
{
return "未知";
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -