文件操作 - EmployeeDocument.aspx
返回文件管理
返回主菜单
删除本文件
文件: E:\HostingSpaces\kimblycr\howell.kimbly.in\wwwroot\EmployeeDocument.aspx
编辑文件内容
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EmployeeDocument.aspx.cs" Inherits="HowellWebService.EmployeeDocument" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <link href="css/bootstrap.css" rel="stylesheet" /> </head> <body> <form id="form1" runat="server"> <div style="padding-left: 10px;"> <h3>Manage Employee Documents</h3><hr style="width:100%" /> <div> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="ID" DataSourceID="SqlDataSource2" ForeColor="#333333" GridLines="None" Width="298px"> <AlternatingRowStyle BackColor="White" ForeColor="#284775" /> <Columns> <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" /> <asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" /> <asp:BoundField DataField="FileName" HeaderText="FileName" SortExpression="FileName" /> <asp:CommandField ShowDeleteButton="True" /> </Columns> <EditRowStyle BackColor="#999999" /> <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /> <RowStyle BackColor="#F7F6F3" ForeColor="#333333" /> <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /> <SortedAscendingCellStyle BackColor="#E9E7E2" /> <SortedAscendingHeaderStyle BackColor="#506C8C" /> <SortedDescendingCellStyle BackColor="#FFFDF8" /> <SortedDescendingHeaderStyle BackColor="#6F8DAE" /> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" DeleteCommand="Delete EmployeeDocuments where ID = @ID" SelectCommand="Select e.ID,T.Name As Type,d.FileName from EmployeeDocuments e inner join Documents d on e.documentID = d.ID inner join DocumentTypes T on e.DocumentTypeID = T.ID where EmpID = @EmpID"> <DeleteParameters> <asp:Parameter Name="ID" /> </DeleteParameters> <SelectParameters> <asp:Parameter Name="EmpID" /> </SelectParameters> </asp:SqlDataSource> </div> <div style="margin-top: 50px;"><h4>Add Employee Document</h4><hr style="width:100%" /></div> <div> <div class="form-group" style="padding-bottom: 20px;"><label class="col-sm-2 control-label">Document Type</label> <div class="col-sm-4"> <asp:DropDownList ID="DDLDocType" runat="server" Height="25px" Width="274px" CssClass="form-control" DataSourceID="SqlDataSource1" DataTextField="Name" DataValueField="ID"> </asp:DropDownList> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" SelectCommand="SELECT * FROM [DocumentTypes] ORDER BY [ID]"></asp:SqlDataSource> </div> </div> <div class="form-group" style="clear: both;margin-top: 20px;"><label class="col-sm-2 control-label">Document</label> <div class="col-sm-4"> <asp:FileUpload ID="FileUpload1" runat="server" /> </div> </div> <div class="form-group" style="clear: both;margin-left: 250px;"> <asp:Button ID="BtnUpload" runat="server" Text="Upload" CssClass="btn btn-success" OnClick="BtnUpload_Click" Style="margin-top:10px"/> </div> </div> </div> </form> </body> </html>
修改文件时间
将文件时间修改为当前时间的前一年
删除文件