<%@ Page Title="" Language="C#" EnableViewState="false" MasterPageFile="~/bps/bps.Master" AutoEventWireup="true" CodeBehind="Supply_Group.aspx.cs" Inherits="purchase.purchase.Supply_Group" %>
<%@ Register src="../UserControl/SupplyTab.ascx" tagname="SupplyTab" tagprefix="uc1" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 
     <h1  class="border-active subnav" ><%=isen?"Supply List":"供应商列表" %>  </h1>

 <uc1:SupplyTab ID="SupplyTab1" runat="server" currentindex="2" />
   
 

             <div class="content">

                  
                  


 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
     <ContentTemplate>


           
            
             <table class="table" >
           
                <tr>
                  <th style="width:150px;"><%=isen?"Group Name":"分组名称" %> </th> 
                
               <td style="width:250px">
<asp:TextBox ID="txtgroupname" Width="200px" ValidationGroup="add" runat="server"  class="form-control"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ForeColor="Red" ValidationGroup="add" runat="server" Display="Dynamic" ErrorMessage="*" ControlToValidate="txtgroupname"></asp:RequiredFieldValidator>             

               </td> 
                  
                <td >
                    <asp:Button ID="btnAdd" class="btn btn-primary btn-sm btn-flat" ValidationGroup="add" runat="server" Text="添加" OnClick="btnAdd_Click"></asp:Button>

                        
                </td> 
                    
                </tr> 

      </table>

 
             

    <asp:GridView runat="server"  GridLines="None"  AllowPaging="true" PageSize="20"
        class="table table-hover sglist" Width="800px"
        ID="gv_group_list" AutoGenerateColumns="False"
         DataKeyNames="id" DataSourceID="SqlDataSource1">
        <Columns>
            <asp:BoundField HeaderStyle-Width="60px" DataField="id" Visible="false" HeaderText="id" InsertVisible="False" ReadOnly="True" SortExpression="id" />
            <asp:BoundField DataField="groupname" HeaderText="供应商分组名" SortExpression="groupname" />
       
           <asp:CommandField HeaderText="操作" EditText="编辑" DeleteText="<span onclick=&quot;JavaScript:return confirm('确定删除吗？')&quot;>删除</span> "  UpdateText="更新"  CancelText="取消" ShowDeleteButton="True" ShowEditButton="True" />
             </Columns>

    </asp:GridView>


<asp:SqlDataSource ID="SqlDataSource1" 
     ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
     runat="server" 
    DeleteCommand="DELETE FROM [purchase_supply_group] WHERE [id] = @id" 
    SelectCommand="SELECT * FROM [purchase_supply_group]  "
     UpdateCommand="UPDATE [purchase_supply_group] SET [groupname] = @groupname WHERE [id] = @id"
    >
    <DeleteParameters>
        <asp:Parameter Name="id" Type="Int32" />
    </DeleteParameters>
     
    <UpdateParameters>
        <asp:Parameter Name="groupname" Type="String" />
        <asp:Parameter Name="id" Type="Int32" />
    </UpdateParameters>
             </asp:SqlDataSource>
      
  
         
     </ContentTemplate>

 </asp:UpdatePanel>




















 
<style>



    .sgdel{
        display: none;
    }
    .sglist>tbody>tr:hover .sgdel{
        display: block;
    }
    

</style>

 

</div>

</asp:Content>
