<%@ Page Title="" Language="C#" MasterPageFile="~/SignBox/Site1.Master" AutoEventWireup="true" CodeBehind="AbroadTimeoutBoxList.aspx.cs" Inherits="GxHub.Wms.Abroad.Web.SignBox.AbroadTimeoutBoxList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>
        超时箱子认领
    </title>
    <script type="text/javascript">
        //使用checkbox当做全选反选
        function check_all_not() {
            var check = document.getElementById("checkboxAll").checked;
            //alert(check);
            if (check == true) {
                checkAll();
            }
            else {
                checkReverse();
            }

        }

        //选择
        function checkAll() {
            $(".check ").each(function () {
                var able = $(this).attr("disabled");
                if (able != 'disabled') {
                    $(this).attr("checked", true);
                }
            });
        }
        //反选
        function checkReverse() {
            $(".check ").each(function () {
                var able = $(this).attr("disabled");
                if (able != 'disabled') {
                    $(this).attr("checked", !($(this).attr("checked")));
                }
            });
        }
        function checkRemove() {
            $(".check ").each(function () {
                var able = $(this).attr("disabled");
                if (able != 'disabled') {
                    $(this).attr("checked", false);
                }
            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
      <yee:PageTitle ID="ptTitle" runat="server" Title="超时箱子认领">
        <ShortCuts>
           
        </ShortCuts>
    </yee:PageTitle>
    <yee:MessageBox ID="msg" runat="server">
    </yee:MessageBox>

    <div class="query">
        <table cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td>
                    <%=GetText("客户代号") %>
                </td>
                <td>
                    <asp:TextBox ID="txtCustCode" runat="server"></asp:TextBox>
                </td>

                <td>
                    <%=GetText("箱子号") %>
                </td>
                <td>
                    <asp:TextBox ID="txtSerialNo" runat="server"></asp:TextBox>
                </td>

                <td>
                    <%=GetText("仓储中心") %>
                </td>
                <td>
                    <yee:UserWarehousesDropDownList ID="ddlWarehouse" runat="server" WarehouseType="海外仓储">
                    </yee:UserWarehousesDropDownList>
                </td> 
                <td colspan="2"></td>
                <td>
                    <yee:Button ID="btnSearch" runat="server" CssClass="button" OnClick="btnSearch_Click" />
                </td>
            </tr>
        </table>
    </div>
   
    <asp:Repeater ID="rptList" runat="server" OnItemCommand="rptList_ItemCommand" OnItemDataBound="rptList_ItemDataBound">
        <HeaderTemplate>
            <table cellpadding="0" class="table" cellspacing="0" border="0" id="table2" style="text-align: center;">
                <tr>
                    <td class="tbheader">
                        <input type="checkbox" id="checkboxAll" onclick="check_all_not()" />
                        
                    </td>
                    <td class="tbheader">
                        <%=GetText("箱子号") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("签收日期") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("超时天数") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("客户代号") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("站点") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("运费") %>
                    </td> 
                </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr class="tbrow">
                <td class="tbpost">
                    <input id="cb" type="checkbox" class="check" runat="server" value='<%#Eval("BoxId") %>' />
                     <asp:HiddenField ID="hfBoxNo" runat="server"  Value='<%# Eval("BoxSerialNo")%>'/>
                    <asp:HiddenField ID="hfReceivedOn" runat="server"  Value='<%# Eval("ReceivedOn")%>'/>
                    <asp:HiddenField ID="hfDiffDay" runat="server"  Value='<%# Eval("DiffDay")%>'/>
                    <asp:HiddenField ID="hfCode" runat="server"  Value='<%# Eval("CustomerCode")%>'/>
                    <asp:HiddenField ID="hfWare" runat="server"  Value='<%# Eval("WarehouseName")%>'/>
                    <asp:HiddenField ID="hfAmount" runat="server"  Value='<%# Eval("Amount")%>'/>
                </td>
                <td class="tbpost">
                    <%# Eval("BoxSerialNo")%>
                </td>
                <td class="tbpost">
                    <%#Eval("ReceivedOn") %>
                </td>
                <td class="tbpost">
                    <%# Eval("DiffDay")%>
                </td>
                <td class="tbpost">
                    <%# Eval("CustomerCode")%>
                </td>
                <td class="tbpost">
                    <%# Eval("WarehouseName")%>
                </td>
                <td class="tbpost">
                    <%# Eval("Amount")%>
                </td>
                
            </tr>
        </ItemTemplate>
        <AlternatingItemTemplate>
            <tr class="tbrowalter">
                <td class="tbpost">
                    <input id="cb" type="checkbox" class="check" runat="server" value='<%#Eval("BoxId") %>' />
                    <asp:HiddenField ID="hfBoxNo" runat="server"  Value='<%# Eval("BoxSerialNo")%>'/>
                    <asp:HiddenField ID="hfReceivedOn" runat="server"  Value='<%# Eval("ReceivedOn")%>'/>
                    <asp:HiddenField ID="hfDiffDay" runat="server"  Value='<%# Eval("DiffDay")%>'/>
                    <asp:HiddenField ID="hfCode" runat="server"  Value='<%# Eval("CustomerCode")%>'/>
                    <asp:HiddenField ID="hfWare" runat="server"  Value='<%# Eval("WarehouseName")%>'/>
                    <asp:HiddenField ID="hfAmount" runat="server"  Value='<%# Eval("Amount")%>'/>
                </td>
                <td class="tbpost">
                    <%# Eval("BoxSerialNo")%>
                </td>
                <td class="tbpost">
                    <%#Eval("ReceivedOn") %>
                </td>
                <td class="tbpost">
                    <%# Eval("DiffDay")%>
                </td>
                <td class="tbpost">
                    <%# Eval("CustomerCode")%>
                </td>
                <td class="tbpost">
                    <%# Eval("WarehouseName")%>
                </td>
                <td class="tbpost">
                    <%# Eval("Amount")%>
                </td>
            </tr>
        </AlternatingItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>

    <yee:Pager ID="Pager1" runat="server" PageSize="20" PagerType="1" OnPageIndex_Changed="Pager1_PageIndex_Changed"
        PageIndex="0" />

    <div>
        <yee:Button ID="btnPiAdd" runat="server" Text="批量添加" OnClick="btnPiAdd_Click"/> 
    </div>
    <div class="subheader">
        <div class="title">
            <%=GetText("选中箱子列表") %>
        </div>
        <div style="clear: both">
        </div>
    </div>
     
     <!-- 这一块可直接一起发往的列表 -->
    <asp:Repeater ID="rptBoxList" runat="server"  OnItemCommand="rptBoxList_ItemCommand" >
        <HeaderTemplate>
            <table cellpadding="0" class="table" cellspacing="0" border="0" id="table2">
                <tr>
                     <td class="tbheader">
                        <%=GetText("箱子号") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("签收日期") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("超时天数") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("客户代号") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("站点") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("运费") %>
                    </td> 
                    <td class="tbheader" align="center" width="100px">
                        <%=GetText("移除") %>
                    </td>
                </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr class="tbrow">
                <td class="tbpost">
                    <%# Eval("BoxSerialNo")%>
                    <asp:HiddenField ID="hfBoxId" runat="server" Value='<%# Eval("BoxId")%>' />
                </td>
                <td class="tbpost">
                    <%#Eval("ReceivedOn") %>
                </td>
                <td class="tbpost">
                    <%# Eval("DiffDay")%>
                </td>
                <td class="tbpost">
                    <%# Eval("CustomerCode")%>
                </td>
                <td class="tbpost">
                    <%# Eval("WarehouseName")%>
                </td>
                <td class="tbpost">
                    <%# Eval("Amount")%>
                </td>
                <td class="tbpost">
                    <asp:LinkButton ID="lbnRemove" runat="server"  CommandName="remove"
                        CommandArgument='<%#Eval("BoxId") %>'><%=GetText("移除") %></asp:LinkButton>
                </td>
            </tr>
        </ItemTemplate>
        <AlternatingItemTemplate>
            <tr class="tbrowalter">
                <td class="tbpost">
                    <%# Eval("BoxSerialNo")%>
                    <asp:HiddenField ID="hfBoxId" runat="server" Value='<%# Eval("BoxId")%>' />
                </td>
                <td class="tbpost">
                    <%#Eval("ReceivedOn") %>
                </td>
                <td class="tbpost">
                    <%# Eval("DiffDay")%>
                </td>
                <td class="tbpost">
                    <%# Eval("CustomerCode")%>
                </td>
                 <td class="tbpost">
                    <%# Eval("WarehouseName")%>
                </td>
                <td class="tbpost">
                    <%# Eval("Amount")%>
                </td>
                <td class="tbpost">
                    <asp:LinkButton ID="lbnRemove" runat="server" CommandName="remove"
                        CommandArgument='<%#Eval("BoxId") %>'><%=GetText("移除") %></asp:LinkButton>
                </td>
            </tr>
        </AlternatingItemTemplate>
        <FooterTemplate>
        </FooterTemplate>
    </asp:Repeater>

     <table cellpadding="0" cellspacing="0" class="table">

        <tr>
            <td class="tbpostheader">
                <%=GetText("选中箱子数") %>
            </td>

            <td class="tbpost">
                <asp:Literal ID="litCount" runat="server"></asp:Literal>
            </td>
        </tr>
        <tr>
            <td class="tbpostheader">
                <%=GetText("金额") %>
            </td>
            <td class="tbpost">
                <asp:Literal ID="litAmount" runat="server"></asp:Literal>
            </td>
        </tr> 
        <tr>
            <td class="tbpostheader">
                <%=GetText("付款客户代号") %>
            </td>
            <td class="tbpost">
                <asp:TextBox ID="txtPayCode" runat="server"></asp:TextBox>
            </td>
        </tr> 
        <tr>
            <td class="tbpostheader">
                <%=GetText("备注") %>
            </td>
            <td class="tbpost">
                <asp:TextBox ID="txtRemark" runat="server" TextMode="MultiLine"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="tbfooter"></td>
            <td class="tbfooter">
                <asp:Button ID="btSave" runat="server" CssClass="button"  OnClick="btSave_Click"  Text="扣费生成提货单"/>
            </td>
        </tr>
    </table>

</asp:Content>
