<%@ Page Language="c#" Inherits="Web.User.manageResear" CodeBehind="manageResear.aspx.cs" %>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>网站调查</title>
    <!--#include file="../Css/head.htm"-->
</head>
<body>
    <form id="newsMange" method="post" runat="server">
        <div class="list-func-box func-box">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li>
                        <i class="ace-icon fa  fa-desktop"></i>
                        <asp:Label ID="lbpageNav" runat="server" Text=""></asp:Label>
                    </li>
                </ul>
                <div class="user-service">
                    <span data-original-title="提示:" data-placement="left" data-rel="popover" data-content="网站调查栏目和问卷调查栏目是有区别的，当前是网站调查栏目，只有一个主题，主题就是调查的问题" data-trigger="hover"><i class="fa fa-question-circle bigger-120 blue"></i></span>
                </div>
            </div>
            <div class="page-content">
                <!-- PAGE CONTENT BEGINS -->
                <div class="page-header clearfix">
                    <div class="pull-left">
                        <asp:Button ID="add" class="btn btn-sm btn-primary" runat="server" Text="保存主题" CausesValidation="False" OnClick="Btn_Click" OnClientClick="return checktitle()"></asp:Button>
                        调查主题：
                <asp:TextBox ID="title" runat="server" class="input-md w3"></asp:TextBox>
                        <asp:Label ID="lbMsg" runat="server" Text=""></asp:Label>
                    </div>
                    <!--/action-field-->
                    <div class="pull-right">
                        调查选项：
                <asp:TextBox ID="name" class="input-md" runat="server"></asp:TextBox>
                        <asp:Button ID="ok" class="btn btn-sm btn-primary" runat="server" Text="添 加" OnClientClick="return checkall()" OnClick="Btn_Click"></asp:Button>
                    </div>
                    <!--/search-box-->

                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <asp:GridView ID="GridView1" runat="server" OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound" EmptyDataText="暂无数据…"
                             AutoGenerateColumns="False" class="table table-striped table-bordered table-hover table-sorting">
                            <Columns>
                                <asp:BoundField DataField="pkId" HeaderText="ID号" HeaderStyle-CssClass="title" />
                                <asp:BoundField DataField="name" HeaderText="调查选项" HeaderStyle-CssClass="title" />
                                <asp:BoundField DataField="counter" HeaderText="得票数" HeaderStyle-CssClass="title" />
                                <asp:TemplateField HeaderText="管理" HeaderStyle-CssClass="title" ItemStyle-CssClass="td-a">
                                    <ItemTemplate>
                                        <div class="action-buttons">
                                            <asp:LinkButton ID="edit" runat="server" CommandName="editt" CausesValidation="False" data-toggle="tooltip" data-placement="bottom" Visible="false" title="编辑" CommandArgument='<%# Eval("pkId")+"&"+Eval("name") %>'><i class="ace-icon fa fa-pencil bigger-120 blue" ></i></asp:LinkButton>
                                             <asp:LinkButton ID="edit1" runat="server" data-toggle="tooltip" data-placement="bottom" title="很抱歉，您没有权限编辑" Visible="false" Enabled="false"><i class="ace-icon fa fa-pencil bigger-120 grey"></i></asp:LinkButton>
                                            <asp:LinkButton ID="del" runat="server" CommandName="del" CausesValidation="False" Visible="false" OnClientClick="return confirm('确认要删除本项吗？')" data-toggle="tooltip" data-placement="bottom" title="删除" CommandArgument='<%# Eval("pkId")+"&"+Eval("name") %>'><i class="ace-icon fa fa-trash bigger-120 red" ></i></asp:LinkButton>
                                            <asp:LinkButton ID="del1" runat="server" data-toggle="tooltip" data-placement="bottom" title="很抱歉，您没有权限删除" Visible="false" Enabled="false"><i class="ace-icon fa fa-trash bigger-120 grey"></i></asp:LinkButton>
                                        </div>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </div>
                    <!-- PAGE CONTENT ENDS -->
                </div>
            </div>
        </div>
    </form>
    <!--#include file="../Css/foot.htm"-->
    <script type="text/javascript">
        function checktitle() {
            //验证
            var dctitle = document.getElementById("title").value;
            if (dctitle == "") {
                alert("调查主题不能为空！");
                return false;
            }
            return true;
        }
        function checkall() {

            //验证
            var dctitle = document.getElementById("title").value;
            if (dctitle == "") {
                alert("调查主题不能为空！");
                return false;
            }
            var dcname = document.getElementById("name").value;
            if (dcname == "") {
                alert("调查选项不能为空！");
                return false;
            }
            return true;
        }
    </script>
</body>
</html>
