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

本文介绍了一个名为 Page02 的 Web 控件实现细节,该控件用于网页中进行分页展示,支持设置每页显示数量、当前页数等属性,并自动生成相应的 HTML 结构。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 Source Code of Page02.cs

 

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}:Page02 runat=server></{0}:Page02>")]
    
public class Page02 : WebControl
    
...{
        
// Fields
        private int page_Count;
        
private int page_Current;
        
private string page_Index;
        
private int page_Size;
        
private int page_width;
        
private int pageStep;

        
public Page02()
        
...{
            
this.page_Size = 10;
            
this.page_Current = 1;
            
this.page_Index = "index.aspx";
            
this.pageStep = 6;
            
this.page_width = 700;
        }

        
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 int Page_Size
        
...{
            
get
            
...{
                
return this.page_Size;
            }

            
set
            
...{
                
this.page_Size = value;
            }

        }


        [Bindable(
true), DefaultValue(""), Category("Appearance")]
        
public int Page_Width
        
...{
            
get
            
...{
                
return this.page_width;
            }

            
set
            
...{
                
this.page_width = value;
            }

        }


        
public int PageStep
        
...{
            
get
            
...{
                
return this.pageStep;
            }

            
set
            
...{
                
this.pageStep = value;
            }

        }


        
protected override void Render(HtmlTextWriter output)
        
...{
            StringBuilder builder1 
= new StringBuilder("");
            builder1.Append(
"<table width="" + this.page_width + "" border="0" cellspacing="0" cellpadding="0" align="center" height="22"> ");
            builder1.Append(
" <tr> ");
            builder1.Append(
" <td width="171">");
            builder1.Append(
string.Concat(new object[] ..."○ 页次:<font color="#e78a29">"this.Page_Current, "</font>/"this.Page_Count, ",每页:<font color='#e78a29'>"this.Page_Size, "</font>条</td> " }));
            builder1.Append(
" <td width="529"> ");
            builder1.Append(
" <div align="right">页数: ");
            
int num1 = 1;
            
if (this.Page_Current > this.PageStep)
            
...{
                num1 
= this.Page_Current - this.PageStep;
            }

            
else
            
...{
                num1 
= 1;
            }

            
int num2 = num1 + (2 * this.PageStep);
            
if ((num1 + (2 * this.PageStep)) > this.Page_Count)
            
...{
                
if (((2 * this.PageStep) + 1> this.Page_Count)
                
...{
                    num1 
= 1;
      &nbs
动软.Net代码生成器Codematic 是一款为C#程序员设计的自动代码生成器,Codematic 生成的代码基于面向对象的思想和三层架构设计,结合了Petshop中经典的思想和设计模式,融入了工厂模式,反射机制等等一些思想。采用 Model+DAL +BLL+Web 的设计,包括生成属性、添加、修改、删除、查询、存在性、Model类构造等基础代码片断,支持不同3种架构代码生成,使程序员可以节省大量机械录入的时 间和重复劳动,而将精力集中于核心业务逻辑的开发。 Codematic 同时提供方便的多类型数据库管理,查询分析器,SQL脚本生成,存储过程生成,数据库文档生成,Web项目发布,代码批量自动输出等多项开发工作中常用到的功能,您可以很方便轻松地进行项目开发。 详细功能说明 1.自动生成代码 可以生成3种不同架构的代码,支持自动创建三层架构项目并生成代码。 它可以生成:实体Model,DAL(数据访问层),IDAL(接口层),DALFactory(类工厂),BLL(业务逻辑层),WEB层等多层的代 码,可以节省大量的时间来做业务逻辑的代码,那些重复的代码就交给它去做吧,1分钟生成一个架构所有的基本代码。我感觉有了它开发项目的效率简直轻松多 了。 2. 多类型数据库集中管理器 类似SQLServer2005的管理界面,支持SQL Server,Oracle,OleDb三种类型的数据库,方便平常在代码编辑的时候想查看数据库的信息,并且可以很直观的查看字段类型,长度,主键,默 认值等详细信息,省去了在代码和数据库管理器之间的来回切换,方便快捷。 3. 查询分析器 。 实现类似于SQLServer的查询分析器的功能,方便编写代码时想进行数查询。 4. 自动生成存储过程和SQL脚本 。可以生成存储过程,查询语句,数据插入脚本,对象定义脚本等。 5. 自动生成数据库结构的文档。 6. Web项目文件发布。 7. 代码批量生成自动导出功能。 8. 其他 : C#ToVB.NET代码转换器
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值