<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Features_List.aspx.cs" Inherits="RM.Web.jiabi.Features_List" %>
<%@ Register Src="~/UserControl/PageControl.ascx" TagName="PageControl" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>货币种类/特征列表</title>
    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>    
    <script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
    <link href="../Themes/Styles/Site.css" rel="stylesheet" type="text/css" />
</head>
<body>

<div style="padding:5px;" >
    <form id="form1" runat="server">

    <div class="btnbartitle">
        <div>
            货币种类/特征列表
        </div>
    </div>

    <table>
    <tr>
        <td>　货币种类　<asp:DropDownList ID="ddl_Cur" runat="server"></asp:DropDownList></td>
        <td>　<asp:Button ID="btn_query" runat="server" Text="查询" onclick="btn_query_Click"  CssClass="button"/>　
              <input type="button" value="添加" onclick="add();" class="button"  />
              <input type="button" value="编辑" onclick="edit();" class="button"/>
              <input type="button" value="删除" onclick="delfeat();" class="button"/>
              <input type="button" value="选项" onclick="option();" class="button"/>
        </td>
    </tr>
    </table>
    
    <table style="width:100%;" class="grid" >
      <thead>
    <tr><td style="width: 20px; text-align: left;">
                        <label id="checkAllOff" onclick="CheckAllLine()" title="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Quanxuan")%>">
                            &nbsp;</label>
                    </td>
                    <th>序号</th> <th>货币种类</th><th>特征名称</th><th>排序</th></tr>
    </thead>
  <tbody>
                <asp:Repeater ID="rp_Item" runat="server" OnItemDataBound="rp_ItemDataBound">
                    <ItemTemplate>
                        <tr>
                            <td style="width: 20px; text-align: left;">
                                <input type="checkbox" value="<%#Eval("feat_id")%>" name="checkbox" />
                            </td>
                            <td style="width: 50px; text-align: center;">
                                <%# Container.ItemIndex+1 %>
                            </td>
                            <td  style="text-align:center;">
                                <%#Eval("currency_name")%>
                            </td>
                            <td style="text-align:center;">
                                <%#Eval("feat_Name")%>
                            </td>
                            <td style="text-align:center;">
                                <%#Eval("featSort")%>
                            </td>
                            

                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        <% if (rp_Item != null)
                           {
                               if (rp_Item.Items.Count == 0)
                               {
                                   Response.Write("<tr><td colspan='6' style='color:red;text-align:center'>" + RM.Common.DotNetConfig.LanguageHelper.GetKey("Null") + "</td></tr>");
                               }
                           } %>
                    </FooterTemplate>
                </asp:Repeater>
            </tbody>
            <tfoot>
    
            </tfoot>
    </table>
    <uc1:PageControl ID="PageControl1" runat="server" />
    
    
    </form>
    </div>
    <script type="text/javascript">
        //编辑
        function edit() {
            var arrt = new Array();
            arrt = CheckboxValue().split(',');
            if (arrt.length == 1) {
                var key = arrt[0];
                if (IsEditdata(CheckboxValue())) {
                    var url = "/jiabi/Features_From.aspx?FeaKey=" + key;
                    //alert(url);
                    //top.openDialog(url, 'Courseware_Form', '课件列表 - 编辑', "960px", "450px", 50, 50);
                    window.location = url;
                }
            } else {
                alert("请选择一条记录编辑");
            } 
        }        

        //添加
        function add() {
            var url = "/jiabi/Features_From.aspx";
            //alert(url);
            window.location = url;
        }
        //删除
        function delfeat() {
            var arrt = new Array();
            arrt = CheckboxValue().split(',');
            if (confirm("确定要删除" + arrt.length + "条记录吗？")) {
                var key = arrt[0];
                $.ajax({
                    url: "/jiabi/Features_List.aspx",
                    type: "post",
                    data: { "action": "delfeat", key: key, a: Math.random() },
                    dataType: "json",
                    success: function (data) {
                        if (data > 0) {
                            alert("删除成功！"); window.location.href = "/jiabi/Features_List.aspx";
                        } else {
                            alert("删除失败！");
                        }
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        alert("网络异常" + XMLHttpRequest.status.toString());
                    }
                });
            }
        }        

        //选项
        function option() {
            var arrt = new Array();
            arrt = CheckboxValue().split(',');
            if (arrt.length == 1) {
                var key = arrt[0];
                if (IsEditdata(CheckboxValue())) {
                    var url = "/jiabi/Options_From.aspx?FeaKey=" + key;
                    //alert(url);
                    window.location = url;
                }
            } else {
                alert("请选择一条记录处理选项");
            }
        }

    </script>
</body>
</html>