您的位置:首页 > 编程语言

Codematic2.0中的PageControl部分源代码 -3

2010-01-29 14:26 204 查看
Source code of Page1

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Gauss.PageControl
{
[DefaultProperty("Text")]
[ToolboxData("<{0}:Page01 runat=server></{0}:Page01>")]
public class Page01 : WebControl
{
// Fields
private string page_Add;
private int page_Count;
private int page_Current;
private string page_Index;
private string page_Makesql;
private string page_Search;
private int page_Size;
private int page_width;
private int record_Count;
public Page01()
{
this.page_Size = 10;
this.page_Current = 1;
this.page_Index = "index.aspx";
this.page_Add = "add.aspx";
this.page_Search = "search.aspx";
this.page_Makesql = "makesql.aspx";
this.page_width = 700;
}
public string Page_Add
{
get
{
return this.page_Add;
}
set
{
this.page_Add = value;
}
}
public int Page_Count
{
get
{
return this.page_Count;
}
set
{
this.page_Count = value;
}
}
public int Page_Current
{
get
{
return this.page_Current;
}
set
{
this.page_Current = value;
}
}
public string Page_Index
{
get
{
return this.page_Index;
}
set
{
this.page_Index = value;
}
}
public string Page_Makesql
{
get
{
return this.page_Makesql;
}
set
{
this.page_Makesql = value;
}
}
public string Page_Search
{
get
{
return this.page_Search;
}
set
{
this.page_Search = value;
}
}
public int Page_Size
{
get
{
return this.page_Size;
}
set
{
this.page_Size = value;
}
}
[DefaultValue(""), Bindable(true), Category("Appearance")]
public int Page_Width
{
get
{
return this.page_width;
}
set
{
this.page_width = value;
}
}
public int Record_Count
{
get
{
return this.record_Count;
}
set
{
this.record_Count = value;
}
}
protected override void Render(HtmlTextWriter output)
{
StringBuilder builder1 = new StringBuilder("");
builder1.Append("<table width=/"" + this.page_width + "/" border=/"0/" cellspacing=/"0/" cellpadding=/"2/" align=/"center/" height=/"22/">/n");
builder1.Append("/t<tr>/n");
builder1.Append("/t/t<td width=/"28%/">");
builder1.Append(string.Concat(new object[] { "/u25cb /u5171", this.Record_Count, "/u6761/uff0c/u5171", this.Page_Count, "/u9875/uff0c/u7b2c<font color=/"#e78a29/">", this.Page_Current, "</font>/u9875</td>/n" }));
builder1.Append("/t/t<td width=/"72%/">");
builder1.Append("/t/t<div align=/"right/">/n");
if (this.Page_Makesql != "")
{
builder1.Append("/t/t/t[ <a href=" + this.Page_Makesql + " mce_href=" + this.Page_Makesql + ">/u5168/u90e8</a> ] /n");
}
if (this.Page_Add != "")
{
builder1.Append("/t/t/t[ <a href=" + this.Page_Add + " mce_href=" + this.Page_Add + ">/u6dfb/u52a0</a> ] /n");
}
if (this.Page_Search != "")
{
builder1.Append("/t/t/t[ <a href=" + this.Page_Search + " mce_href=" + this.Page_Search + ">/u641c/u7d22</a> ] /n");
}
builder1.Append("/t/t/t[ <a href=" + this.Page_Index + " mce_href=" + this.Page_Index + ">/u5237/u65b0</a> ]  [");
if (this.Page_Current > 1)
{
builder1.Append("/t/t/t<a href=" + this.Page_Index + " mce_href=" + this.Page_Index + "?page=1>/u9996/u9875</a>/n");
}
else
{
builder1.Append("/t/t/t<font color=#cccccc>/u9996/u9875</font> /n");
}
builder1.Append("] [");
if ((this.Page_Current - 1) > 0)
{
builder1.Append(string.Concat(new object[] { "/t/t/t<a href=", this.Page_Index, " mce_href=", this.Page_Index, "?page=", this.Page_Current - 1, ">/u4e0a/u9875</a>/n" }));
}
else
{
builder1.Append("/t/t/t<font color=#cccccc>/u4e0a/u9875</font> /n");
}
builder1.Append("] [");
if ((this.Page_Current + 1) <= this.Page_Count)
{
builder1.Append(string.Concat(new object[] { "/t/t/t<a href=", this.Page_Index, " mce_href=", this.Page_Index, "?page=", this.Page_Current + 1, ">/u4e0b/u9875</a> /n" }));
}
else
{
builder1.Append("/t/t/t<font color=#cccccc>/u4e0b/u9875</font> /n");
}
builder1.Append("] [");
if (this.Page_Current < this.Page_Count)
{
builder1.Append(string.Concat(new object[] { "/t/t/t<a href=", this.Page_Index, " mce_href=", this.Page_Index, "?page=", this.Page_Count, ">/u5c3e/u9875</a>/n" }));
}
else
{
builder1.Append("/t/t/t<font color=#cccccc>/u5c3e/u9875</font>/n");
}
builder1.Append("]");
builder1.Append("/t/t</div>/n");
builder1.Append("/t/t</td>/n");
builder1.Append("/t</tr>");
builder1.Append("</table>/n");
output.Write(builder1.ToString());
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: