<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="switchshop.aspx.cs" Inherits="VA.Modules.JDingMember.switchshop" %>

<!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>
    <title>切换门店</title>
    <!--#include virtual="/include/css/edit.aspx"-->
    <!--#include virtual="/include/js/edit.aspx"-->     
    <script type="text/javascript">    
    function switchShop() {
        
        var targetShopCode = "";

        $("#tbShops").find("tr").each(function () {
            var radio = $(this).find("input[type=radio]")[0];
            if (radio != undefined) {
                if (radio.checked) {
                    targetShopCode = radio.value;
                }
            }
        });

        if (targetShopCode == "") {
            JTongAlert('提示', "请选择要登入的门店！", 'warning');
            return;
        }

        window.top.location.href = pageName+ "?act=switchshop&shopcode=" + targetShopCode;      
    }

    $(function () {        
        $("#tbShops").find("tr").click(function () {
            $("#tbShops").find("tr").removeClass("tr_selected");
            var $tr = $(this);
            $tr.find("input[name=shopCode]")[0].checked = true;
            $tr.addClass("tr_selected");
        });
    });

    </script>
</head>
<body>
<form id="Form1" method="post" runat="server">

<div class="editPageWrapper" style="width:600px;">

<div class="centerFormTitle">
   <h1>选择要登入的门店</h1>
</div>

<div style="margin-bottom:5px;margin-top:3px;color:#808080">
    <p>注：如果登入门店不是自己所属的门店，则建议只查询数据，不要做业务操作。</p>
</div>

<asp:Repeater ID="myRepeater" Runat="server" EnableViewState="False">
<HeaderTemplate>
<table cellspacing="0" class="listTable" id="tbShops" style="width:100%;margin-top:-1px;">
<thead>
<tr>
<td style="width:30px;text-align:center;"></td>
<td style="width:70px;text-align:center;">门店代码</td>
<td style="text-align:left;">门店名称</td>
</thead>    
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td align="center"><input type="radio" name="shopCode" value="<%# Eval("Shop_Code")%>" /></td>
<td align="center"><%# Eval("Shop_Code")%></td>
<td align="left"><%# Eval("Shop_Name")%></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>

<table cellspacing="0" cellpadding="3" class="editTable" style="margin-top:-1px;">
<tr>
<td colspan="2" class="footer">

    <input type="button" id="btnSwitchShop" class="btn" style="width:100px" onclick="switchShop()" value="确定" />
    <input type="button" id="btnCancel" class="btn" style="width:100px" onclick="cancel()" value="取消" />

</td>
</tr>
</table>

</div><!--editPageWrapper.END-->

</form>
</body>
</html>

