<%@ Page language="c#" Codebehind="upload.aspx.cs" AutoEventWireup="True" Inherits="health.aspx.upload" %>
<%@ Register TagPrefix="uc1" TagName="Pager" Src="../../modules/Pager.ascx" %>

<HTML>
	<HEAD>
		<title>批量上传工资数据</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<LINK href="../../css/style.css" type="text/css" rel="stylesheet">
		<script language="JavaScript" src="../../js/common.js" type="text/javascript"></script>
		<script language="javascript" src="../../js/My97DatePicker/WdatePicker.js" defer type="text/javascript"></script>

	</HEAD>
	<body>
		<form id="form1" runat="server">
		<br>
			<table id="Table4" align="center"  border="0" cellpadding="3" cellspacing="0" width="90%">
                <tr>
                    <td >
                    <table align="center"  width="100%" border="1" cellpadding="3" cellspacing="0" class="sys_grid" >
                     <tr style="height: 30px">
                         <td td style="font-size: 12pt; color: black; background-color: #f0f8fa;" align="center" colspan="2">
                       <asp:Label ID="Label8" runat="server" Text="批量上传数据" Font-Size="14pt" Font-Bold="True"></asp:Label></td>
                                 </tr>
                        <tr style="height: 30px">
                            <td align="right" rowspan="1" style="width: 30%">
                                <asp:Label ID="Label1" runat="server" Text="体检表模版："></asp:Label></td>
                            <td align="left">
                                <asp:DropDownList ID="ddl_type" runat="server"  ></asp:DropDownList>
                                <asp:Button ID="btn_download" runat="server" CssClass="sys_button" OnClick="btn_download_Click"
                                    Text="下载模版" /></td>
                        </tr>
                            <tr style="height:30px">
                                <td style="width: 30%" align="right" rowspan="1">
                                    <asp:Label ID="Label6" runat="server" Text="上传体检表："></asp:Label>
                                </td>
                                <td align="left">
                                    <asp:Label ID="Label3" runat="server" Font-Size="10pt" ForeColor="Red" Text="注意：1)上传文件扩展名必须为xls；2)工作表名称必须为sheet1；"></asp:Label><br />
                                <INPUT id="fileup" style="WIDTH: 60%" type="file" size="50" name="fileup" runat="server" class="stringedit">&nbsp;&nbsp;
                                    <asp:CheckBox ID="ck" runat="server" onclick="b()" Text="选择有效区域" /></td>
                            </tr>
                            <tr id="tr" style='DISPLAY: none;'>
                                <td align="right" style="width: 30%">
                                    <asp:Label ID="Label4" runat="server" Text="上传表有效区域："></asp:Label></td>
                                <td align="left">
                                    &nbsp;<asp:Label ID="Label5" runat="server" Text="行数(1,2,3...)"></asp:Label>
                                    <asp:TextBox ID="tb_hs" runat="server" Width="50px"></asp:TextBox>
                                    &nbsp; &nbsp;
                                    <asp:Label ID="Label11" runat="server" Text="列号(英文A,B,C...)"></asp:Label>
                                    <asp:TextBox ID="tb_ls" runat="server" Width="50px"></asp:TextBox></td>
                            </tr> 
                             <tr style="height:30px">
                                <td align="center" colspan="2" style="height: 30px" valign="middle"><asp:button id="btn_upload" runat="server" CssClass="sys_button" Text="上传数据" onclick="btn_upload_Click"></asp:button></td>
                            </tr>
                       </table><br>
                        <asp:Label ID="Label9" runat="server" Text="上传记录" Font-Bold="True" Font-Size="10pt"></asp:Label>
                        <asp:GridView ID="gdv" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                            CssClass="sys_grid" OnRowDataBound="gdv_RowDataBound" Width="100%">
                            <HeaderStyle CssClass="sys_grid_head_cell" />
                            <Columns>
								<asp:BoundField  HeaderText="序号" />
								<asp:BoundField  DataField="Name" HeaderText="文件名" />
                                <asp:TemplateField HeaderText="文件名">
                                    <ItemTemplate>
                                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%#getpath(DataBinder.Eval(Container.DataItem, "Name"))%>'><%#DataBinder.Eval(Container.DataItem, "Name")%></asp:HyperLink>
                                    </ItemTemplate> 
                                </asp:TemplateField>
                                <asp:BoundField DataField="LastWriteTime" DataFormatString="{0:yyyy-MM-dd HH:mm:ss}" HeaderText="最后修改时间" HtmlEncode="False" />
                                <asp:BoundField DataField="Length" HeaderText="文件大小" DataFormatString="{0:#,### 字节}" />
                            </Columns>
                            <PagerSettings Visible="False" />
                            <RowStyle Height="25px" HorizontalAlign="Center" />
                        </asp:GridView>
                       <uc1:pager id="Pager1" runat="server"></uc1:pager><INPUT id="hd" type="hidden" name="hd" runat="server"> 
                    </td>
                </tr>

			</TABLE>
            <br >
            <table align="center" border="0"  width="90%" cellpadding="3" cellspacing="0">
                <tr>
                    <td style="height: 18px">
                        <asp:Label id="Label2" runat="server" ForeColor="Red"></asp:Label></td>
                </tr>
            </table>
		</form>
		<script language=javascript>
		     function add_model()
			 { 
			     window.showModalDialog('../showModal.aspx?url=gz/add_model.aspx','','dialogWidth:350px;dialogHeight:250px;help:no;status:no;dialogHide:yes;scrollbars:no;center:yes');
			     window.location="updata.aspx";
			 }  
			 function excel_jpg()
		     {
    	        window.open ('../../Image/excel1.jpg', '', 'height=400, width=600, top=0, left=0, toolbar=no, menubar=no, scrollbars=no,resizable=no,location=no, status=no') 
   		     }
   		    function b()
	        {
	          if(document.getElementById("ck").checked)
	            document.getElementById("tr").style.display="inline";
	          else
	            document.getElementById("tr").style.display="none";
	        
	        }

		</script>
	</body>
</HTML>
