<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkPro.aspx.cs" Inherits="ComResProSystem.WorkPro" %>

<!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>
    <style type="text/css">
        body
        {
            margin: 0px;
            padding: 0px;
            font-size: 12px;
        }
        .table
        {
            border-collapse: collapse;
            height: 24px;
            line-height: 24px;
            text-align: center;
        }
        .table tr
        {
            border-right: solid 1px #FFF;
            border-left: solid 1px #000000;
        }
        .table tr td
        {
            border: solid 1px #000000;
        }
        .classtd
        {
            background-image: url(Image/tab/tab_14.gif);
            height: 26px;
            background-repeat: repeat-x;
            text-align: center;
        }
    </style>
     <script type="text/javascript">
        function checkall() {
            var objmail = document.getElementById("pro");
            var obj = objmail.getElementsByTagName("input");
            if (document.getElementById("ck_all").checked) {
                for (var i = 0; i < obj.length; i++) {
                    if (obj[i].type == "checkbox") {
                        obj[i].checked = true;
                    }
                }
            }
            else {
                for (var i = 0; i < obj.length; i++) {
                    if (obj[i].type == "checkbox") {
                        obj[i].checked = false;
                    }
                }
            }
            document.getElementById("ck_rechoice").checked = false;
        }
        function rechoice() {
            var objmail = document.getElementById("pro");
            var obj = objmail.getElementsByTagName("input");
            if (document.getElementById("ck_rechoice").checked) {
                for (var i = 0; i < obj.length; i++) {
                    if (obj[i].type == "checkbox") {
                        obj[i].checked = !obj[i].checked;
                    }
                }
                document.getElementById("ck_all").checked = false;
            }

        }
        function check() {
            var bool = false;
            var objmail = document.getElementById("pro");
            var obj = objmail.getElementsByTagName("input");
            for (var i = 0; i < obj.length; i++) {
                if (obj[i].type == "checkbox") {
                    if (obj[i].checked) {
                        bool = true;
                        break;
                    }
                }
            }
            if (!bool) {
                alert("请选择要删除项！")
                return bool;
            }
            else {
                return confirm("您确定要执行删除操作吗？");
            }
        }
        </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div style="background-image: url(Image/tab/tab_05.gif); height: 25px; background-repeat: repeat-x">
            <img src="Image/tab/311.gif" alt="" /><span style="font-size: 12px; color: #1F4A65;
                font-weight: bold;">工作计划</span>
        </div>
        <div align="right" style="padding-top: 10px; padding-right: 10px">
            <asp:LinkButton ID="Lb_ProAdd" runat="server" OnClick="Lb_ProAdd_Click">添加工作计划</asp:LinkButton>
        </div>
        <div>
            <table>
                <tr>
                    <td>
                        工作计划类型:
                    </td>
                    <td>
                        <asp:DropDownList ID="Dd_ProType" runat="server">
                            <asp:ListItem>个人工作计划</asp:ListItem>
                            <asp:ListItem>下属工作计划</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Image/Bt_Select.gif"
                            OnClick="ImageButton1_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <div align="center" style="margin-top: 10px">
            <asp:Repeater ID="Rp_Pro" runat="server">
                <HeaderTemplate>
                    <table class="table" id="pro" width="80%">
                        <tr>
                            <td class="classtd">
                                编号
                            </td>
                            <td class="classtd">
                                选择
                            </td>
                            <td class="classtd">
                                主题
                            </td>
                            <td class="classtd">
                                作者
                            </td>
                            <td class="classtd">
                                计划内容
                            </td>
                            <td class="classtd">
                                时间
                            </td>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td>
                            <%#Container.ItemIndex+1 %>
                        </td>
                        <td>
                            <asp:CheckBox ID="Ck_Check" runat="server" />
                        </td>
                        <td style=" display:none">
                            <asp:Label ID="Lb_ID" runat="server" Text='<%#Eval("ID") %>'></asp:Label>
                        </td>
                        <td>
                           <a href='ShowWorkPro.aspx?ID=<%#Eval("ID") %>'><%#Eval("Theme") %></a>
                        </td>
                        <td>
                         <%#Eval("AddUser") %>
                        </td>
                        <td>
                        <%#Eval("Contents").ToString().Length > 6 ? Eval("Contents").ToString().Substring(0, 6) + "……" : Eval("Contents").ToString()%>
                        </td>
                        <td>
                        <%#Eval("AddTime")%>
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    
                    </table>
                    <asp:Label ID="Label1" runat="server" Visible='<%#Rp_Pro.Items.Count>0?false:true%>' Text="温馨提示:当前没有符合条件的数据！"></asp:Label>
                </FooterTemplate>
            </asp:Repeater>
        </div>
        <div id="div" runat="server" style="width:80%;margin:0px auto;display:none">
            <div style="width: 150px; float: left;">
                <input id="ck_all" type="checkbox" onclick="checkall()" />全选
                <input id="ck_rechoice" type="checkbox" onclick="rechoice()" />反选
                <asp:LinkButton ID="Lb_Del" runat="server" OnClientClick=" return check()" 
                    onclick="Lb_Del_Click">删除</asp:LinkButton>
            </div>
            <div style="float: right">
                <table>
                    <tr>
                        <td>
                            总共<asp:Label ID="Lb_Total" runat="server" Text=""></asp:Label>页
                        </td>
                        <td>
                            当前第<asp:Label ID="Lb_Now" runat="server" Text=""></asp:Label>页
                        </td>
                        <td>
                            <asp:ImageButton ID="Ibt_Firsr" runat="server" ImageUrl="~/Image/tab/first.gif" 
                                onclick="Ibt_Firsr_Click" />
                        </td>
                        <td>
                            <asp:ImageButton ID="Ibt_Pre" runat="server" ImageUrl="~/Image/tab/back.gif" 
                                onclick="Ibt_Pre_Click" />
                        </td>
                        <td>
                            <asp:ImageButton ID="Ibt_Next" runat="server" ImageUrl="~/Image/tab/next.gif" 
                                onclick="Ibt_Next_Click" />
                        </td>
                        <td>
                            <asp:ImageButton ID="Ibt_Last" runat="server" ImageUrl="~/Image/tab/last.gif" 
                                onclick="Ibt_Last_Click" />
                        </td>
                        <td>
                            <asp:TextBox ID="Tb_goto" runat="server" Height="12px" Width="15px"></asp:TextBox>
                            <asp:ImageButton ID="Ibt_goto" runat="server" ImageUrl="~/Image/tab/go.gif" 
                                onclick="Ibt_goto_Click" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
