<%@ Page Title="" Language="C#" MasterPageFile="~/helpdesk/Survey.master" AutoEventWireup="true" CodeBehind="Survey_Mgr.aspx.cs" Inherits="helpdesk.helpdesk.Survey_Mgr" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">

    <style>
        .green{ color:green }
    </style>
    
<div>
调查管理
</div>

 

    
<asp:GridView CssClass="table table-hover" ID="GridView1"  
     runat="server" 
    AutoGenerateColumns="False"  GridLines="None" 
    DataKeyNames="id" 
    DataSourceID="SqlDataSource1"    
    AllowPaging="true" 
    PageSize=20 
    EmptyDataText="当前没有数据"  
          >
            <Columns>
            
            <asp:BoundField DataField="id" HeaderText="编号" ReadOnly="true"  ItemStyle-Width="50px"/>
            <asp:BoundField DataField="username"  ReadOnly="true" HeaderText="调查制作者" ItemStyle-Width="100px" />
          
                
           <asp:TemplateField  ItemStyle-Width="100px" >
             <HeaderTemplate>
              开始日期
             </HeaderTemplate>
             <ItemTemplate>
                 <%# GetDay(Eval("begintime"),Eval("endtime"))  %>
                </ItemTemplate>
                         </asp:TemplateField>

                
                  <asp:HyperLinkField HeaderStyle-Width="500px" HeaderText="调查主题" DataNavigateUrlFields="id" Target="_blank"  DataNavigateUrlFormatString="pages.aspx?activeid={0}" DataTextField="title" />     
           
                
             
             <asp:TemplateField  ItemStyle-Width="300px" >
             <HeaderTemplate>
              操作
             </HeaderTemplate>
             <ItemTemplate>
            
                <a href='pages.aspx?activeid=<%#Eval("id") %>' target="_blank"  class="btn btn-sm btn-primary"  >查看</a>
                <a href='Survey_Voteresult.aspx?activeid=<%#Eval("id") %>' target="_blank"  class="btn btn-sm btn-success" >投票结果</a>
              
                  <a href='Step_Survey_0.aspx?activeid=<%#Eval("id") %>' target="_blank"  class="btn btn-sm btn-info" >更新标题</a>
                  <a href='Step_Survey_1.aspx?activeid=<%#Eval("id") %>' target="_blank"  class="btn btn-sm btn-info" >更新选项</a>

                    <a href="###"  class="btn btn-sm del btn-danger"  >删除</a>

              </ItemTemplate>
               </asp:TemplateField>
               
               
             </Columns>
            
            
        </asp:GridView>

 
 
 
 
 
 <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            SelectCommand="SELECT * FROM [survery_defineactive]   order by id desc" 
            DeleteCommand=" delete from survery_defineactive where id=@id "
            updatecommand=" update survery_defineactive set begintime=@begintime, endtime=@endtime ,title=@title where id=@id"
           >
         <DeleteParameters>
           <asp:Parameter Name="id" Type="Int32" />
         </DeleteParameters>
         <UpdateParameters>
            <asp:Parameter Name="id" Type="Int32" />
            <asp:Parameter Name="begintime"  Type="DateTime" />
            <asp:Parameter Name="endtime" Type="DateTime"  />
            <asp:Parameter Name="title" Type="String" />
       
         </UpdateParameters>
        </asp:SqlDataSource>
  
       
        
 


</asp:Content>
