<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Orderdetail.aspx.cs" Inherits="AngelShop.ASystem.Orderdetail" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
     <link href="Css/StyleSheet.css" rel="stylesheet" type="text/css" />
    <script src="../JS/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="../JS/lhgdialog/lhgdialog.js" type="text/javascript"></script>
        <script type="text/javascript">
        function cal() {
            var a = document.getElementById("txtOrderRemark");
            if (a.value.length > 200) {
                a.value = a.value.slice(0, 200);
            }
        }

        function EditOrderRemark() {
            var dialog = $.dialog({
                title: 'Orders Remaks',
                content: '<textarea id="txtOrderRemark" name="txtOrderRemark" oninput="cal()" onpropertychange="cal()"  rows="6" cols="39" class="input">' + $("#<%=Label3.ClientID%>").html() + '</textarea>',
                min: false,
                max: false,
                lock: true,
                ok: function () {
                    var remark = $("#txtOrderRemark").val();
                   // alert(remark);
                    debugger;
                    if (remark == "") {
                        $.dialog.alert('Sorry, please enter the order form!', function () { }, dialog);
                        return false;
                    }
                    var postData = { "order_no": "<%=PID%>", "remark": remark };
                    //发送AJAX请求
                    sendAjaxUrl(dialog, postData, "../tools/submit_ajax.ashx?action=edit_order_aremaks");
                    return false;
                },
                cancel: true
            });
        }
        //发送AJAX请求
        function sendAjaxUrl(winObj, postData, sendUrl) {
            $.ajax({
                type: "post",
                url: sendUrl,
                data: postData,
                dataType: "json",
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    $.dialog.alert('Attempt to send failed with error message:' + errorThrown, function () { }, winObj);
                },
                success: function (data, textStatus) {
                    if (data.status == 1) {
                        winObj.close();
                        $.dialog.tips(data.msg, 2, '32X32/succ.png', function () { location.reload(); }); //刷新页面
                    } else {
                        $.dialog.alert('Error message:' + data.msg, function () { location.reload(); }, winObj);
                    }
                }
            });
        }

    </script>
</head>
<body>
      <form id="form1" runat="server">
    <div>
        <table border="0" cellspacing="1" cellpadding="3" height="1" class="table" width="98%">
            <tr>
                <td class="title2">
                    <div  style="text-align:center">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BorderStyle="None"
                            DataKeyNames="ids" Width="100%">
                            <HeaderStyle Font-Bold="True" Wrap="False" ForeColor="White" CssClass="title" BackColor="#799AE1"
                                Height="25px"></HeaderStyle>
                            <Columns>
                                <asp:TemplateField HeaderText="订单编号">
                                    <ItemStyle HorizontalAlign="Center" CssClass="td" Width="10%" />
                                    <HeaderStyle CssClass="td" />
                                    <ItemTemplate>
                                        <asp:Label ID="lbIDS" runat="server" Text='<%#Eval("ids")%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="会员名字">
                                    <ItemStyle CssClass="td" />
                                    <HeaderStyle CssClass="td" />
                                    <ItemTemplate>
                                            <%#Eval("LastName")%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="邮寄方式">
                                    <ItemStyle CssClass="td" />
                                    <HeaderStyle CssClass="td" />
                                    <ItemTemplate>
                                        <%#getField(Eval("FreightType").ToString(), "Title")%>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="订单日期">
                                    <ItemStyle CssClass="td" />
                                    <HeaderStyle CssClass="td" />
                                    <ItemTemplate>
                                        <%# Eval("UpTime")%>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="总金额">
                                    <ItemStyle HorizontalAlign="Center" CssClass="td" Width="10%" />
                                    <HeaderStyle CssClass="td" />
                                    <ItemTemplate>
                              <asp:Label ID="txtCountMoney" runat="server" Text='<%#Eval("orderamount")%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="总重量">
                                    <ItemStyle HorizontalAlign="Center" CssClass="td" Width="10%" />
                                    <HeaderStyle CssClass="td" />
                                    <ItemTemplate>
                                        <%#Eval("OrderWeight")%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="运费">
                                    <ItemStyle HorizontalAlign="Center" CssClass="td" Width="10%" />
                                    <HeaderStyle CssClass="td" />
                                    <ItemTemplate>
                                          <asp:Label ID="txtFreight" runat="server" Text='<%#Eval("Freight")%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="状态">
                                    <ItemStyle HorizontalAlign="Center" CssClass="td" Width="10%" />
                                    <HeaderStyle CssClass="td" />
                                    <ItemTemplate>
                                        <%#Eval("className")%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="追踪号">
                                    <ItemStyle HorizontalAlign="Center" CssClass="td" Width="10%" />
                                    <HeaderStyle CssClass="td" />
                                    <ItemTemplate>
                                       <asp:Label ID="txtTrackingNumber" runat="server" Text='<%#Eval("TrackingNumber")%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <HeaderStyle CssClass="title" />
                        </asp:GridView>
                    </div>
                </td>
            </tr>

