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

    
<div class="result-wrap">
       <div class="result-title">
                <b>关于公司类别</b>
        </div>

       <table class="table">
         <tr>
         <th width=150px>新建类别</th>
         <td>
          <asp:TextBox ID="catname" ValidationGroup="vg_catname" CssClass="form-control"  runat="server"></asp:TextBox>
          <asp:RequiredFieldValidator Display="Dynamic" ValidationGroup="vg_catname" ID="RequiredFieldValidator1" runat="server" ErrorMessage="*" ControlToValidate="catname"></asp:RequiredFieldValidator>

         </td>
        </tr>
        
        <tr>
        <th>顺序序号</th>
        <td>
        <asp:TextBox ID="orderid" ValidationGroup="vg_catname" CssClass="form-control" runat="server" Text="0"></asp:TextBox> 
        
        </td>
        </tr>

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

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


   

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

        </table>

 
  

    <asp:GridView ID="GridView1" AutoGenerateColumns="False"  
    DataKeyNames="itemid" runat="server"  CssClass="table"  GridLines="None" 
    DataSourceID="sds">
    
    <Columns>
  
    
     
    <asp:BoundField DataField="itemid"  ReadOnly="true"  HeaderText="ID" HeaderStyle-Width="90px" InsertVisible="False" SortExpression="itemid" > 
 
        </asp:BoundField>
    <asp:BoundField DataField="catname"   HeaderText="关于类别"   SortExpression="catname">
 
        </asp:BoundField>


         <asp:TemplateField>
             <HeaderStyle Width="130" />
                <HeaderTemplate>页面内容</HeaderTemplate>
                 <ItemTemplate>
                          <a target=_blank  href="SingPage.aspx?itemid=<%#Eval("itemid") %>">查看或设定内容</a>
                    </ItemTemplate>
              </asp:TemplateField>


    <asp:BoundField DataField="orderid"   HeaderText="顺序ID"  HeaderStyle-Width="100px" SortExpression="orderid" >
 
        </asp:BoundField>
   <asp:BoundField DataField="username" HeaderText="最后操作"  ReadOnly="true"    SortExpression="username" HeaderStyle-Width="160px" >

        
        </asp:BoundField>

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

         <asp:BoundField DataField="visible" HeaderText="visible"  Visible="false" SortExpression="visible" />
    </Columns>
      
    </asp:GridView>



    <asp:SqlDataSource ID="sds" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
         DeleteCommand=" update portal_singlepage set isdeleted=1 WHERE [itemid] = @itemid" 
         SelectCommand="SELECT [itemid], [catname], [orderid], [username] FROM [portal_singlepage]  where isdeleted=0 ORDER BY [orderid]" 
         UpdateCommand="UPDATE [portal_singlepage] SET [catname] = @catname, [orderid] = @orderid, [username] = @username  WHERE [itemid] = @itemid" OnSelecting="sds_Selecting" OnUpdating="sds_Updating"
     
    >
    
    
   
   <UpdateParameters>
       <asp:Parameter   Name="catname" Type="String" />
       <asp:Parameter    Name="orderid" Type="Int32" />
       <asp:Parameter Name="username" Type="String" /> 
       <asp:Parameter    Name="itemid" Type="Int32" />
   </UpdateParameters>
    
    
    <DeleteParameters>
    <asp:Parameter Name="itemid" Type="Int32"  />
    </DeleteParameters>
    
    </asp:SqlDataSource>





   </div>
</asp:Content>
