Code
<%@ Page Language="C#" MasterPageFile="~/Marketing/MasterPage.master" AutoEventWireup="true" CodeFile="InscardDetail.aspx.cs" Inherits="Marketing_InscardDetail" Title="Untitled Page" %>
<%@ Register Assembly="WebPager" Namespace="Hooyee.WebControls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
保险卡产品<br />
<cc1:AdvDataList ID="AdvDataList1" BaseDir="../images" runat="server" AllowPaging="True" Width=100% PageSize="20" OnAfterPageChanged="AdvDataList1_AfterPageChanged">
<ItemTemplate>
<table width="100%" border="0" style="border:1px solid #cccccc" class=text cellpadding=0 cellspacing=0>
<colgroup>
<col width="55">
<col width="215">
<col width="150">
<col width="115">
<col width="110">
<col width="30">
</colgroup>
<tr>
<td height="17"><a href="insuredetail.aspx?id=<%# DataBinder.Eval(Container.DataItem, "id")%>" target=_blank><img src="../manager/<%# DataBinder.Eval(Container.DataItem, "path")%>" border=0 width=55 height=45 /></a></td>
<td>名称:<%# DataBinder.Eval(Container.DataItem, "name")%></td>
<td>保险公司:<%# FormatCompany(Container.DataItem,"Company") %></td>
<td>保额:<%# DataBinder.Eval(Container.DataItem,"be")%></td>
<td>保费:<%# DataBinder.Eval(Container.DataItem,"bf")%></td>
<td>详细</td>
</tr>
</table>
</ItemTemplate>
</cc1:AdvDataList>
</asp:Content>
<%@ Page Language="C#" MasterPageFile="~/Marketing/MasterPage.master" AutoEventWireup="true" CodeFile="InscardDetail.aspx.cs" Inherits="Marketing_InscardDetail" Title="Untitled Page" %>
<%@ Register Assembly="WebPager" Namespace="Hooyee.WebControls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
保险卡产品<br />
<cc1:AdvDataList ID="AdvDataList1" BaseDir="../images" runat="server" AllowPaging="True" Width=100% PageSize="20" OnAfterPageChanged="AdvDataList1_AfterPageChanged">
<ItemTemplate>
<table width="100%" border="0" style="border:1px solid #cccccc" class=text cellpadding=0 cellspacing=0>
<colgroup>
<col width="55">
<col width="215">
<col width="150">
<col width="115">
<col width="110">
<col width="30">
</colgroup>
<tr>
<td height="17"><a href="insuredetail.aspx?id=<%# DataBinder.Eval(Container.DataItem, "id")%>" target=_blank><img src="../manager/<%# DataBinder.Eval(Container.DataItem, "path")%>" border=0 width=55 height=45 /></a></td>
<td>名称:<%# DataBinder.Eval(Container.DataItem, "name")%></td>
<td>保险公司:<%# FormatCompany(Container.DataItem,"Company") %></td>
<td>保额:<%# DataBinder.Eval(Container.DataItem,"be")%></td>
<td>保费:<%# DataBinder.Eval(Container.DataItem,"bf")%></td>
<td>详细</td>
</tr>
</table>
</ItemTemplate>
</cc1:AdvDataList>
</asp:Content>
Code
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 BLL;
public partial class Marketing_InscardDetail : System.Web.UI.Page
{
DataTable DataSource = null;
DataTable dtt = null;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ShowPage();
}
}
protected void AdvDataList1_AfterPageChanged(object source, DataGridPageChangedEventArgs e)
{
ShowPage();
}
private void ShowPage()
{
string sql = "select * from ins_inscard order by id desc";
DataTable dt = BLL.CommonBLL.GetListExecCommand(sql).Tables[0];
int colLength = dt.Rows.Count;//行总合
int rowLength = dt.Columns.Count;//列总合
DataRow[] newRows = new DataRow[rowLength];
DataTable subDT = new DataTable();
dt.Columns.Add("index");
dtt = BLL.CommonBLL.GetSchema("ins_inscard").Tables[0];
dtt.Columns.Add("index");
DataRow dr;
for (int i = 0; i < colLength; i++)
{
dr = dt.Rows[i];
dr["index"] = i.ToString();
dtt.Rows.Add(dr.ItemArray);
}
AdvDataList1.PagerInfo.ItemCount = dtt.Rows.Count;
string filter = string.Format("Index >= {0} and Index <= {1}", AdvDataList1.PagerInfo.ItemStart, AdvDataList1.PagerInfo.ItemEnd);
AdvDataList1.DataSource = new DataView(dtt, filter, "", DataViewRowState.CurrentRows);
AdvDataList1.DataBind();
}
protected string FormatCompany(object item, string type)
{
DataRowView drv = (DataRowView)item;
string val = CommonBLL.getCompanyNameByID(drv["Company"].ToString());
return val;
}
}
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 BLL;
public partial class Marketing_InscardDetail : System.Web.UI.Page
{
DataTable DataSource = null;
DataTable dtt = null;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ShowPage();
}
}
protected void AdvDataList1_AfterPageChanged(object source, DataGridPageChangedEventArgs e)
{
ShowPage();
}
private void ShowPage()
{
string sql = "select * from ins_inscard order by id desc";
DataTable dt = BLL.CommonBLL.GetListExecCommand(sql).Tables[0];
int colLength = dt.Rows.Count;//行总合
int rowLength = dt.Columns.Count;//列总合
DataRow[] newRows = new DataRow[rowLength];
DataTable subDT = new DataTable();
dt.Columns.Add("index");
dtt = BLL.CommonBLL.GetSchema("ins_inscard").Tables[0];
dtt.Columns.Add("index");
DataRow dr;
for (int i = 0; i < colLength; i++)
{
dr = dt.Rows[i];
dr["index"] = i.ToString();
dtt.Rows.Add(dr.ItemArray);
}
AdvDataList1.PagerInfo.ItemCount = dtt.Rows.Count;
string filter = string.Format("Index >= {0} and Index <= {1}", AdvDataList1.PagerInfo.ItemStart, AdvDataList1.PagerInfo.ItemEnd);
AdvDataList1.DataSource = new DataView(dtt, filter, "", DataViewRowState.CurrentRows);
AdvDataList1.DataBind();
}
protected string FormatCompany(object item, string type)
{
DataRowView drv = (DataRowView)item;
string val = CommonBLL.getCompanyNameByID(drv["Company"].ToString());
return val;
}
}