<%@ page language="C#" masterpagefile="MyShopMasterPage.master" autoeventwireup="true" inherits="Member_Shop_BuyOrder, WebApp_deploy" enableeventvalidation="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="sm" runat="server">
    </asp:ScriptManager>
    <script type="text/javascript" src="../Js/HowaveAjax.js"></script>    
    <script language="javascript" type="text/javascript">

        //倒计时
        window.setInterval(function () { ShowCountDown('divTime'); }, 1000);

        function ShowCountDown(divname) {

            // var tian=document.getElementById("ctl00_ContentPlaceHolder1_Hidden1").value;
            var tian = document.getElementById("<%=Hidden1.ClientID %>").value;
            if (tian != 0) {
                var now = new Date();
                // var endDate = new Date(now.getFullYear(), now.getMonth(), now.getDay(), "19", "00", "00");
                //var label=document.getElementById("ctl00_ContentPlaceHolder1_lblTime").value;
                var label = document.getElementById("<%=lblTime.ClientID %>").value;
                var endDate = new Date(label.replace(/\-/g, "\/")); //对应的年月日时分秒，注意，月份是从0开始，06表示7月   
                var leftTime = endDate.getTime() - now.getTime();
                var leftsecond = parseInt(leftTime / 1000);
                var day0 = parseInt(leftsecond / (24 * 60 * 60));
                var day1 = Math.floor(leftsecond / (60 * 60 * 24));
                var hour = Math.floor((leftsecond - day1 * 24 * 60 * 60) / 3600);
                var minute = Math.floor((leftsecond - day1 * 24 * 60 * 60 - hour * 3600) / 60);
                var second = Math.floor(leftsecond - day1 * 24 * 60 * 60 - hour * 3600 - minute * 60);

                var cc = document.getElementById(divname);
                if (leftTime > 0) {
                    cc.innerHTML = day0 * 24 + hour + "时" + minute + "分" + second + "秒";
                }
                else {
                    cc.innerHTML = "0秒";
                }
            } else {

                //document.getElementById("ctl00_ContentPlaceHolder1_Jiaoyidiv").style.visibility = "hidden";
                // document.getElementById("ContentPlaceHolder1_Jiaoyidiv").style.visibility = "hidden";
                document.getElementById("<%=Jiaoyidiv.ClientID %>").style.visibility = "hidden";
            }

        }


    </script>
    <div class="pageTitle">
        &nbsp;&nbsp;<%=OrderTitleName %>订单编号：<asp:Literal ID="TxtOrderFormNum" runat="server" />
    </div>
    <div id="order_content">
        <table class="ShopOrderStyle">
            <caption>
                <%=OrderTitleName %>订单状态信息</caption>
            <tr>
                <td>
                    <b>买家：</b><asp:LinkButton ID="LbtBuyer" runat="server" OnClick="LbtBuyer_Click"></asp:LinkButton>
                </td>
                <td>
                    <b>卖家：</b><asp:LinkButton ID="LbtSaler" runat="server" OnClick="LbtSaler_Click"></asp:LinkButton>
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                    <b>下单时间：</b><asp:Literal runat="server" ID="Order_InputTime" />
                </td>
                <td>
                    &nbsp;&nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <asp:CheckBox ID="CheckNeedInvoice" runat="server" Enabled="False" Text="需要发票" />
                </td>
                <td>
                    <asp:CheckBox ID="CheckInvoied" runat="server" Enabled="False" Text="已开发票" />
                </td>
                <td>
                    <b>订单状态：</b><asp:Literal ID="OrderStatus" runat="server" />
                </td>
                <td>
                    <b>付款状态：</b><asp:Literal ID="PayStatus" runat="server" />
                </td>
                <td>
                    <b>物流状态：</b><asp:Literal ID="DeliverStatus" runat="server" />
                </td>
            </tr>
            <tr>
                <td>
                    <b>发票类型：</b><asp:Literal ID="InvoiceType" runat="server" />
                </td>
                <td>
                    &nbsp;&nbsp;
                </td>
                <td>
                    &nbsp;&nbsp;
                </td>
                <td>
                    &nbsp;&nbsp;
                </td>
                <td>
                    &nbsp;&nbsp;
                </td>
            </tr>
        </table>
        <br />
        <table class="ShopOrderStyle">
            <caption>
                <%=OrderTitleName %>订单联系信息</caption>
            <tr>
                <td class="OrderTitle">
                    收货人姓名：
                </td>
                <td width="30%">
                    <asp:Literal ID="Contacter_Name" runat="server" />
                </td>
                <td class="OrderTitle">
                    联系电话：
                </td>
                <td width="30%">
                    <asp:Literal ID="Contacter_Phone" runat="server" />
                </td>
            </tr>
            <tr>
                <td class="OrderTitle">
                    收货人地址：
                </td>
                <td>
                    <asp:Literal ID="Contacter_Address" runat="server" />
                </td>
                <td class="OrderTitle">
                    邮政编码：
                </td>
                <td>
                    <asp:Literal ID="Contacter_ZipCode" runat="server" />
                </td>
            </tr>
            <tr>
                <td class="OrderTitle">
                    收货人邮箱：
                </td>
                <td>
                    <asp:Literal ID="Contacter_Email" runat="server" />
                </td>
                <td class="OrderTitle">
                    收货人手机：
                </td>
                <td>
                    <asp:Literal ID="Contacter_Mobile" runat="server" />
                </td>
            </tr>
            <tr>
                <td class="OrderTitle">
                    发票：
                </td>
                <td>
                    <asp:Literal ID="Need_Invoiced" runat="server" />
                </td>
                <td class="OrderTitle">
                    送货方式：
                </td>
                <td>
                    <asp:Literal ID="Deliver_ChargePaymentType" runat="server" />
                </td>
            </tr>
            <tr>
                <td class="OrderTitle">
                    付款方式：
                </td>
                <td>
                    <asp:Literal ID="lbPayName" runat="server" />
                </td>
                <td class="OrderTitle">
                    备注/留言：
                </td>
                <td colspan="3">
                    <asp:Literal ID="Order_Remark" runat="server" />
                </td>
            </tr>
        </table>
        <br />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <table class="ShopOrderStyle" style="text-align: center;" id="tab_Repeater">
                    <caption>
                        <%=OrderTitleName %>商品信息</caption>
                    <tr>
                        <th class="OrderTitle" style="width: 25%">
                            商品名称
                        </th>
                        <th class="OrderTitle" style="width: 8%">
                            数量/单位
                        </th>
                        <th class="OrderTitle" style="width: 8%">
                            <asp:Literal ID="ltrListTitle1" runat="server" Text="商品原价"></asp:Literal>
                        </th>
                        <th class="OrderTitle">
                            <asp:Literal ID="ltrListTitle2" runat="server" Text="商品单价"></asp:Literal>
                        </th>
                        <th class="OrderTitle" style="width: 8%">
                            需开发票
                        </th>
                        <th class="OrderTitle">
                            发票税率
                        </th>
                        <th class="OrderTitle" style="width: 6%">
                            规格
                        </th>
                        <th class="OrderTitle" style="width: 12%">
                            小结
                        </th>
                        <asp:Panel ID="pnlRptHead" runat="server">
                            <th>
                                操作
                            </th>
                        </asp:Panel>
                    </tr>
                    <asp:Repeater ID="Repeater1" runat="server">
                        <ItemTemplate>
                            <tr class="ShopProductOrderStyle">
                                <td>
                                    <asp:HyperLink ID="Pd_Name" NavigateUrl='<%# "../ShowProduct.aspx?ProductID="+Eval("ProductID") %>'
                                        runat="server" Text='<%# Eval("ProductName") %>' Target="_blank" />
                                </td>
                                <td>
                                    <asp:Literal ID="Pd_Quantity" runat="server" Text='<%# Eval("Quantity") %>' />
                                </td>
                                <td>
                                    <span style="color: red">
                                        <asp:Literal ID="Pd_StandPrice" runat="server" Text='<%#Eval("StandPrice") %>' /></span>
                                    <asp:HiddenField ID="hfNeedPresentExp" runat="server" Value='<%#Eval("NeedPresentExp") %>' />
                                </td>
                                <td>
                                    <span style="color: green">
                                        <asp:Literal ID="Pd_ListContent2" runat="server" Text='<%# Eval("Price") %>' />
                                    </span>
                                </td>
                                <td>
                                    <asp:Literal runat="server" ID="ni" Text='<%# (Eval("NeedInvoice").ToString()=="1")?"是":"否" %>' />
                                </td>
                                <td>
                                    <asp:Literal runat="server" ID="ir" Text='<%# Eval("InvoiceRate") %>' />
                                    %
                                </td>
                                <td>
                                    <asp:Literal runat="server" ID="color" Text='<%#Eval("GuiGe").ToString()=="" ?  "无" : Eval("GuiGe").ToString()%>' />
                                </td>
                                <td>
                                    <asp:Literal runat="server" ID="Pd_Total" Text='<%# "￥"+Eval("totalPrice") %>' />
                                </td>
                                <asp:Panel ID="pnlRptItem" runat="server">
                                    <td>
                                        <a style="cursor: pointer;" onclick="return showDivEditPrice('<%# Eval("ID") %>');">
                                            修改</a><%--
                            <asp:LinkButton ID="lkbtnDelInfo" runat="server" Text="修改" CommandName="editInfo"
                                CommandArgument='<%# Eval("ID") %>'></asp:LinkButton>--%>
                                    </td>
                                </asp:Panel>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                    <tr style="text-align: center;">
                        <td align="right" colspan="7">
                        </td>
                        <td align="left" colspan="2">
                            <b>合&nbsp;&nbsp;&nbsp;&nbsp;计：</b>￥<asp:Literal ID="LabTotalPrice" runat="server" />
                        </td>
                    </tr>
                    <tr style="text-align: center;">
                        <td colspan="3">
                            运费总额：￥<asp:Literal ID="LabDeliver_TotalPrice" runat="server" />
                            &nbsp; &nbsp; 发票税额：￥<asp:Literal ID="LabInvoice_TotalPrice" runat="server" />
                            <br />
                            商品总额：￥<asp:Literal ID="LabMoneyGoods" runat="server" />
                            &nbsp; &nbsp; 订单总计：￥<asp:Literal ID="CountMoneyTotal" runat="server" />
                            <br />
                            <asp:Literal ID="ltrCoupon" runat="server" />
                        </td>
                        <td colspan="2">
                            <b>实际金额：</b>￥<asp:Literal ID="LabMoneyTotal" runat="server" />
                        </td>
                        <td style="width: 33px">
                        </td>
                        <td colspan="3">
                            <b>已付款：</b>￥<asp:Literal ID="Pd_ReceiveMoney" runat="server" /><br />
                            <b style="color: Green">尚欠款：</b>￥<asp:Literal ID="Pd_OwnMoney" runat="server" />
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
        <br />
    </div>
    <%--订单记录 begin--%>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <div class="FloatDivStyle_EditPrice" id="divEditPrice" runat="server">
                <table class="ShopOrderStyle">
                    <caption>
                        修改订单<asp:Label ID="lblNumber" runat="server"></asp:Label>的价格</caption>
                    <tr>
                        <td class="OrderTitle">
                            &nbsp;商品名称 ：
                        </td>
                        <td>
                            <asp:Label ID="lblProductName" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="OrderTitle">
                            &nbsp;商品数量 ：
                        </td>
                        <td>
                            <asp:Label ID="lblQuantity" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="OrderTitle">
                            &nbsp;商品原价 ：
                        </td>
                        <td>
                            <asp:Label ID="lblStandPrice" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="OrderTitle">
                            &nbsp;改前价格 ：
                        </td>
                        <td>
                            <asp:Label ID="lblPrice" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="OrderTitle">
                            &nbsp;修改价格 ：
                        </td>
                        <td>
                            <asp:TextBox ID="txtEditPrice" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="OrderTitle">
                            &nbsp;说明 ：
                        </td>
                        <td>
                            <asp:TextBox ID="txtExplain" runat="server" TextMode="MultiLine" Width="260px" Height="60px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="text-align: center;">
                            <asp:HiddenField ID="hfEditItemID" runat="server" />
                            <asp:HiddenField ID="hfEditPrice" runat="server" />
                            <asp:HiddenField ID="hfEditExplain" runat="server" />
                            <asp:Button ID="btnEditPrice" runat="server" Text="修改" OnClientClick="return checkPass();"
                                OnClick="btnEditPrice_Click" />
                            <input type="button" value=" 关 闭 " onclick="document.getElementById('<%=divEditPrice.ClientID %>').style.display='none'" />
                        </td>
                    </tr>
                </table>
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnEditPrice" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    <%--订单记录 end--%>
    <div style="text-align: center">
        <asp:PlaceHolder ID="BuyerControl" runat="server">
            <asp:Button ID="Pay_Money" runat="server" Text=" 付 款 " OnCommand="PayMoney" />&nbsp;
            <asp:Button ID="ButReturn" runat="server" Text=" 退 货 " OnClick="ButReturn_Click" />&nbsp;
            <asp:Button ID="ButCusReceive" runat="server" Text=" 签 收 " OnClientClick="return confirm('系统将把支付款打给卖家帐户，确定签收吗？')"
                OnClick="ButCusReceive_Click" />&nbsp; </asp:PlaceHolder>
        <asp:PlaceHolder ID="SalerControl" runat="server">
            <asp:Button ID="ButConfirm" Text=" 确 认 " OnClientClick="document.getElementById('SureDiv').style.display='block';return false;"
                runat="server" />&nbsp;
            <asp:Button ID="Butdel" runat="server" Text=" 删 除 " OnClick="Butdel_Click" OnClientClick="return confirm('确认删除吗？')" />&nbsp;
            <asp:Button ID="Re_Money" runat="server" Text=" 收 款 " OnCommand="PayMoney" />&nbsp;
            <asp:Button ID="ButAgreedReturn" runat="server" Text="同意退货" OnClick="ButAgreedReturn_Click"
                Visible="false" />
            <asp:Button ID="ButOpenInvoice" runat="server" Text=" 开发票 " OnClick="ButOpenInvoice_Click" />&nbsp;
            <asp:Button ID="ButSend" runat="server" Text=" 发 货 " OnClick="ButSend_Click" />&nbsp;
        </asp:PlaceHolder>
        <input type="button" value=" 打 印 " onclick="PrintOrder()" />
        <input type="button" value=" 返 回 " onclick="history.back()" />
    </div>
    <br />
    <div class="ShopOrderTips" id="Jiaoyidiv" runat="server">
        <div style="padding: 5px;">
            <input id="lblTime" name="lblTime" runat="server" type="hidden" />
            <input id="Hidden1" name="lblTime" runat="server" type="hidden" />
            <b>交易提示：</b> 卖家（<asp:Literal ID="LilSaler" runat="server"></asp:Literal>）还有 <span
                id="divTime" style="color: red"></span>来完成本次交易的“发货”。 如果期间卖家（<asp:Literal ID="LilSalers"
                    runat="server"></asp:Literal>）没有“发货”，本交易将自动结束，并将货款退还。
        </div>
    </div>
    <br />
    <div class="ShopOrderTips">
        <div style="padding: 5px;">
            <b>注：</b><br />
            “<font color="blue">商品原价</font>”指商品的原始零售价。<br />
            “合计”指订单中“商品总额”+“运费总额”+“发票税额”。<br />
            “运费总额”指物流总费用。<br />
            “发票税额”指需要发票且商品价格未含税时需要买家支付的商品总税额。<br />
            “ 订单总计”指“商品总额”+“运费总额”+“发票税额”。<br />
            “<font color="green">实际金额</font>”买卖家双方协商指定的订单总额（订单以实际金额为标准）。<br />
        </div>
    </div>
    <div class="FloatDivStyle" id="SureDiv">
        <div class="pageTitle">
            确认订单</div>
        <asp:CheckBox ID="CheckSendMobileMesToCus" runat="server" Text="同时发送手机短信通知收货人已经确认订单" /><br />
        <asp:CheckBox ID="CheckSendMesMesToCus" runat="server" Checked="True" Text="同时使用站内短信通知会员已经确认订单" /><br />
        <asp:CheckBox ID="CheckSendEmailMesToCus" runat="server" Text="同时使用Email通知收货人已经确认订单" /><br />
        <div style="text-align: center; height: 35px; line-height: 35px;">
            <asp:Button ID="ConfirmButton" runat="server" OnClick="ConfirmButton_Click" Text=" 确 认 " />
            <input type="button" value=" 关 闭 " onclick="document.getElementById('SureDiv').style.display='none'" />
        </div>
        <div style="background: #D3E7F6; color: #448AD0;">
            请仔细检查此订单的所有信息，特别是实际销售价、 售后服务期限等信息，确定无误后点“确认”按 钮，否则请点击“关闭”按钮。
        </div>
    </div>
    <div id="MainMenu">
        <div class="TabMenu">
            <!--一级导航-->
            <ul id="M1">
                <li class="active"><a href="javascript:ShowShopOrder('OrderOtherInfo')" onclick="setButtonActive(0)">
                    付款信息</a></li>
                <li><a href="javascript:ShowShopOrder('ShowInvoiceItem')" onclick="setButtonActive(1)">
                    发票记录</a></li>
                <li><a href="javascript:ShowShopOrder('ShowDeliverItem')" onclick="setButtonActive(2)">
                    发退货记录</a></li>
            </ul>
        </div>
        <div class="OrderOtherInfoStyle">
            <div id="OrderOtherInfo">
                <asp:Repeater ID="PayInfo" runat="server">
                    <HeaderTemplate>
                        <table class="ShopOrderStyle">
                            <tr>
                                <th width="150">
                                    时间
                                </th>
                                <th width="100">
                                    方式
                                </th>
                                <th width="100">
                                    金额
                                </th>
                                <th width="100">
                                    状态
                                </th>
                                <th>
                                    备注
                                </th>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr class="ShopProductOrderStyle">
                            <td>
                                <asp:Literal ID="Paytype" Text='<%#Eval("PayTime") %>' runat="server" />
                            </td>
                            <td>
                                <asp:Literal ID="eBankID" runat="server" Text='<%# HoWave.Web.Shop.TextFormat.GetBank(Eval("eBankID").ToString()) %>' />
                            </td>
                            <td>
                                <asp:Literal ID="MoneyPay" runat="server" Text='<%#Eval("MoneyPay") %>' />
                            </td>
                            <td>
                                <asp:Literal ID="Status" runat="server" Text='<%# PayOutStatus(Eval("Status").ToString()) %>' />
                            </td>
                            <td>
                                <asp:Literal ID="Remark" runat="server" Text='<%#Eval("Remark") %>' />
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
            </div>
            <div id="ShowInvoiceItem" style="position: absolute; z-index: 1000; width: 98%; height: auto;
                margin: auto; text-align: center; vertical-align: middle; display: none;">
                <asp:Repeater ID="InvoiceItem" runat="server">
                    <HeaderTemplate>
                        <table class="ShopOrderStyle">
                            <tr>
                                <th width="150">
                                    时间
                                </th>
                                <th width="100">
                                    发票抬头
                                </th>
                                <th width="100">
                                    发票金额
                                </th>
                                <th width="100">
                                    经手人
                                </th>
                                <th width="300">
                                    发票内容
                                </th>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr class="ShopProductOrderStyle">
                            <td width="150">
                                <asp:Literal ID="InvoiceDate" Text='<%#Eval("InvoiceDate") %>' runat="server" />
                            </td>
                            <td width="100">
                                <asp:Literal ID="InvoiceTitle" runat="server" Text='<%#Eval("InvoiceTitle") %>' />
                            </td>
                            <td width="100">
                                <asp:Literal ID="TotalMoney" runat="server" Text='<%#Eval("TotalMoney") %>' />
                            </td>
                            <td width="100">
                                <asp:Literal ID="Inputer" runat="server" Text='<%#Eval("Inputer") %>' />
                            </td>
                            <td width="100">
                                <asp:Literal ID="InvoiceContent" runat="server" Text='<%#Eval("InvoiceContent") %>' />
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
            </div>
            <div id="ShowDeliverItem" style="position: absolute; z-index: 1000; width: 98%; height: auto;
                margin: auto; text-align: center; vertical-align: middle; display: none;">
                <asp:Repeater ID="DeliverItem" runat="server">
                    <HeaderTemplate>
                        <table class="ShopOrderStyle">
                            <tr>
                                <th width="150">
                                    时间
                                </th>
                                <th width="100">
                                    物流公司
                                </th>
                                <th width="100">
                                    物流号
                                </th>
                                <th width="100">
                                    经手人
                                </th>
                                <th width="300">
                                    备注
                                </th>
                                <th width="100">
                                    发退货状态
                                </th>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr class="ShopProductOrderStyle">
                            <td width="150">
                                <asp:Literal ID="DeliverDate" Text='<%#Eval("DeliverDate") %>' runat="server" />
                            </td>
                            <td width="100">
                                <asp:Literal ID="DeliverCompany" runat="server" Text='<%#Eval("DeliverCompany") %>' />
                            </td>
                            <td width="100">
                                <asp:Literal ID="ExpressNumber" runat="server" Text='<%#Eval("ExpressNumber") %>' />
                            </td>
                            <td width="100">
                                <asp:Literal ID="HandlerName" runat="server" Text='<%#Eval("HandlerName") %>' />
                            </td>
                            <td width="100">
                                <asp:Literal ID="Remark" runat="server" Text='<%#Eval("Remark") %>' />
                            </td>
                            <td width="100">
                                <asp:Literal ID="LtFatReturn" runat="server" Text='<%#ShowFatreturnStatus(Eval("DeliverType").ToString()) %>'></asp:Literal>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
            </div>
        </div>
        <br />
    </div>
    <br />
    <script type="text/javascript">
        function ShowShopOrder(obj) {
            document.getElementById("OrderOtherInfo").style.display = "none";
            document.getElementById("ShowInvoiceItem").style.display = "none";
            document.getElementById("ShowDeliverItem").style.display = "none";
            document.getElementById(obj).style.display = "";

        }

        function PrintOrder() {
            var old_action, old_target;
            var _form = document.forms["aspnetForm"];
            old_action = _form.action;
            old_target = _form.target;
            _form.action = "Shop_PrintOrder.aspx";
            _form.target = "blank";
            var _printContent = $("#PrintContent");
            _printContent.val(document.getElementById("order_content").innerHTML);
            _form.submit();
            _form.action = old_action;
            _form.target = old_target;
            _printContent.value = "";
        }
    </script>
    <%--DIV模拟模式对话框window.showModalDialog效果 --%>
    <script type="text/javascript">
        //基本信息
        function checkEditPrice() {
            var proPrice = $("#<%=txtEditPrice.ClientID %>");
            //输入的数量是数字且不能小于0
            if (proPrice.val().length == "") {
                alert("请输入修改的价格！");
                proPrice.focus();
                return false;
            }
            if ((isNaN(proPrice.val()) == true)) {//判断输入的是否为数字
                alert("请您输入0~9之间的数字！");
                proPrice.focus();
                proPrice.val("0");
                return false;
            }

            var hfEditItemID = $("#<%=hfEditItemID.ClientID %>"); //ID
            hfEditItemID.val();

            var hfEditPrice = $("#<%=hfEditPrice.ClientID %>"); //修改价格
            hfEditPrice.val(proPrice.val());

            var txtExplain = $("#<%=txtExplain.ClientID %>"); //修改价格原因
            var hfEditExplain = $("#<%=hfEditExplain.ClientID %>"); //修改价格原因
            hfEditExplain.val(txtExplain.val());

            return true;
        }
        function checkPower() {
            var divEditPrice = document.getElementById("<%=divEditPrice.ClientID %>");
            var Ownerpower = "<%=Ownerpower %>"; //库存管理权限
            if (Ownerpower.trim().toLowerCase() == "false") {
                alert("权限不足，不能修改订单的价格！");
                divEditPrice.style.display = "none";
                return false;
            }
            return true;
        }
        function checkPass() {
            if (checkEditPrice() && checkPower()) {
                return true;
            } else {
                return false;
            }
        }
        //显示修改订单记录的信息
        function showDivEditPrice(Id) {
            var divEditPrice = document.getElementById("<%=divEditPrice.ClientID %>"); //document.getElementById("divEditPrice");
            var Ownerpower = "<%=Ownerpower %>"; //库存管理权限
            if (Ownerpower.trim().toLowerCase() == "false") {
                alert("权限不足，不能修改订单的价格！");
                divEditPrice.style.display = "none";
            } else {
                GetOrderItemByID(Id);
                divEditPrice.style.display = "block";
            }
            return false;
        }

        //订单记录信息
        function GetOrderItemByID(id) {
            var lblNumber = $("#<%=lblNumber.ClientID %>"); //订单号码
            var lblProductName = $("#<%=lblProductName.ClientID %>"); //商品名称
            var lblQuantity = $("#<%=lblQuantity.ClientID %>"); //商品数量
            var lblStandPrice = $("#<%=lblStandPrice.ClientID %>"); //原价
            var lblPrice = $("#<%=lblPrice.ClientID %>"); //修改前的价格
            var hfEditItemID = $("#<%=hfEditItemID.ClientID %>"); //ID

            $.post("../WebService/ShopService.ashx", { 'Action': 'GetOrderItemByID', 'ID': id }, function (data, state) {
                if (state == "success") {
                    if (data.toString() != "") {
                        var d = eval(data);
                        $.each(d.table1, function (i) {
                            hfEditItemID.val(d.table1[i].ID);
                            lblNumber.text(d.table1[i].OrderFormNum);
                            lblProductName.text(d.table1[i].ProductName);
                            lblQuantity.text(d.table1[i].Quantity);
                            lblStandPrice.text(d.table1[i].StandPrice);
                            lblPrice.text(d.table1[i].Price);
                        });
                    }
                }
            });
        }

        function sAlert(str) {
            var msgw, msgh, bordercolor;
            msgw = 400; //提示窗口的宽度
            msgh = 100; //提示窗口的高度
            titleheight = 25 //提示窗口标题高度
            bordercolor = "#336699"; //提示窗口的边框颜色
            titlecolor = "#99CCFF"; //提示窗口的标题颜色

            var sWidth, sHeight;
            sWidth = document.body.offsetWidth;
            sHeight = screen.height;
            var bgObj = document.createElement("div");
            bgObj.setAttribute('id', 'bgDiv');
            bgObj.style.position = "absolute";
            bgObj.style.top = "0";
            bgObj.style.background = "#777";
            bgObj.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
            bgObj.style.opacity = "0.6";
            bgObj.style.left = "0";
            bgObj.style.width = sWidth + "px";
            bgObj.style.height = sHeight + "px";
            bgObj.style.zIndex = "10000";
            document.body.appendChild(bgObj);

            var msgObj = document.createElement("div")
            msgObj.setAttribute("id", "msgDiv");
            msgObj.setAttribute("align", "center");
            msgObj.style.background = "white";
            msgObj.style.border = "1px solid " + bordercolor;
            msgObj.style.position = "absolute";
            msgObj.style.left = "50%";
            msgObj.style.top = "50%";
            msgObj.style.font = "12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
            msgObj.style.marginLeft = "-225px";
            msgObj.style.marginTop = -75 + document.documentElement.scrollTop + "px";
            msgObj.style.width = msgw + "px";
            msgObj.style.height = msgh + "px";
            msgObj.style.textAlign = "center";
            msgObj.style.lineHeight = "25px";
            msgObj.style.zIndex = "10001";

            var title = document.createElement("h4");
            title.setAttribute("id", "msgTitle");
            title.setAttribute("align", "right");
            title.style.margin = "0";
            title.style.padding = "3px";
            title.style.background = bordercolor;
            title.style.filter = "progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";
            title.style.opacity = "0.75";
            title.style.border = "1px solid " + bordercolor;
            title.style.height = "18px";
            title.style.font = "12px Verdana, Geneva, Arial, Helvetica, sans-serif";
            title.style.color = "white";
            title.style.cursor = "pointer";
            title.innerHTML = "关闭";
            title.onclick = function () {
                document.body.removeChild(bgObj);
                document.getElementById("msgDiv").removeChild(title);
                document.body.removeChild(msgObj);
            }
            document.body.appendChild(msgObj);
            document.getElementById("msgDiv").appendChild(title);
            var txt = document.createElement("p");
            txt.style.margin = "1em 0"
            txt.setAttribute("id", "msgTxt");
            txt.innerHTML = str;
            document.getElementById("msgDiv").appendChild(txt);
        }
    </script>
</asp:Content>