<tr> <td>代金券消费：<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></td></tr>


          <tr><td>

        <asp:Repeater ID="rptMlist" runat="server">
            <ItemTemplate>
                <table width="100%" border="1" cellpadding="0" cellspacing="0">
                <tr>
                <td align="center"  colspan="4"  style="line-height:35px;height:35px;font-weight:bold;font-size:14px;">会员详细信息</td>
                </tr>
                    <tr>
                        <td align="right">
                            会员账号
                        </td>
                        <td>
                            <%# Eval("EmailAccount")%>
                        </td>
                         <td align="right">
                            会员等级
                        </td>
                        <td>
                            <%# Eval("MembershipLevels")%>
                        </td>
                    </tr>
                    <tr>
                         <td align="right">
                            会员姓名
                        </td>
                        <td>
                            <%# Eval("FirstName")%>
                            <%# Eval("LastName")%>
                        </td>
                         <td align="right">
                            邮政编码
                        </td>
                        <td>
                            <%# Eval("Postal")%>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            电话
                        </td>
                        <td>
                            <%# Eval("Tel")%>
                        </td>
                       <td align="right">
                            详细地址
                        </td>
                        <td>
                            <%# Eval("Address")%>
                        </td>
                    </tr>
                    <tr>
                      <td align="right">
                            MSN
                        </td>

                        <td>
                         &nbsp;<%# Eval("MSN")%></td>

                       <td align="right">
                            所在城市
                        </td>
                        <td>
                            <%# Eval("City")%>
                        </td>
                    </tr>

                    <tr>
                        <td align="right">
                            移动电话
                        </td>
                        <td>
                          &nbsp;  <%# Eval("Mobile")%>
                        </td>
                           <td align="right">
                            州/省
                        </td>
                        <td>
                            <%# Eval("Province")%>
                        </td>   
                    </tr>

                    <tr>
                          <td align="right">
                            传真
                        </td>
                        <td>
                           &nbsp; <%# Eval("fax")%>
                        </td>
                          <td align="right">
                            所在国家
                        </td>
                        <td>
                            <%# Eval("Country")%>
                        </td>

                    </tr>
         
                </table>
            </ItemTemplate>
        </asp:Repeater>


</td></tr>




        </table>
        <table border="0" cellspacing="1" cellpadding="3" height="1" class="table" width="98%">
            <tr>
                <td colspan="7" class="td">
                    <div align="center">
                        <asp:GridView ID="myGridView" runat="server" AutoGenerateColumns="False" BorderStyle="None"
                            Width="100%">
                            <HeaderStyle Font-Bold="True" Wrap="False" ForeColor="White" CssClass="title" BackColor="#799AE1"
                                Height="25px"></HeaderStyle>
                            <Columns>
                                <asp:TemplateField HeaderText="所属订单编号">
                                    <ItemStyle HorizontalAlign="Center" CssClass="td" Width="10%" />
                                    <HeaderStyle CssClass="td" />
                                    <ItemTemplate>
                                        <%=PID%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="产品名称">
                                    <ItemStyle CssClass="td" />
                                    <HeaderStyle CssClass="td" />
                                    <ItemTemplate>
                                        <%#Eval("name")%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="颜色">
                                    <ItemStyle HorizontalAlign="Center" CssClass="td" Width="10%" />
                                    <HeaderStyle CssClass="td" />
                                    <ItemTemplate>
                                       <%#Eval("color")%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="单价">
                                    <ItemStyle HorizontalAlign="Center" CssClass="td" Width="10%" />
                                    <HeaderStyle CssClass="td" />
                                    <ItemTemplate>
                                        <%#showpric(Eval("pv").ToString(), Eval("pvs").ToString())%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="重量（KG）">
                                    <ItemStyle HorizontalAlign="Center" CssClass="td" Width="10%" />
                                    <HeaderStyle CssClass="td" />
                                    <ItemTemplate>
                                        <%#Eval("peso")%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="数量">
                                    <ItemStyle HorizontalAlign="Center" CssClass="td" Width="10%" />
                                    <HeaderStyle CssClass="td" />
                                    <ItemTemplate>
                                        <%#Eval("qty")%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <HeaderStyle CssClass="title" />
                        </asp:GridView>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="7" class="td">
                    <div align="right">
                        <webdiyer:AspNetPager ID="myAspNetPager" runat="server" HorizontalAlign="Right" OnPageChanged="myAspNetPager_PageChanged"
                            ShowCustomInfoSection="Left" SubmitButtonText=" G O  " CustomInfoHTML="Page  <font color='red'><b>%CurrentPageIndex%</b></font> of  %PageCount%&nbsp;&nbsp;Order %StartRecordIndex%-%EndRecordIndex%"
                            PageSize="20" AlwaysShow="True">
                        </webdiyer:AspNetPager>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="7" style="text-align: center;
                    font-weight: bold;">
                    订单备注
                </td>
            </tr>
            <tr>
                <td colspan="7">
                    <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
                </td>
            </tr>
            <tr>
                <td colspan="7" style="text-align: center;
                    font-weight: bold;">
                    管理员订单备注
                </td>
            </tr>
            <tr>
                <td colspan="7">
                    <asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
                </td>
            </tr>
        </table>
    </div>
    <div style="text-align:center;width:100%;line-height:60px;">
            <asp:Button ID="Button3" runat="server" Height="32px" Text="提醒取件" 
                Width="90px" onclick="Button3_Click" /> 
            <input type="button" name="button2" value="管理员备注" id="button2" onclick="EditOrderRemark()"
            style="height: 32px; width: 115px;" />
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="订单详细导入Word" 
        Height="32px" Width="135px" />
        <asp:Button ID="Button4" Height="32" runat="server" Text="新增表格" OnClick="Button4_Click" />
        </div>

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