<%@ Register TagPrefix="Title" TagName="TitleShow" Src="/aspnetdata/Title.ascx" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="DataProcess" %>
<html>
<head>
	<script language="c#" runat="server">
	void Page_Load(object sender, EventArgs e){
		if(IsPostBack==false){
			bindNew(true);
		}
	}
	void bindNew(Boolean tag){
		string x=Server.MapPath("Employ.mdb");
		UseACC ep=new UseACC(x);
		string d="SELECT MonthPay.*, Staff.cname,Staff.BankID FROM Staff INNER JOIN MonthPay ON Staff.SID = MonthPay.SID";
		allPay.DataSource=ep.GetDataView("MonthPay",d);
		allPay.DataBind();
	}
	void ChangePage(object sender,DataGridPageChangedEventArgs e){
		allPay.CurrentPageIndex = e.NewPageIndex;
		bindNew(false);
	}
	</script>
</head>
<body background="/aspnetdata/images/winback.gif">
<Title:TitleShow id="BookT" Runat="server" />
查看 <asp:hyperlink id="h1" NavigateUrl="/aspnetdata/shows.aspx?cate=c&file=ch12/12-4/cs/DataProcess.cs" Text="DataProcess.cs" runat="server" target="_blank"/><br>
<form runat="server">
    <ASP:DataGrid id="allPay" runat="server"
        BorderColor="black"
        BorderWidth="1"
        GridLines="Both"
        CellPadding="3"
        CellSpacing="0"
        Font-Name="Verdana"
        Font-Size="8pt"
        HeaderStyle-BackColor="Yellow"
        DataKeyField="SID"
        AutoGenerateColumns="false"
        AllowPaging="True"
        PagerStyle-Mode="NextPrev"
        pagesize="10"
        OnPageIndexChanged="ChangePage">
      <Columns>
        <asp:BoundColumn HeaderText="人员编号" ReadOnly="True" DataField="SID" ItemStyle-Wrap="false"/>
        <asp:BoundColumn HeaderText="年月" DataField="YearMonth"/>
        <asp:BoundColumn HeaderText="姓名" DataField="cname"/>
        <asp:BoundColumn HeaderText="应发薪资" DataFormatString="{0:n}" DataField="PayTotalDe" ItemStyle-HorizontalAlign="right"/>
        <asp:BoundColumn HeaderText="扣款合计" DataFormatString="{0:n}" DataField="MinusTotal" ItemStyle-HorizontalAlign="right"/>
        <asp:BoundColumn HeaderText="福利金" DataFormatString="{0:n}" DataField="WellFare" ItemStyle-HorizontalAlign="right"/>
        <asp:BoundColumn HeaderText="实发薪资" DataFormatString="{0:n}" DataField="Pay" ItemStyle-HorizontalAlign="right"/>
      </Columns>
</ASP:DataGrid>
</form>