<%@ 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">


    
<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:BoundField DataField="begintime" HeaderText="开始时间" DataFormatString="{0:yyyy-MM-dd}" ItemStyle-Width="100px" />
                 <asp:BoundField DataField="endtime" HeaderText="结束时间"  DataFormatString="{0:yyyy-MM-dd}" ItemStyle-Width="100px" />
                
             <asp:HyperLinkField HeaderStyle-Width="500px" HeaderText="调查主题" DataNavigateUrlFields="id" Target="_blank"  DataNavigateUrlFormatString="pages.aspx?activeid={0}" DataTextField="title" />     
          
          
               <asp:CommandField  ShowDeleteButton="true" DeleteText="删除"/>
               
               
                    
             <asp:TemplateField  ItemStyle-Width="220px" >
             <HeaderTemplate>
            操作
             </HeaderTemplate>
             <ItemTemplate>
                 <a href='Survey_Voteresult.aspx?activeid=<%#Eval("id") %>' target="_blank"   >结果</a>
                   <a href='Step_Survey_0.aspx?activeid=<%#Eval("id") %>' target="_blank"   >更改标题</a>
                  <a href='Step_Survey_1.aspx?activeid=<%#Eval("id") %>' target="_blank"   >更改选项</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>
