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


     <h1  class="border-active subnav" > 货币与汇率 </h1>
    
 
 


     
    <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>


      汇率：<asp:TextBox runat="server" ID="txt_rate" CssClass="form-control" Text="1"  ValidationGroup="add" style="width:80px; display:inline-block"> </asp:TextBox>



      <%=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="rate" HeaderText="汇率" 
                    SortExpression="rate" 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 rate=@rate, [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>
