<%@ page language="C#" autoeventwireup="true" inherits="V5Shop.Admin.Document_Document_Manage, V5Shop.Shop.Article" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Src="control/ManageHeader.ascx" TagName="ManageHeader" TagPrefix="uc3" %>

<%@ Register Src="control/PageBottom.ascx" TagName="PageBottom" TagPrefix="uc2" %>
<%@ Register Src="control/HiddenField.ascx" TagName="HiddenField" TagPrefix="uc1" %>
<%@ Register TagPrefix="V5Shop" Namespace="V5Shop.Control" Assembly="V5Shop.Control" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>文档管理</title>
    <link href="css/css.css" rel="stylesheet" type="text/css">
    <link href="css/css_list.css" rel="stylesheet" type="text/css">
    <link href="css/control.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" language="javascript" src="js/Common.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <uc3:ManageHeader ID="ManageHeader1" runat="server" />
    
        <div id="searcharea">
            <asp:Label ID="lblName" runat="server" Text="文档名称：" ForeColor="#4B6888" Font-Bold="true" meta:resourcekey="lblTitleResource1"></asp:Label>
            <asp:TextBox ID="txtName" Width="100px" runat="server" meta:resourcekey="txtTitleResource2"></asp:TextBox>

            <asp:Label ID="lblCategory" runat="server" Text="文档类别：" ForeColor="#4B6888" Font-Bold="true" meta:resourcekey="lblAuthorResource1"></asp:Label>
            <asp:DropDownList ID="listCategory" runat="server"></asp:DropDownList>
            
            <asp:Button ID="btnSearch" runat="server" Text="查询" OnClick="btnSearch_Click" meta:resourcekey="btnSearchResource1" CssClass="button" />
        </div>
          
        <div id="content">
            <div id="tool">
              <input type="checkbox" id="CheckAllBox" class="checkbox" onclick="CheckAll()" /> 全选
        　    <asp:LinkButton ID="btnAdd" runat="server" ForeColor="#4B6888" OnClick="btnAdd_Click" CausesValidation="false" meta:resourcekey="btnAddResource2"><img src="images/icon/key_add.gif" /> 添加</asp:LinkButton>
        　    <asp:LinkButton ID="btnEdit" runat="server" ForeColor="#4B6888" OnClick="btnEdit_Click" CausesValidation="false" OnClientClick="return CheckEdit()" meta:resourcekey="btnEditResource2"><img src="images/icon/key_edit.gif" /> 编辑</asp:LinkButton>
        　    <asp:LinkButton ID="btnDel" runat="server" ForeColor="#4B6888" OnClick="btnDel_Click" CausesValidation="false" OnClientClick="return CheckDel()" meta:resourcekey="btnDelResource2"><img src="images/icon/key_delete.gif" /> 删除</asp:LinkButton>
        　  </div>
            
            <div class="listborder">
            <V5Shop:V5ShopGridView ID="GridViewShow" runat="server" meta:resourcekey="GridViewShowResource1" 
                AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CssClass="datalist" 
                HeaderStyle-Height="18px" HeaderStyle-ForeColor="#000" EmptyDataText="没有查询到任何记录" TableName="Attachment">
                    <Columns>
                        <asp:TemplateField ItemStyle-Width="5%">
                            <ItemTemplate>
                                <input runat="server" class="checkbox" Value='<%# Eval("ID") %>' ID="CheckBoxID" type="checkbox" onmouseover="this.mouse='over'" onmouseout="this.mouse='out'" mouse="out">
                            </ItemTemplate>
                        <itemstyle horizontalalign="Center"  /></asp:TemplateField>
                        <asp:BoundField DataField="id" ItemStyle-Width="10%" SortExpression="ID" ItemStyle-ForeColor="#4B6888" HeaderText="ID" meta:resourcekey="BoundFieldResource1"/>
                        <asp:BoundField DataField="Name" ItemStyle-Width="30%" SortExpression="Name" ItemStyle-ForeColor="#000" HeaderText="文档名称" meta:resourcekey="BoundFieldResource2" />
                        <asp:TemplateField ItemStyle-Width="10%" HeaderText="文档">
                            <ItemTemplate>
                                <a href="../<%# Eval("Src") %>" target="_blank" style="text-decoration:underline;">下载</a>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="CategoryName" ItemStyle-Width="15%" SortExpression="CategoryName" HeaderText="文档类别" meta:resourcekey="BoundFieldResource5" />
                        <asp:BoundField DataField="Description" ItemStyle-Width="30%" SortExpression="Description" HeaderText="描述" meta:resourcekey="BoundFieldResource4" />
                    </Columns>
                </V5Shop:V5ShopGridView>
   
            </div>
            
            <asp:Panel ID="AddField" runat="server" Visible="false" Width="100%">
                <div align="center" style="background: #f1f1f1">
					<table cellpadding="0" cellspacing="0">
						<tr>
							<td width="20%" height="30" align="right">
							<asp:Label ID="lblDocumentCategory" runat="server" Text="文档类别：">
							</asp:Label>
							</td>
							<td align="left">
							<asp:DropDownList ID="listDocumentCategory" AppendDataBoundItems="true" runat="server">
							</asp:DropDownList>
							<input type="button" value="管理" onclick="window.location.href='Document_Category_Manage.aspx'" class="button" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="listDocumentCategory"
                                    ErrorMessage="请选择文档类别"></asp:RequiredFieldValidator></td>
						</tr>
						<tr>
							<td width="20%" height="30" align="right">
							<asp:Label ID="lblNameAdd" runat="server" Text="文档名称：">
							</asp:Label>
							</td>
							<td align="left">
							<asp:TextBox ID="txtNameAdd" runat="server" Width="300px" MaxLength="20"></asp:TextBox>
							<span class="NeedMsg">*</span>
							<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="不能为空" ControlToValidate="txtNameAdd">
							</asp:RequiredFieldValidator>
							</td>
						</tr>
						<tr>
							<td width="20%" height="30" align="right">
                                <V5Shop:HelpCtrl ID="HelpCtrl1" runat="server" FontColor="red" Header="文档格式" ImageURL="images/help.gif"
                                    Text="注意：只支持压缩文件(rar,zip)、Word文档(doc)、Excel(xls)格式文档。" />
							<asp:Label ID="lblSrc" runat="server" Text="上传文档：">
							</asp:Label>
							</td>
							<td align="left">
							<asp:FileUpload ID="fileSrc" runat="server" Width="300px" />
							<span class="NeedMsg">*</span>
							<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="不能为空" ControlToValidate="fileSrc">
							</asp:RequiredFieldValidator>
							</td>
						</tr>
						<tr>
							<td width="20%" height="30" align="right">
							<asp:Label ID="lblDescritpion" runat="server" Text="简单描述：">
							</asp:Label>
							</td>
							<td align="left">
							<asp:TextBox ID="txtDescription" TextMode="MultiLine" Width="300px" Height="40px" runat="server">
							</asp:TextBox>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtDescription"
                                    ErrorMessage="长读必须在250字以内" ValidationExpression="^[\s\S]{0,250}$"></asp:RegularExpressionValidator></td>
						</tr>
						<tr>
							<td width="20%" height="30" align="right"></td>
							<td align="left">
							<asp:Button ID="btnAddSubmit" runat="server" Text="确定" OnClick="btnAddSubmit_Click" meta:resourcekey="btnAddResource1" CssClass="button" />
							<asp:Button ID="btnEditSubmit" runat="server" Text="更新" OnClick="btnEditSubmit_Click" Visible="False" meta:resourcekey="btnEditResource1" CssClass="button" />
							<input id="iptReset" runat="server" type="reset" value="重置" class="button" />
							</td>
						</tr>
					</table>
				</div>
            </asp:Panel>
        </div>
        
        <div id="hiddenfield">
            <asp:HiddenField ID="CheckedIDS" runat="server" Value="0" />
            <asp:HiddenField ID="PageIndex" runat="server" Value="0"/>
            <asp:HiddenField ID="MaxPageIndex" runat="server" Value="0"/>
            <uc1:HiddenField ID="Alert" runat="server" />
        </div>
        <uc2:PageBottom ID="PageBottom1" runat="server" />
    </div>
    </form>
</body>
</html>
