<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="JobCat.aspx.cs" Inherits="Portal.Admin.JobCat" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<div class="result-wrap">
       <div class="result-title">
                <h1>招聘类别管理</h1>
        </div>

 
 <table class="table">
         <tr>
         <th width=150px>新建类别</th>
         <td>
        <asp:TextBox ID="catname" runat="server"  CssClass="form-control"  Width=390px></asp:TextBox> 
         </td>
        </tr>
        
        <tr>
        <th>顺序序号</th>
        <td>
        <asp:TextBox ID="txt_orderid"   CssClass="form-control" runat="server" Text="0"></asp:TextBox> 
        
        </td>
        </tr>

        <tr>
        <td colspan="2">
        
        <div class="btnc">
        

 
    
    <asp:Button ID="Button1" CssClass="btn btn-primary" runat="server" Text="添加" onclick="Button1_Click" />

    <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="返回" CssClass="btn"/>
    

        </div>
        </td>
        
        </tr>

        </table>



 
    
    

  <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"   CssClass="table" GridLines="None"
        DataKeyNames="id" DataSourceID="SqlDataSource1">
      <Columns>
          
          <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
              ReadOnly="True" SortExpression="id"  ItemStyle-Width="90px"/>
          <asp:BoundField DataField="catname" HeaderText="类别名称" 
              SortExpression="catname" />
          <asp:BoundField DataField="orderid" HeaderText="orderid" 
              SortExpression="orderid"   ItemStyle-Width="80px"/>
          <asp:BoundField DataField="moduleid"  Visible="false"  HeaderText="moduleid" 
              SortExpression="moduleid" />

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

      </Columns>
       
    
    
    </asp:GridView>
    <asp:SqlDataSource 
     ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
    
    
    ID="SqlDataSource1" runat="server" 
        DeleteCommand="DELETE FROM [portal_jobcat] WHERE [id] = @id" 
        InsertCommand="INSERT INTO [portal_jobcat] ([catname], [orderid], [moduleid]) VALUES (@catname, @orderid, @moduleid)" 
        ProviderName="System.Data.SqlClient" 
        SelectCommand="SELECT * FROM [portal_jobcat] where moduleid=@moduleid ORDER BY [orderid] asc " 
        UpdateCommand="UPDATE [portal_jobcat] SET [catname] = @catname, [orderid] = @orderid WHERE [id] = @id"
             onselecting="SqlDataSource1_Selecting"
        
        >
       
        <SelectParameters>
          <asp:Parameter Name="moduleid" Type="Int32"  DefaultValue="0"/>
       </SelectParameters>
       
        <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>
    
    </div>

</asp:Content>
