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


       
        <h1  class="border-active subnav" ><%=isen?"Manufacturer List":"制造商列表" %>  </h1>

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

    <table class="table">
        <tr>
            

             <th>
                   <%=isen?"MPN":"制造商编号MPN" %> <font color="red">*</font>
            </th>

              <th>
                 <%=isen?"Manufacturer Name":"制造商名" %>  <font color="red">*</font>
            </th>
              
               <th>
                 <%=isen?"Full Name":"全称" %>
            </th>


            <th>
                 <%=isen?"Note":"备注" %>
            </th>

            <th> 


            </th>

        </tr>

        <tr>
             

              <td>
                <asp:TextBox runat="server"  CssClass="form-control"   ValidationGroup="add"  ID="txt_code"></asp:TextBox> 
                     <asp:RequiredFieldValidator runat="server"   ValidationGroup="add"  ID="RequiredFieldValidator221" ErrorMessage="必填" Display="Dynamic" ControlToValidate="txt_code"></asp:RequiredFieldValidator>
             </td>

               <td>
                <asp:TextBox runat="server"  CssClass="form-control" ID="txt_name"></asp:TextBox> 
                       <asp:RequiredFieldValidator runat="server"   ValidationGroup="add"  ID="RequiredFieldValidator1" ErrorMessage="必填" Display="Dynamic" ControlToValidate="txt_name"></asp:RequiredFieldValidator>

             </td>

              <td>
                <asp:TextBox runat="server"  CssClass="form-control" ID="txt_fullname"></asp:TextBox> 
             </td>

              <td>
                <asp:TextBox runat="server"  CssClass="form-control" ID="txt_note"></asp:TextBox> 
             </td>

            <td>

                <asp:Button runat="server" ID="btn_add"  ValidationGroup="add"  Text="添加" CssClass="btn btn-primary btn-sm" OnClick="btn_add_Click" />
            </td>

        </tr>

    </table>

            </ContentTemplate>
           </asp:UpdatePanel>


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


      

    <asp:GridView runat="server" ID="gv_list"  DataKeyNames="id" PageSize="10" GridLines="None" DataSourceID="sds"  CssClass="table table-hover"
         AutoGenerateColumns="false"  
         AllowPaging="True">
        <Columns>
            <asp:BoundField DataField="ID" Visible="false" HeaderText="ID" HeaderStyle-Width="80px" />

           
             <asp:BoundField DataField="code" HeaderText="MPN" HeaderStyle-Width="100px" />

             <asp:BoundField DataField="name" HeaderText="名称" HeaderStyle-Width="150px" />
            
            <asp:BoundField DataField="fullname" HeaderText="全称" HeaderStyle-Width="200px" />
        

             <asp:BoundField DataField="note" HeaderText="备注" HeaderStyle-Width="300px" />

     

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

        </Columns>
        <PagerStyle CssClass="pagination-ys" />

    </asp:GridView>




    <asp:SqlDataSource runat="server" ID="sds"
         ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
         DeleteCommand="DELETE FROM [purchase_maker] WHERE [id] = @id" 
          SelectCommand="SELECT  *  FROM [purchase_maker] ORDER BY [id] DESC"
         UpdateCommand="UPDATE [purchase_maker] SET   [name] = @name, [code] = @code, fullname=@fullname, note=@note WHERE [id] = @id"
       >

        <DeleteParameters>
            <asp:Parameter Name="id" Type="Int32" />
        </DeleteParameters>
        
        
    </asp:SqlDataSource>


              </ContentTemplate>

    </asp:UpdatePanel>






















</asp:Content>
