分布式框架开发代码片段一
来源:互联网 发布:数控车床gsktdb编程 编辑:程序博客网 时间:2024/05/29 16:41
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserExt.aspx.cs" Inherits="DistributedWeb.Sql.User.UserExt" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <div> <asp:GridView ID="GridView1" runat="server"> </asp:GridView> <%if (mmodel != null) { Response.Write(mmodel.ID + "<br/>"); Response.Write(mmodel.UserName + "<br/>"); } if (emodel != null) { Response.Write(emodel.CityId + "<br/>"); Response.Write(emodel.GetCity() + "<br/>"); Response.Write(emodel.GetNation() + "<br/>"); Response.Write(emodel.AddTime + "<br/>"); } %> </div> </form></body></html>
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Text;using System.Web.UI;using System.Web.UI.WebControls;using DistributedModel.User;using DistributedBLL.User;namespace DistributedWeb.Sql.User{ public partial class UserExt : System.Web.UI.Page { public DistributedModel.User.LoginUserInfo mmodel = null; public DistributedModel.User.UserInfo emodel = null; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindData(); } } protected void BindData() { LoginUserBLL bll = new LoginUserBLL(); //根据条件获取主数据 int totalCount = 0; List<LoginUserInfo> mainList = bll.FindListPage("id='1001'", 1, 1, out totalCount); mmodel = mainList[0]; //获取某信息的扩展数据泛型集合(可能多个扩展信息类) emodel = mmodel.GetExData<DistributedModel.User.UserInfo>("UserInfo"); /* string userId = "1001"; DistributedBLL.User.LoginUserBLL bll = new DistributedBLL.User.LoginUserBLL(); //根据条件获取主数据 mmodel = bll.FindById(userId); //获取某信息的扩展数据泛型集合(可能多个扩展信息类) DistributedBLL.User.UserBLL bll1 = new DistributedBLL.User.UserBLL(); emodel = bll1.FindById(userId); */ } }}
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AspNetPagerList.aspx.cs" Inherits="DistributedWeb.AspNetPagerList" %><%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>分页例子</title> <link href="/css/default.css" rel="stylesheet" type="text/css" /></head><body> <form id="form1" runat="server"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <asp:GridView ID="GridView1" runat="server" Width="100%"> </asp:GridView> </td> </tr> </table> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="33"> <webdiyer:AspNetPager ID="AspNetPager1" runat="server" CustomInfoTextAlign="Left" FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" NumericButtonTextFormatString="{0}" OnPageChanged="AspNetPager1_PageChanged" PageSize="3" PagingButtonSpacing="8px" PrevPageText="上一页" ShowCustomInfoSection="Left" LayoutType="Table" CssClass="pages" AlwaysShow="true" CurrentPageButtonClass="cpb" NumericButtonCount="5" CustomInfoHTML="第<b>%CurrentPageIndex%</b>页/共%PageCount%页 每页显示%PageSize%条"> </webdiyer:AspNetPager> </td> </tr> </table> </form></body></html>
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using DistributedBLL.User;using DistributedModel.User;using DistributedUtil.Helper;using DistributedBLL;using DistributedWeb.BasePage;namespace DistributedWeb{ public partial class AspNetPagerList : System.Web.UI.Page { LoginUserBLL loginbll = new LoginUserBLL(); UserBLL userbll = new UserBLL(); public List<LoginUserInfo> ulist = null; protected void Page_Load(object sender, EventArgs e) { LoginUser.IsLogin(); if (!IsPostBack) { GetData(); } } public void GetData() { int RecordCount = 0; string strWhere = GetWhereString(); ulist = loginbll.FindListPage(strWhere, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out RecordCount); AspNetPager1.RecordCount = RecordCount; GridView1.DataSource = ulist; GridView1.DataBind(); } protected void AspNetPager1_PageChanged(object sender, EventArgs e) { GetData(); } protected void btnsearch_Click(object sender, EventArgs e) { GetData(); } protected string GetWhereString() { //拼接查询语句 string strWhere = "1=1 "; return strWhere; } }}
0 0
- 分布式框架开发代码片段一
- Android开发代码片段积累(一)
- php开发常用代码片段(一)
- Android开发实用代码片段(一)
- 边缘化框架【代码片段】
- javascript 代码片段 框架
- 代码片段(一)
- ObjectARX代码片段一
- Android 代码片段(一)
- iOS开发:代码片段
- android 开发中常用到的一些代码片段(一)
- android 开发中常用到的一些代码片段(一)
- android开发中代码片段集合 (一)
- android开发过程中使用功能性代码片段(一)
- IOS开发常用代码片段合集(一)
- Android 开发过程中用的代码片段(一)
- android有用代码片段(一)
- android有用代码片段一
- 第七次上机实验--素数,回文数,可逆素数
- 南洋理工ACM 604小明的难题
- 多点触摸:MultiPointTouchArea
- Linux下使用rsync进行数据备份的命令详解
- angular中模块的自动加载和手动加载
- 分布式框架开发代码片段一
- Servlet API
- Android布局中实现圆角边框
- 存储过程简单测试
- poj 3009 深搜
- 利用AXIS开发Webservice(一)
- 一天一个设计模式——开篇概述
- Android 消息机制学习
- Jmockit对接口与基类的mock