<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeBehind="InternationalPackageChoiseAddress.aspx.cs" Inherits="GxHub.Wms.Abroad.Web.Package.InternationalPackageChoiseAddress" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script src="../Scripts/jquery-3.3.1.min.js"></script>

<script type="text/javascript">

    // 使用checkbox当做全选反选
    function check_all_not(ckb) {
        
        var check = ckb.checked;
        if (check === true) {
            checkReverse();
            ckb.checked = true;
            $("#hfLatSize").val(ckb.dataset.latsize);
            $("#hfLngSize").val(ckb.dataset.lngsize);
            $("#hfReceiverName").val(ckb.dataset.receivername);
            $("#hfMobile").val(ckb.dataset.mobile);
            $("#hfAddressId").val(ckb.dataset.id);
            $("#hfAddress").val(ckb.dataset.address);
        }
        else { 
            checkReverse();
            $("#hfLatSize").val('');
            $("#hfLngSize").val('');
            $("#hfReceiverName").val('');
            $("#hfMobile").val('');
            $("#hfAddressId").val('');
            $("#hfAddress").val('');
        }
    }
    
    // 正选
    function checkAll() {
        $(".check").each(function () {
            if (!$(this).prop("checked")) {
                $(this).prop("checked", true);
            }
        });
    }
    
    // 反选
    function checkReverse() {            
         $(".check").each(function () {
            if ($(this).prop("checked")) {
                $(this).prop("checked", !$(this).prop("checked"));
            }
        });
    }

</script>

</head>
<body>
<form id="form1" runat="server">
    <yee:PageTitle ID="ptTitle" runat="server">
        <ShortCuts>
            
        </ShortCuts>
    </yee:PageTitle>

    <yee:MessageBox ID="msg" runat="server">
    </yee:MessageBox>
<div>
    <asp:Repeater ID="rptCollect" runat="server" >
        <HeaderTemplate>
            <table cellpadding="0" class="table" cellspacing="0" border="0">
                <tr> 
                    <td class="tbheader" width="30px">
                    </td>  
                    <td class="tbheader" width="50px">
                        <%=GetText("联系人") %>
                    </td>
                    <td class="tbheader" width="80px">
                        <%=GetText("电话") %>
                    </td>
                    <td class="tbheader" width="180px">
                        <%=GetText("详细地址") %>
                    </td>
                </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr class="tbrow">
                <td class="tbpost">
                    <input type="checkbox" id ="cbItem" runat="server" class="check" onclick="check_all_not(this)" data-id='<%# Eval("AddressId") %>' data-LatSize='<%# Eval("LatSize") %>' data-LngSize='<%# Eval("LngSize") %>' data-receivername='<%# Eval("Receivername") %>' data-mobile='<%# Eval("Mobile") %>' data-address='<%# Eval("Address") %>'/> 
                    <asp:HiddenField ID="hfId" runat="server" Value='<%#Eval("AddressId") %>' />
                </td>
                <td class="tbpost" style="text-align: left;">
                    <%#Eval("ReceiverName") %>
                </td>  
                <td class="tbpost" style="text-align: left;">
                    <%#Eval("Mobile") %>
                </td>
                <td class="tbpost" style="text-align: left;">
                    <%#Eval("Address") %>
                </td>
            </tr>
        </ItemTemplate>

        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>
</div>
<asp:HiddenField ID="hfLatSize" runat="server" ClientIDMode="Static" />
<asp:HiddenField ID="hfLngSize" runat="server" ClientIDMode="Static" />
<asp:HiddenField ID="hfAddressId" runat="server" ClientIDMode="Static" />
<asp:HiddenField ID="hfReceiverName" runat="server" ClientIDMode="Static" />
<asp:HiddenField ID="hfMobile" runat="server" ClientIDMode="Static" />
<asp:HiddenField ID="hfAddress" runat="server" ClientIDMode="Static" />
</form>
</body>
</html>