<%@ Page Language="C#" MasterPageFile="~/Master/officeMaster.master" AutoEventWireup="true" CodeFile="FirstPage.aspx.cs" Inherits="News_FirstPage" Title="无标题页" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script src="../My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
           //判断是否删除（关闭提示框会默认确定删除）
            function IsDelete(){
                if(confirm("确定要删除该公告吗?")){
                    return true;
                }
                else{
                    return false;
                }
            }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div>
        发布时间：从
                <asp:TextBox ID="txtStateTime" runat="server" onfocus="WdatePicker()" Width="140"></asp:TextBox>
                到
                <asp:TextBox ID="txtEndTime" runat="server" onfocus="WdatePicker()" Width="140"></asp:TextBox>&nbsp;&nbsp;
        标题：<asp:TextBox ID="txtTitle" runat="server" Width="100"></asp:TextBox>&nbsp;&nbsp;
        发布部门：<asp:DropDownList ID="ddlDepartment" runat="server"></asp:DropDownList>&nbsp;&nbsp;
        <asp:Button ID="btnSelect" runat="server" Text="查 询"  Width="72" BackColor="#CCCCCC" onclick="btnSelect_Click" />&nbsp;&nbsp;
        <asp:Button ID="btnAdd" runat="server" Text="添加公告"  Width="72" BackColor="#CCCCCC" onclick="btnAdd_Click" />
    </div>
    <table class="usertableborder" cellspacing="1" cellpadding="3" width="100%" align="center" border="1">
                <tr>
                    <%--<td>
                    <input type="checkbox" id="chkALL" runat="server" />全选
                </td>--%>
                    <th>
                        标题
                    </th>
                    <th>发布部门</th>
                    <%--<td>
                        公告内容
                    </td>--%>
                    <th>
                        上传文件名
                    </th>
                    <th>文件号</th>
                    
                    <th>
                        发布时间
                    </th>
                    <%--<th>
                        操作时间
                    </th>--%>
                    <th>
                        操作人
                    </th>
                    <th align="center">
                        操作
                    </th>
                </tr>
                <asp:Repeater ID="rptNews" runat="server" OnItemCommand="rptNews_ItemCommand" OnItemDataBound="rptNews_ItemDataBound">
                    <ItemTemplate>
                        <tr id="trNews" runat="server" align="center"  onmousemove="this.style.backgroundColor='#0099CC'" onmouseout="this.style.backgroundColor='white'">
                            <%--<td>
                            <input type="checkbox" id="chkItem" runat="server" />
                        </td>--%>
                            <td>
                            <asp:LinkButton ID="lbtnSelectContent" runat="server" CommandName="selectContent"><span id="spanNewsTitle" runat="server"><%#Eval("NewsTitle")%></span></asp:LinkButton>
                            </td>
                            <td id="tdDepartmentName" runat="server"><%#GetPublishDepartmentName(Eval("PulishDepartmentId"))%></td>
                            <%--<td>
                               <span id="spanNewsContent" runat="server"><%#Eval("NewsContent") %></span>
                            </td>--%>
                            <td id="tdFileName" runat="server">
                                <%#GetFileName(Eval("FileName"))%>
                            </td>
                            <td id="tdFileNum" runat="server"><%#Eval("FileNum")%></td>
                            <td id="tdCreateTime" runat="server">
                                <%#Eval("CreateTime") %>
                            </td>
                            <%--<td>
                                <%#Eval("UpdateTime")%>
                            </td>--%>
                            <td id="tdHandlerId" runat="server">
                                <%#GetOperationer(Eval("HandlerId"))%>
                            </td>
                            <td>
                                <asp:HiddenField ID="hfNewsId" runat="server" Value='<%#Eval("Nid") %>' /><%--新闻ID--%>
                                <asp:HiddenField ID="hfFileName" runat="server" Value='<%#Eval("FileName") %>' /><%--上传文件名--%>
                                <asp:HiddenField ID="hfFilePath" runat="server" Value='<%#Eval("FilePath") %>' /><%--上传文件路径--%>
                                <asp:HiddenField ID="hfNewsType" runat="server" Value='<%#Eval("NewsType") %>' /><%--公告类型（即带模板1、自定义排版）--%>
                                <asp:LinkButton ID="lbtnSelect" runat="server" CommandName="select" Text="查看"></asp:LinkButton>
                                <asp:LinkButton ID="lbtnDownLoad" runat="server" CommandName="download" Text="下载"></asp:LinkButton>
                                <asp:LinkButton ID="lbtnSelectFile" runat="server" CommandName="selectFile" Text="预览"></asp:LinkButton>
                                <asp:LinkButton ID="lbtnEdit" runat="server" CommandName="edit" Text="编辑"></asp:LinkButton>
                                <asp:LinkButton ID="lbtnDelete" runat="server" CommandName="delete" Text="删除" OnClientClick="return IsDelete();"></asp:LinkButton>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
                <tr>
            <td colspan="7" align="center">
                <span>当前<span id="spanPageCurrent" runat="server">1</span>/<span id="spanPageCount" runat="server"></span>页</span>
                <asp:LinkButton ID="lbtnPageFirst" runat="server" Text="首页"  BackColor="Silver" Width="56px"
                    onclick="lbtnPageFirst_Click"></asp:LinkButton>
                <asp:LinkButton ID="lbtnPageUp" runat="server" Text="上页"  BackColor="Silver" Width="56px"
                    onclick="lbtnPageUp_Click"></asp:LinkButton>
                <asp:LinkButton ID="lbtnPageDown" runat="server" Text="下页"  BackColor="Silver" Width="56px"
                    onclick="lbtnPageDown_Click"></asp:LinkButton>
                <asp:LinkButton ID="lbtnPageLast" runat="server" Text="末页"  BackColor="Silver" Width="56px"
                    onclick="lbtnPageLast_Click"></asp:LinkButton>
            </td>
        </tr>
            </table>
</asp:Content>

