<%@ Register TagPrefix="Title" TagName="TitleShow" Src="/aspnetdata/Title.ascx" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="DataProcess_vb" %>
<html>
<head>
	<script language="VB" runat="server">
	sub bindNew(tag as Boolean)
		Dim ep as UseSql_vb =nothing
		if SQLSeerver.Text="" then
			ep=new UseSql_vb()
		else
			ep=new UseSql_vb(SQLSeerver.Text,uid.Text,Password.Text,"EmploySQL")
		end if
		dim d as string ="SELECT MonthPay.*, Staff.cname,staff.BankID FROM Staff INNER JOIN MonthPay ON Staff.SID = MonthPay.SID"
		allPay.DataSource=ep.GetDataView("MonthPay",d)
		allPay.DataBind()
	end sub
	sub ChangePage(sender as object,e as DataGridPageChangedEventArgs)
		allPay.CurrentPageIndex = e.NewPageIndex
		bindNew(false)
	end sub
	sub OKClick(sender as object,e as EventArgs)
		bindNew(true)
	end sub
	</script>
</head>
<body background="/aspnetdata/images/winback.gif">
<Title:TitleShow id="BookT" Runat="server" />
<form runat="server">
查看 <asp:hyperlink id="h1" NavigateUrl="/aspnetdata/shows.aspx?cate=c&file=ch12/12-4/vb/DataProcess.vb" Text="DataProcess.vb" runat="server" target="_blank"/><br>
SQL服务器名称：<ASP:TEXTBOX Text="Localhost" runat="server" id="SQLSeerver" /><br>
登录ID：<ASP:TEXTBOX Text="sa" runat="server" id="uid" /><br>
密码：<ASP:TEXTBOX Runat="server" TextMode="Password" id="Password" /><ASP:button Text="OK" Runat="server" onclick="OKClick" /><br>
    <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" ItemStyle-Wrap="false"/>
        <asp:BoundColumn HeaderText="银行帐号" DataField="BankID" ItemStyle-HorizontalAlign="right"/>
        <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>
<asp:label id="nn" runat="server" />
</form>