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

      <h1  class="border-active subnav" ><%=isen?"Param Setting":"参数配置" %>  </h1>
    
 
<div class="formsMenu" runat="server" id="div_1" style="margin-top:20px;">
		 <ul class="nav nav-tabs">
		 
             <li   class='<%=IsHover("unit")%>'><a href='param_setting.aspx?types=unit'><%=isen?"UOM":"单位" %> </a></li>
		      <li    class='<%=IsHover("shipmethod")%>'><a href='param_setting.aspx?types=shipmethod'><%=isen?"Ship Method":"运输方式" %> </a></li>
          
          	    <li   class='<%=IsHover("payment")%>'><a href='param_setting.aspx?types=payment'><%=isen?"Pay Method":"付款方式" %> </a></li>
             
               <li   class='<%=IsHover("paycircle")%>' ><a href='param_setting.aspx?types=paycircle'><%=isen?"Pay Circle":"帐期" %> </a></li>


              <li class='<%=IsHover("invoicetype")%>'><a href='param_setting.aspx?types=invoicetype'><%=isen?"Invoice Type":"发票类型" %>  </a></li>
          

              <li   class='<%=IsHover("Incoterm")%>'><a href='param_setting.aspx?types=Incoterm'><%=isen?"Incoterm":"商务术语" %> </a></li>

             
             
               <li   class='<%=IsHover("envprotect")%>'><a href='param_setting.aspx?types=envprotect'><%=isen?"Env Protect":"是否环保" %> </a></li>


              <li   class='<%=IsHover("producttype")%>'><a href='param_setting.aspx?types=producttype'><%=isen?"Product Type":"成品类型" %> </a></li>

             
	   </ul>
 </div>


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

  <div style="margin:20px auto auto 10px;">



 
   
    <%=isen?"Name":"名称" %> ： <asp:TextBox runat="server" ID="txt_cat" CssClass="form-control"  ValidationGroup="add" style="width:200px; display:inline-block"> </asp:TextBox>
      <asp:RequiredFieldValidator runat="server" ID="rf" ControlToValidate="txt_cat" ErrorMessage="必填" ValidationGroup="add"></asp:RequiredFieldValidator>


      <%=isen?"Order":"顺序" %>  ： <asp:TextBox runat="server" ID="txt_order" CssClass="form-control" Text="0"  ValidationGroup="add" style="width:80px; display:inline-block"> </asp:TextBox>


    <asp:Button runat="server" ID="txt_add" Text="添加"  ValidationGroup="add"  CssClass="btn   btn-flat btn-success" OnClick="txt_add_Click" />

 



  <br /><br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="id" DataSourceID="SqlDataSource1"  
             Width="750px"
             GridLines="None"
             CssClass="table table-hover"
            > 
            <Columns>
            
                <asp:BoundField  HeaderStyle-Width="100px"  
                    DataField="id" HeaderText="ID"  Visible="false" 
                    ReadOnly="True" SortExpression="ID" />


                <asp:BoundField DataField="paramname" HeaderText="名称" 
                    SortExpression="paramname" HeaderStyle-Width="250px"  />

                  <asp:BoundField DataField="orderid" HeaderText="顺序ID" 
                    SortExpression="orderid"  HeaderStyle-Width="100px"  />


                    <asp:CommandField  HeaderStyle-Width="120px" ButtonType="Link"
                        ControlStyle-CssClass="btn btn-flat btn-primary btn-sm"   
                        ShowDeleteButton="True" ShowEditButton="True"  HeaderText="操作"
                      
                        DeleteText="<span onclick=&quot;JavaScript:return confirm('确定删除吗？')&quot;>删除</span> "  

                         EditText="编辑" UpdateText="更新" 
                         
                        CancelText="取消" />

    

            </Columns>
                 
   
     
        </asp:GridView>
  


        <asp:SqlDataSource ID="SqlDataSource1" 
         ConnectionString="<%$ ConnectionStrings:connectionstring %>"
         runat="server" 
            DeleteCommand="DELETE FROM [purchase_param] WHERE [id] = @id"  
            
            SelectCommand="SELECT * FROM [purchase_param] where types=@types order by orderid asc, id asc " 
            UpdateCommand="UPDATE [purchase_param] SET [paramname] = @paramname, orderid=@orderid WHERE [id] = @id">
          
          <SelectParameters>
             <asp:QueryStringParameter   Name="types" QueryStringField="types" Type="String" />
          </SelectParameters>
           
            
             
           
             
        </asp:SqlDataSource>

      

      </div>

             

      </ContentTemplate>
    </asp:UpdatePanel>
  




</asp:Content>
