<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DingDan_WeiFaHuo.aspx.cs" Inherits="ASdht.Web.WebPage.DingDan_WeiFaHuo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Src="../UserControls/HeaderControl.ascx" TagName="HeaderControl" TagPrefix="uc2" %>
<%@ Register Src="../UserControls/FooterControl.ascx" TagName="FooterControl" TagPrefix="uc3" %>
<%@ Register Src="UserControls/ordermenu.ascx" TagName="ordermenu" TagPrefix="uc4" %>

<%@ Register src="UserControls/dingdansearch.ascx" tagname="dingdansearch" tagprefix="uc1" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="content-type" content="text/html" charset="UTF-8">
</head>
<style type="text/css">
    .number
    {
        width: 38px;
    }
</style>
<script>
    $(document).ready(function () {
        $("input[oid]").bind("keydown", function (event) {
            locksubmit = true;
            if (event.keyCode == 13) {
                var val = $(this).attr("oid");
                if (val != "undefined") {
                    updateorder(val);
                    var expressid = getnextexpressid($(this).val());
                    var nextsort = parseInt($(this).attr("sort")) + 1;
                    var obj = $("input[sort='" + nextsort + "']");
                    if (obj.length == 1) {
                        $(obj).val(expressid);
                        $(obj).focus();

                    }
                }
                return false;
            }
        });

        $("input[type='button']").click(function () {
            updateorder($(this).attr("oid"));
        });

        $("form").bind("submit", function (event) {
            if (locksubmit) {
                locksubmit = false;
                return false;
            }
        });
    });

    function updateorder(orderid) {
        var no = $("#order_express_no_" + orderid).val();

        X.get("/ajax/manage.aspx?action=updateorder&orderid=" + orderid + "&expressid=" + $("#order_express_id_" + orderid).val());
    }
</script>
<body class="newbie">
    <form id="form1" runat="server">
    <div id="pagemasker">
    </div>
    <div id="dialog">
    </div>
    <div id="doc">
        <uc2:HeaderControl ID="HeaderControl1" runat="server" />
        <div id="bdw" class="bdw">
            <div id="bd" class="cf">
                <div id="coupons">
                    <div class="dashboard" id="dashboard">
                        <uc4:ordermenu ID="ordermenu1" runat="server" />
                    </div>
                    <div id="content" class="coupons-box clear mainwide">
                        <div class="box clear">
                            <div class="box-content">
                                <div class="head">
                                    <h2>
                                        <%=ordermenu1.Title %> 
                                    </h2>
                                   <uc1:dingdansearch ID="dingdansearch1" runat="server" />
                                </div>
                                <div class="sect">
                                  <asp:Repeater ID="datacontainer" runat="server" 
                                        onitemdatabound="datacontainer_ItemDataBound">
                                  <HeaderTemplate>
                                  <table id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
                                  <tr><th width="40">ID</th><th class="xiangmu">项目</th><th width="70">用户</th><th width="250">派送地址</th><th width="60">快递公司</th><th  width="100">操作</th></tr>
                                  </HeaderTemplate>
                                   
                                   <ItemTemplate>
                                   <tr class="alt"><td><%# Eval("order_id") %></td><td>
                                       <asp:Repeater ID="teamcontainer" runat="server">
                                       <ItemTemplate>
                                       <%# Eval("teamid") %>&nbsp;(<a target="_blank" href='/team.aspx?id=<%# Eval("teamid") %>' class="deal-title"><%# Eval("product") %><font style='color:red'><%# Maticsoft.BLL.Order.Getbulletin(Eval("result").ToString()) %></font><font style='color:red'>(总共:<%# Eval("num") %>件)</font></a>)
                                       </ItemTemplate>
                                       </asp:Repeater>
                                   </td><td><a class="ajaxlink" href='/ajax/manage.aspx?action=userview&amp;id=<%# Eval("user_id") %>'><%# Eval("email") %><br><%# Eval("username") %></a>&nbsp;»&nbsp;<a class="ajaxlink" href='/ajax/misc.aspx?action=sms&amp;v=<%# Eval("user_mobile") %>'>短信</a></td>
                                   <td><%# Eval("order_address")%></td>
                                   <td><%# GetExpressHtml(Eval("order_id"))%></td>
                                   <td><% if (result) { %><input type="button" value="保存" oid='<%# Eval("order_id") %>' id='orderbutton<%# Eval("order_id") %>'><% } %></td></tr>
                                   </ItemTemplate>
                                   <AlternatingItemTemplate>
                                     <tr ><td><%# Eval("order_id") %></td><td>
                                       <asp:Repeater ID="teamcontainer" runat="server">
                                       <ItemTemplate>
                                       <%# Eval("teamid") %>&nbsp;(<a target="_blank" href='/team.aspx?id=<%# Eval("teamid") %>' class="deal-title"><%# Eval("product") %><font style='color:red'><%# Maticsoft.BLL.Order.Getbulletin(Eval("result").ToString()) %></font><font style='color:red'>(总共:<%# Eval("num") %>件)</font></a>)
                                       </ItemTemplate>
                                       </asp:Repeater>
                                   </td><td><a class="ajaxlink" href='/ajax/manage.aspx?action=userview&amp;id=<%# Eval("user_id") %>'><%# Eval("email") %><br><%# Eval("username") %></a>&nbsp;»&nbsp;<a class="ajaxlink" href='/ajax/misc.aspx?action=sms&amp;v=<%# Eval("user_mobile") %>'>短信</a></td>
                                   <td><%# Eval("order_address")%></td>
                                   <td><%# GetExpressHtml(Eval("order_id"))%></td>
                                   <td><% if (result) { %><input type="button" value="保存" oid='<%# Eval("order_id") %>' id='orderbutton<%# Eval("order_id") %>'><% } %></td></tr>
                                  
                                   </AlternatingItemTemplate>
                                   <FooterTemplate>
                                   <tr>
                                            <td colspan="10">
                                                <a onclick="javascript:location.replace(location.href);" href="#">刷新(过滤掉已设置为已发货状态的订单)</a>
                                            </td>
                                    </tr>
                                        
                                    </table>
                                   </FooterTemplate> 
                                    </asp:Repeater>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- bd end -->
        </div>
        <!-- bdw end -->
        <uc3:FooterControl ID="FooterControl1" runat="server" />
    </div>
    </form>
</body>
</html>

