<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="jblist.aspx.cs" Inherits="RM.Web.jiabi.jblist" %>
<%@ 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" />
    <script type="text/javascript">
        function add() {
            window.location.href = "/jiabi/AddQuestions.aspx";
        }

        function edit() {
            var arrt = new Array();
            arrt = CheckboxValue().split(',');
            if (arrt.length == 1) {
                var key = arrt[0];
                if (IsEditdata(CheckboxValue())) {
                    var url = "/jiabi/AddQuestions.aspx?infoid=" + key;
                    window.location = url;                    
                }
            } else {
                alert("请选择一条记录编辑");
            }
         }

         function deljb() {
             var arrt = new Array();
             arrt = CheckboxValue().split(',');
             if (arrt.length == 1) {
             if(confirm("确定要删除此题目吗？")){
                 var key = arrt[0];
                    if (IsEditdata(CheckboxValue())) {                     
                        $.ajax({
                            url: "/jiabi/jblist.aspx",
                            type: "post",
                            data: { "action": "deljb", key: key, a: Math.random() },
                            dataType: "json",
                            success: function (data) {                             
                                if(data>0){
                                    alert("删除成功！");window.location.href="/jiabi/jblist.aspx";
                                }else{
                                    alert("删除失败！");
                                }
                            },
                            error: function (XMLHttpRequest, textStatus, errorThrown) {
                                alert("网络异常" + XMLHttpRequest.status.toString());
                            }
                        });
                    }
                }
             } else {
                 alert("请选择一条记录编辑");
             } 
        }
         
        
    </script>


</head>
<body>
    <form id="form1" runat="server">
     <div class="btnbartitle">
        <div>
            假币列表
        </div>
    </div>

    <div>

    <table>
    <tr>
        <td>　假币号码 <input type="text" runat="server" id="txtjbnum" />　</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="deljb();" 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></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("info_id")%>" name="checkbox" />
                            </td>
                            <td style="width: 50px; text-align: center;">
                                <%# Container.ItemIndex+1 %>
                            </td>
                            <td  style="text-align:center;">
                                <%#Eval("info_num")%>
                            </td>
                            <td style="text-align:center;">
                                <%#Eval("currency_name")%>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        <% if (rp_Item != null)
                           {
                               if (rp_Item.Items.Count == 0)
                               {
                                   Response.Write("<tr><td colspan='4' 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" />
    
    </div>
    </form>
</body>
</html>
