<%@ Page Title="大类设置" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Category1.aspx.cs" Inherits="Helpdesk.Admin.Category1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <div class="result-wrap">


   <div class="result-title">
             <span class="span_help">说明</span>:设定问题Tickets的大类。
     </div>

 
              
      
            <table class="table">
                        <tbody> 
                            <tr>
                                <th width="150">大类名称：</th>
                                <td>
                                   
                                    <asp:TextBox class="form-control"  ValidationGroup="Add" ID="txt_catname" Text="" Width=300px runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ValidationGroup="Add" ID="RequiredFieldValidator1" runat="server" ErrorMessage="必须填写类别" ControlToValidate="txt_catname" Display="Dynamic"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <th>排序数字：</th>
                                <td>
                                    <asp:TextBox  class="form-control"  ID="txt_orderid" Text="0" Width=300px runat="server"></asp:TextBox>
                             </td>
                            </tr>
                            
                            <tr>
                                <th></th>
                                <td>
                                    <asp:Button ID="btn_add" runat="server" Text="添加大类"  ValidationGroup="Add" 
                                        class="btn btn-primary" onclick="btn_add_Click" />
 
                                   
                                </td>
                            </tr>
                        </tbody></table>
 





 
                    <div class="result-list">
                        


                        <asp:LinkButton ID="lb_delete" 
                         OnClientClick="if(!isselect()) return false; " 
                        runat="server" onclick="lb_delete_Click" CssClass="btn btn-danger">批量删除</asp:LinkButton> 
                    
                    
                      <asp:LinkButton ID="lb_update_order" runat="server"  CssClass="btn btn-default"
                            onclick="lb_update_order_Click">
                            
                            更新排序

                            </asp:LinkButton>

                         
   
                </div>
 


 <br /><br />
 
  <div id="thetable"  > 
                    
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"  AllowPaging="false"  
     class="table table-hover" GridLines="None"  
     DataKeyNames="id" DataSourceID="SqlDataSource1">
       
       
        <Columns> 

      <asp:TemplateField> 
        <HeaderTemplate> 
          <input id="cb_selectall" type="checkbox"  value='<%# Eval("id") %>'  /> 
         </HeaderTemplate> 
                            
         <ItemTemplate  > 
            <input type="checkbox"  class="ck_item"   value=<%# Eval("id") %>   />  

            <asp:HiddenField runat="server" ID="hf_id" Value=<%# Eval("id") %> /> 
          </ItemTemplate>    
          <HeaderStyle  Width=50px  />        
       
          </asp:TemplateField>
                        

         <asp:TemplateField>
         <HeaderTemplate>排序</HeaderTemplate>
          <ItemTemplate>
            <asp:TextBox runat="server" Width="80px" class="form-control" Text='<%#Bind("orderId") %>' ID="txt_orderid"></asp:TextBox>
          </ItemTemplate>
           <HeaderStyle  Width=130px  /> 
         </asp:TemplateField> 

      

         <asp:BoundField DataField="catname"   HeaderStyle-Width="600px" HeaderText="类别名称" SortExpression="catname" />

      <asp:CommandField HeaderText="操作" EditText="编辑" DeleteText="<span onclick=&quot;JavaScript:return confirm('确定删除吗？')&quot;>删除</span> "  UpdateText="更新"  CancelText="取消" ShowDeleteButton="True" ShowEditButton="True" />

          
        </Columns>
        
          
    
    </asp:GridView>









                </div>
            
        </div>












        






        <asp:SqlDataSource ID="SqlDataSource1"  
           ConnectionString='<%$ ConnectionStrings:ConnectionString %>'
           Runat="server" 
           DeleteCommand="DELETE FROM [helphesk_categories] WHERE [id] = @id" 
           InsertCommand="INSERT INTO [vote_category] ([name], [orderid]) VALUES (@name, @orderid)" 
           SelectCommand="SELECT * FROM [helphesk_categories] where parentid=0 ORDER BY [orderid] asc " 
           UpdateCommand="UPDATE [helphesk_categories] SET [catname] = @catname,  [orderid] = @orderid WHERE [id] = @id"  >
        <DeleteParameters>
           <asp:Parameter Name="id" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
           <asp:Parameter Name="catname" Type="String" /> 
            <asp:Parameter Name="orderid" Type="Int32" /> 
            <asp:Parameter Name="id" Type="Int32" />
        </UpdateParameters>
        
    </asp:SqlDataSource>
 
     <input type="hidden" name="hf_ids" id="hf_ids" />





 

 


</asp:Content>
