<%@ Page Language="C#" AutoEventWireup="false" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Controls" Assembly="Hishop.Web.Controls" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Management" Assembly="Hishop.Web.Management" %>
<%@ Register TagPrefix="UI" Namespace="ASPNET.WebControls" Assembly="ASPNET.WebControls" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Validator" Assembly="Hishop.Web.Validator" %>
<%@ Import Namespace="Hishop.SystemServices" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <Hishop:HeadContainer ID="HeadContainer1" runat="server" />
    <Hishop:PageTitle ID="PageTitle1" runat="server" />
    <link rel="stylesheet" href="../../utility/validate/pagevalidator.css" type="text/css" />
    <link rel="stylesheet" href="../css/Hishopv5.css" type="text/css" />
    <script type="text/javascript" src="../../utility/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../../utility/validate/pagevalidator.js"></script>    
    <script type="text/javascript" src="../js/Hishopv5.js"></script>
        <script type="text/javascript" src="../js/DropDonwList.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <div>         
            <div class="PageTitleArea">
                <div class="PageTitle">
                    <asp:Literal ID="lblPageTitle" runat="server" Text="<%$ Resources:ManageOrder, IDS_PageTitle %>"></asp:Literal>
                </div>
                <div style="width: 80%;">
                    <asp:Literal ID="lblPageDesc" runat="server" Text="<%$ Resources:ManageOrder, IDS_PageDesc %>"></asp:Literal>
                </div>
            </div>
            <Hishop:ManageOrder ID="ManageOrder" runat="server">
                <SkinTemplate>
                    <!-- 操作提示 -->
                        <Hishop:StatusMessage id="Status" runat="server" Visible="False" />
<!--search bar-->
<fieldset class="AdminSearchform">
    <legend>
        <asp:Literal ID="litSearchTitle" Text="<%$ Resources:ManageOrder, IDS_Literal_SearchTitle %>"
            runat="server"></asp:Literal>
    </legend>
    <table width="50%" border="0" cellspacing="0" cellpadding="0" style="margin-left: 18px">
        <tr>
            <!--username-->
            <td class="searchTableLeftTD">
                <nobr>
                    <asp:Label ID="lblUserName" runat="server" Text="<%$Resources:ManageOrder,IDS_Label_UserName %>"></asp:Label></nobr>
            </td>
            <td class="searchTableControlTD">
                <asp:TextBox ID="txtUserName" runat="server" width="100" />
            </td>
            <!--shipto-->
            <td  align="right">
                <nobr>
                    <asp:Label ID="lblShipTo" runat="server" Text="<%$ Resources:ManageOrder,IDS_Label_Shipping %>"></asp:Label></nobr>
            </td>
            <td class="searchTableControlTD" >
                <asp:TextBox ID="txtShipTo" runat="server" width="100"/>
            </td>
            <!--starttime-->
            <td class="searchTableLeftTD">
                <nobr>
                    <asp:Label ID="lblStartDate" runat="server" Text="<%$Resources:ManageOrder,IDS_Label_StartDate %>"></asp:Label></nobr>
            </td>
            <td class="searchTableControlTD">
                <Hishop:WebCalendar ID="calendarStartDate" CalendarType="StartDate" runat="server" width="100"/>
            </td>
            <!--endtime-->
            <td class="searchTableLeftTD">
                <nobr>
                    <asp:Label ID="lblEndDate" runat="server" Text="<%$ Resources:ManageOrder,IDS_Label_EndDate %>"></asp:Label></nobr>
            </td>
            <td class="searchTableControlTD" >
                <Hishop:WebCalendar ID="calendarEndDate" runat="server" CalendarType="EndDate"/>
            </td>
        </tr>
        <tr>
            <!--orderId-->
            <td class="searchTableLeftTD">
                <nobr>
                    <asp:Label ID="lblOrderId" runat="server" Text="<%$Resources:ManageOrder,IDS_Label_OrderId %>"></asp:Label></nobr>
            </td>
            <td class="searchTableControlTD">
                <asp:TextBox ID="txtOrderId" runat="server" width="100"/>
            </td>
            <!--orderStatus-->
            <td class="searchTableLeftTD">
                <nobr>
                    <asp:Label ID="litOrderStatus" runat="server" Text="<%$ Resources:ManageOrder,IDS_Label_OrderStatus %>"></asp:Label></nobr>
            </td>
            <td class="searchTableControlTD" >
                <Hishop:OrderStautsForSearchDropDownList ID="dropOrderStatus" AllowNull="true" NullToDisplay="646454"
                    runat="server" width="108"/>
            </td>
            <!--payment-->
            <td class="searchTableLeftTD">
                <nobr>
                    <asp:Label ID="litPayment" runat="server" Text="<%$ Resources:ManageOrder,IDS_grdPayment %>"></asp:Label>：</nobr>
            </td>
            <td class="searchTableControlTD" >
                <Hishop:PaymentDropDownList ID="dropPayment" AllowNull="true" runat="server" width="108"/>
            </td>
            <!--pageSize-->            
            <td class="searchTableLeftTD">
                <nobr>
                    <asp:Label ID="lblPageSize" runat="server" Text="<%$ Resources:ManageOrder,IDS_Label_PageSize %>"></asp:Label></nobr>
            </td>
            <td class="searchTableControlTD" >
                <Hishop:PageSizeDropDownList ID="dropPageSize" runat="server" width="108"/>
            </td>
            <td><asp:LinkButton ID="btnSearchButton" Text="<%$ Resources:ProductSearch, IDS_Button_Search %>" runat="server" CssClass="inp_L1" width="35" height="20" /></td>
        </tr>
    </table>
</fieldset>
<div>
    <ul class="anchors clearfix">       
        <li id="anchors_0"><!--所有--><asp:HyperLink ID="hlinkAllOrder" runat="server" Text="<%$ Resources:ManageOrder, IDS_OrderStatus_All_Oreder %>"></asp:HyperLink></li>
        <li id="anchors_1"><!--未付款订单--><asp:HyperLink ID="hlinkNotPay" runat="server" Text="<%$ Resources:ManageOrder, IDS_OrderStatus_WAIT_BUYER_PAY %>"></asp:HyperLink></li>
        <li id="anchors_2"><!--已付款订单--><asp:HyperLink ID="hlinkYetPay" runat="server" Text="<%$ Resources:ManageOrder, IDS_OrderStatus_Pay_Order %>"></asp:HyperLink></li>       
        <li id="anchors_3"><!--配货中订单--><asp:HyperLink ID="hlinkSendingGoods" runat="server" Text="<%$ Resources:ManageOrder, IDS_OrderStatus_PREPARE_GOODS %>"></asp:HyperLink></li>
        <li id="anchors_4"><!--已发货订单--><asp:HyperLink ID="hlinkSendedGoods" runat="server" Text="<%$ Resources:ManageOrder, IDS_OrderStatus_Delivered %>"></asp:HyperLink></li>
        <li id="anchors_5"><!--已完成订单--><asp:HyperLink ID="hlinkTradeFinished" runat="server" Text="<%$ Resources:ManageOrder, IDS_OrderStatus_TRADE_FINISHED %>"></asp:HyperLink></li>
        <li id="anchors_6"><!--申请退款订单--><asp:HyperLink ID="hlinkRequested" runat="server" Text="<%$ Resources:ManageOrder, IDS_OrderStatus_BUYER_Requested %>"></asp:HyperLink></li>
        <li id="anchors_7"><!--已退款订单--><asp:HyperLink ID="hlinkRefund" runat="server" Text="<%$ Resources:ManageOrder, IDS_OrderStatus_BUYER_REFUND %>"></asp:HyperLink></li>
    </ul>
</div>

<div class="grdGroupFormList">
   <div class="grdHeaderStyle">
	     <ul>
	           <li class="userGroupCheckAll"><a href="#" onclick="CheckClickAll()"><asp:Literal ID="lblCheckAll" runat="server" Text="<%$ Resources:Resources, IDS_Label_CheckAll %>"></asp:Literal></a></li>
	           <li class="spirtLines">|</li>
	           <li class="userGroupReverseCheck"><a href="#" onclick="CheckReverse()"><asp:Literal ID="lkbCheckReverse" runat="server" Text="<%$ Resources:Resources, IDS_Label_CheckReverse %>"></asp:Literal></a></li>
	           <li class="spirtLines">|</li>
	           <li class="userGroupDelCheck"><Hishop:DeleteImageLinkButton ID="lkbtnDeleteCheck" runat="server" OnClientClick="" DeleteMsg="<%$ Resources:ManageOrder, IDS_OrderOption %>"  Text="<%$ Resources:Resources, IDS_Button_DeleteCheck %>" /></li>
	     </ul>
    </div>
    <div class="grdGroupListLi">
                <Hishop:CustomGridView ID="grdOrders" runat="server" SortOrderBy="OrderDate" SortOrder="DESC"
                    AutoGenerateColumns="False" DataKeyNames="OrderId" CssClass="GridViewStyle" GridLines="None"
                    ShowHeader="true" AllowSorting="true" RowStyle-CssClass="grdrow" HeaderStyle-CssClass="GridViewHeaderStyle">
                    <Columns>
                        <Hishop:CheckBoxColumn ReadOnly="true"/>
                        
                        <asp:TemplateField HeaderText="<%$ Resources:ManageOrder,IDS_grdOrderId %>" SortExpression="OrderId">
                            <itemtemplate>
                            <asp:Label ID="lblOrderId" Text='<%#Eval("OrderId") %>' runat="server" ></asp:Label><asp:Literal ID="group" runat="server" Text='<%# Convert.ToInt32(Eval("GroupBuyId"))>0?"(团)":"" %>' />
                         </itemtemplate>
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="<%$ Resources:ManageOrder, IDS_Header_OrderDate %>" SortExpression="OrderDate">
                            <itemtemplate>
                               <Hishop:FormatedTimeLabel ID="lblStartTimes" Time='<%#Eval("OrderDate") %>' ShopTime="true" runat="server" ></Hishop:FormatedTimeLabel>
                            </itemtemplate>
                        </asp:TemplateField>
                        
                         <asp:TemplateField HeaderText="<%$ Resources:ManageOrder,IDS_grdUserName %>" SortExpression="UserName">
                         <itemtemplate>                       
                            <asp:Label ID="lblParentUserName" Text='<%#Eval("UserName") %>' runat="server" ></asp:Label>
                            <a href='<%# Globals.GetSiteUrls().UrlData.FormatUrl("admin_EditAgent",Eval("ParentUserId")) %>'><img src="../images/addActing.png"  visible='<%# (Eval("ParentUserId") == DBNull.Value ||(int)Eval("ParentUserId")==0) ?false:true %>' runat="server"/></a>
                         </itemtemplate> 
                         </asp:TemplateField>
                        
                        <asp:BoundField HeaderText="<%$ Resources:ManageOrder,IDS_grdShipTo %>" DataField="ShipTo" SortExpression="ShipTo" />
                        
                        
                         <asp:TemplateField HeaderText="<%$ Resources:ManageOrder, IDS_grdAmount %>" ItemStyle-Width="80px" SortExpression="OrderTotal">
                         <itemtemplate>                       
                            <Hishop:FormatedMoneyLabelForAdmin Money='<%#Eval("OrderTotal") %>' runat="server" ></Hishop:FormatedMoneyLabelForAdmin>
                         </itemtemplate> 
                         </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="<%$ Resources:ManageOrder, IDS_grdPayment %>" ItemStyle-Width="80px">
                            <itemtemplate>
                                <asp:Label ID="lblOrderpayment" Text='<%#Eval("PaymentType") %>' runat="server" ></asp:Label>
                            </itemtemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="<%$ Resources:ManageOrder, IDS_grdStatusName %>" ItemStyle-Width="50px">
                            <itemtemplate>
                                <Hishop:PaymentStatusLabel ID="lblOrderPaymentStatus" Text='<%# Eval("PaymentStatus") %>' runat="server" />
                                <div><Hishop:RefundStatusLabel ID="lblOrderRefundStatus" Text='<%# Eval("RefundStatus") %>' runat="server" /></div>
                                <Hishop:ShippingStatusLabel ID="lblOrderShippingStatus" Text='<%# Eval("ShippingStatus") %>' runat="server" />
                                <div><Hishop:ActivityStatusLabel ID="lblOrderActivityStatus" Text='<%# Eval("ActivityStatus") %>' runat="server" /></div>
                            </itemtemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="打印" ItemStyle-Width="90px">
                            <ItemTemplate>
	                           <asp:HyperLink CssClass="SmallCommonTextButton" ID="lkbtnPrintOrder" runat="server" NavigateUrl='<%# Globals.GetSiteUrls().UrlData.FormatUrl("admin_PrintOrder", Eval("OrderId")) %>' Target="_blank" Text="购" ToolTip="购物清单打印"></asp:HyperLink>
	                           <asp:HyperLink CssClass="SmallCommonTextButton" ID="lkbtnPrintPackingOrder" runat="server" NavigateUrl='<%# Globals.GetSiteUrls().UrlData.FormatUrl("admin_PrintPackingOrder", Eval("OrderId")) %>'  Target="_blank" Text="配" ToolTip="配货单打印"></asp:HyperLink>
	                           <asp:HyperLink CssClass="SmallCommonTextButton" ID="lkbtn" runat="server" NavigateUrl='<%# Globals.GetSiteUrls().UrlData.FormatUrl("admin_PrintData", Eval("OrderId")) %>'  Target="_blank" Text="快" ToolTip="快递单打印"></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
                            <asp:TemplateField HeaderText="<%$ Resources:Resources, IDS_Header_Options %>">
                                <ItemStyle />
                                <ItemTemplate>
                                   <asp:Label ID="lblIsCOD" Text='<%#Eval("IsPOD") %>' runat="server" Visible="false"></asp:Label>
		                           <asp:HyperLink CssClass="SmallCommonTextButton" ID="lkbtnSearch" runat="server" NavigateUrl='<%# Globals.GetSiteUrls().UrlData.FormatUrl("admin_OrderDetails", Eval("OrderId")) %>' Target="_blank" Text="<%$ Resources:ManageOrder, IDS_FormField_SearchOrder %>"></asp:HyperLink>
		                           <asp:HyperLink CssClass="SmallCommonTextButton" ID="lkbtnEdit" runat="server" NavigateUrl='<%# Globals.GetSiteUrls().UrlData.FormatUrl("admin_EditOrder", Eval("OrderId")) %>'  Target="_blank" Text="<%$ Resources:ManageOrder, IDS_FormField_EditOrder %>" Visible="false"></asp:HyperLink>
		                           <asp:HyperLink CssClass="SmallCommonTextButton" ID="lkbtnBuyerRefund" runat="server" NavigateUrl='<%# Globals.GetSiteUrls().UrlData.FormatUrl("admin_RefundOrder", Eval("OrderId")) %>' Target="_blank" Text="<%$ Resources:ManageOrder, IDS_FormField_BuyerRefund %>" Visible="false"></asp:HyperLink>
		                           <asp:HyperLink CssClass="SmallCommonTextButton" ID="lkbtnSendGoods" runat="server" NavigateUrl='<%# Globals.GetSiteUrls().UrlData.FormatUrl("admin_SendGoods", Eval("OrderId")) %>' Target="_blank" Text="<%$ Resources:ManageOrder, IDS_FormField_SendGoods %>" Visible="false"></asp:HyperLink>
                                   <Hishop:ImageLinkButton CssClass="SmallCommonTextButton" ID="lkbOption1" runat="server" ></Hishop:ImageLinkButton>
                                   <ul>
                                        <li style="margin-top:5px;"><a id="lkbAdminRemark" onclick="$.myfunction.OpenWindow(<%# Eval("OrderId") %>)" style="color:Blue;cursor:hand; color:#005588">管理员备注</a></li>
                                        <li style="margin-top:3px; margin-left:5px; margin-right:5px;">|</li>
                                        <li style="margin-top:5px;"><a id="A1" onclick="$.leavewordFunction.leavewordOpenWindow(<%# Eval("OrderId") %>)" style="color:Blue;cursor:hand; color:#005588">订单留言<asp:Image ID="imgLeaveword" alt='<%# "有" + Eval("NoVisitNum") + "条未读"%>' src="../images/new.gif" Visible='<%# (Convert.ToInt32(Eval("NoVisitNum")) > 0)?true:false%>' runat="server" /></a></li>
                                   </ul>  
                                </ItemTemplate>
                            </asp:TemplateField>
                    </Columns>
                </Hishop:CustomGridView>
                <div class="grdGroupTabhead">
                    <UI:Pager runat="server" ListToPaging="grdOrders" ID="pager" RunningMode="Get" />
                </div>
    </div>
</div>


<!-- 管理员备注窗体内容 -->
<script type="text/javascript">
    var remark = "";
    var canRemark='<%=HiContext.Current.User.HasPrivilege(Privilege.RemarkOrder)%>';
    var canLeave='<%=HiContext.Current.User.HasPrivilege(Privilege.WordOrder)%>';
    var isadmin='<%=HiContext.Current.User.IsAdministrator%>';
    $(document).ready(function() {
        jQuery.myfunction = {
            OpenWindow: function(orderId) {
                if(canRemark!="True" && isadmin!="True")
                {
                    alert("您当前没有权限进行备注！");
                    return;
                }
                if (!dlgAdminRemark.get_isShowing()) {
                    dlgAdminRemark.Show();
                    document.getElementById("ManageOrder_txtRemarkOrderId").value = orderId;
                    CBRemarkList.callback("BindRemark");
                }
            },
            AddRemark: function() {            
               //alert($.trim($("#ManageOrder_txtRemark").val()));
                if ($.trim($("#ManageOrder_txtRemark").val())!= "")
                 {
                    CBRemarkList.callback("AddRemark");
                }
                else 
                {
                    alert("添加的订单备注不能为空");
                }
            },
            UpdateRemark: function(remarkId)
             {
                 remark=$.trim($("#txtRemarkPost").val());
                 if (remark!="")
                 {
                    CBRemarkList.callback("UpdateRemark",remarkId, remark);
                 }
                 else
                 {
                  alert("修改内容不能为空");
                 }
                /*if (remark != "" && remark != undefined) {
                    CBRemarkList.callback("UpdateRemark", remarkId, remark);
                    remark = "";
                }
                else {
                    alert("修改的订单备注失败");
                }*/
            },
            DeleteRemark: function(remarkId) { 
                CBRemarkList.callback("DeleteRemark", remarkId);
            }
        }
    });

    function getRemark(obj) {
        remark = obj.innerHTML;
    }
</script>
          <UI:Dialog AnimationType="Live" ShowTransition="Fade" AnimationSlide="ExponentialDecelerate"
            CloseTransition="Fade" AnimationDuration="600" Modal="true"
            AllowDrag="true" Alignment="MiddleCentre" Title="管理员备注"
            ID="dlgAdminRemark" runat="server" Width="700px">
            <Content>
              <asp:TextBox ID="txtRemarkOrderId" runat="server" style="display:none"></asp:TextBox>
              <asp:Panel ID="AffirmTitle" runat="server">
                    <div class="PageTitleArea" >
                        <div class="PageTitle">
                            <asp:Literal ID="lblPageTitleRemark" runat="server" Text="<%$ Resources:ManageOrder, IDS_PageTitle_Remark %>"></asp:Literal>
                        </div>
                        <div style="width: 80%;">
                            <asp:Literal ID="lblPageDescRemark" runat="server" Text="<%$ Resources:ManageOrder, IDS_PageDesc_Remark %>"></asp:Literal>
                        </div>
                    </div>
                   <asp:TextBox ID="txtRemark" Width="99%" Height="40px" TextMode="MultiLine"  runat="server" ></asp:TextBox>
                   <p style="padding:5px;clear:both;"><input type="button" onclick="$.myfunction.AddRemark();" value="添加备注" class="inp_L1" /></p>
                   <UI:CallBack id="CBRemarkList" CacheContent="false" runat="server" PostState="true" Debug="false">
                     <Content>   
                       <div >  
                        <UI:TemplatedList ID="dlstRemarkList" runat="server" Width="100%" DataKeyField="RemarkId" RunningMode="Callback">                                                                                                                                                            
                            <HeaderTemplate>
                                <table class="GridViewStyle" cellspacing="0" border="0" style=" width:100%; border-style:solid; border-width:thin;">
                            </HeaderTemplate>  
                            <ItemTemplate>
                                 <tr >
                                    <td><asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:ManageOrder, IDS_Field_RemarkId %>"></asp:Literal>：<asp:Literal ID="Literal2" runat="server" Text='<%# Eval("RemarkId") %>'></asp:Literal></td>                                                                                  
                                    <td><asp:Literal ID="Literal3" runat="server" Text="<%$ Resources:ManageOrder, IDS_Field_OperaterName %>"></asp:Literal>：<asp:Literal ID="Literal4" runat="server" Text='<%# Eval("OperaterName") %>'></asp:Literal></td>
                                    <td><asp:Literal ID="Literal5" runat="server" Text="<%$ Resources:ManageOrder, IDS_Field_RemarkDate %>"></asp:Literal>：<Hishop:FormatedTimeLabel ID="FormatedTimeLabel1" Time='<%# Eval("RemarkDate") %>' runat="server" /></td>
                                    <td><asp:Literal ID="litlLastDateMsg" runat="server" Text="<%$ Resources:ManageOrder, IDS_Field_LastDate %>" Visible='<%# Convert.ToString(Eval("LastDate")) != Convert.ToString(Eval("RemarkDate")) %>'></asp:Literal><Hishop:FormatedTimeLabel ID="FormatedTimeLabel2" Time='<%# Eval("LastDate") %>' runat="server" Visible='<%# Convert.ToString(Eval("LastDate")) != Convert.ToString(Eval("RemarkDate")) %>' /></td>
                                 </tr>
                                 <tr>
                                    <td colspan="4">
                                        <div style="padding:5px;width:670px;white-space:normal;overflow:hidden;">
                                        <asp:Literal ID="Literal6" runat="server" Text='<%# Eval("Remark") %>'></asp:Literal></div>
                                    </td>
                                 </tr>  
                                 <tr>
                                    <!-- 按钮 -->
                                    <td style="text-align:left;" colspan="4">
                                        <asp:LinkButton ID="btnRemarkEdit" runat="server"  CommandName="Edit"  CssClass="SmallCommonTextButton" Text="<%$ Resources:Resources, IDS_Button_Edit %>" Visible='<%# HiContext.Current.User.UserId == Convert.ToInt32(Eval("UserId")) %>'></asp:LinkButton>                                         
                                        <input type="button" onclick="$.myfunction.DeleteRemark(<%# Eval("RemarkId")%>);" id="btnDeleteRemark" value="删除" class="SmallCommonTextButton" />
                                    </td>
                                 </tr>                           
                            </ItemTemplate>   
                            <EditItemTemplate> 
                                 <tr >
                                    <td><asp:Literal ID="Literal7" runat="server" Text="<%$ Resources:ManageOrder, IDS_Field_RemarkId %>"></asp:Literal>：<asp:Literal ID="Literal1" runat="server" Text='<%# Eval("RemarkId") %>'></asp:Literal></td>                                                                                  
                                    <td><asp:Literal ID="Literal8" runat="server" Text="<%$ Resources:ManageOrder, IDS_Field_OperaterName %>"></asp:Literal>：<asp:Literal ID="Literal2" runat="server" Text='<%# Eval("OperaterName") %>'></asp:Literal></td>
                                    <td><asp:Literal ID="Literal9" runat="server" Text="<%$ Resources:ManageOrder, IDS_Field_RemarkDate %>"></asp:Literal>：<Hishop:FormatedTimeLabel ID="FormatedTimeLabel1" Time='<%# Eval("RemarkDate") %>' runat="server" /></td>
                                    <td><asp:Literal ID="litlLastDateMsg" runat="server" Text="<%$ Resources:ManageOrder, IDS_Field_LastDate %>" Visible='<%# Convert.ToString(Eval("LastDate")) != Convert.ToString(Eval("RemarkDate")) %>'></asp:Literal><Hishop:FormatedTimeLabel ID="FormatedTimeLabel2" Time='<%# Eval("LastDate") %>' runat="server" Visible='<%# Convert.ToString(Eval("LastDate")) != Convert.ToString(Eval("RemarkDate")) %>' /></td>
                                 </tr>
                                 <tr>
                                    <td colspan="4" width="680">
                                        <textarea rows="2" cols="20" id="txtRemarkPost" style="height:80px; width:680;" onkeyup="getRemark(this)"><%# Eval("Remark") %></textarea>
                                    </td>
                                 </tr>  
                                 <tr>
                                    <!-- 按钮 -->
                                    <td style="text-align:left;" colspan="4">
                                        <input type="button" onclick="$.myfunction.UpdateRemark(<%# Eval("RemarkId")%>);" id="btnRemarkUpdate" value="保存" class="SmallCommonTextButton" />
                                        <asp:LinkButton ID="btnRemarkCancel" runat="server"  CommandName="Cancel"  class="SmallCommonTextButton" Text="<%$ Resources:Resources, IDS_Button_Cancel %>"></asp:LinkButton>                                           
                                    </td>
                                 </tr> 
                            </EditItemTemplate>
                            <FooterTemplate>
                                </table>
                            </FooterTemplate>                                            
                       </UI:TemplatedList>
                    </div>
                     </Content>
                    </UI:CallBack>
               </asp:Panel>
            </Content>
        </UI:Dialog>
        
        
      <script type="text/javascript">
          function ResetPager(sender, eventArgs) {
              CBPager.callback();
          }

          $(document).ready(function() {
              jQuery.leavewordFunction = {
                  leavewordOpenWindow: function(orderId) {
                        if(canLeave!="True" && isadmin!="True")
                        {
                            alert("您当前没有权限进行订单留言！");
                            return;
                        }
                      if (!dlgLeaveWord.get_isShowing()) {
                          dlgLeaveWord.Show();
                          document.getElementById("ManageOrder_txtRemarkOrderId").value = orderId;
                          CBLeaveWord.callback("BindLeaveWord");
                      }
                  },
                  leavewordReply: function(orderId) 
                  {
                      if ($.trim($("#ManageOrder_txtLeaveWordAdd").val())!= "")
                      //if (document.getElementById("ManageOrder_txtLeaveWordAdd").innerHTML != "") 
                      {
                          CBLeaveWord.callback("ReplyLeaveWord");
                          //document.getElementById("ManageOrder_txtLeaveWordAdd").innerHTML = "";
                      }
                      else {
                          alert("留言回复不能为空");
                      }
                  }
              }
          });
     </script>  
<!-- 订单留言窗体内容 -->
       <UI:Dialog AnimationType="Live" ShowTransition="Fade" AnimationSlide="ExponentialDecelerate"  CloseTransition="Fade" AnimationDuration="600" Modal="true"  AllowDrag="true" Alignment="MiddleCentre" Title="订单留言"  ID="dlgLeaveWord" runat="server" Width="700px">
            <Content>
               <!-- 窗口标题 -->
               <div class="PageTitleArea" >
                    <div class="PageTitle">
                        <asp:Literal runat="server" Text="<%$ Resources:ManageOrder, IDS_PageTitle_LeaveWord %>"></asp:Literal>
                    </div>
                    <div style="width: 80%;">
                        <asp:Literal runat="server" Text="<%$ Resources:ManageOrder, IDS_PageDesc_LeaveWord %>"></asp:Literal>
                    </div>
                </div>                
                        <asp:TextBox ID="txtLeaveWordAdd" Width="99%" Height="40px" TextMode="MultiLine"  runat="server" ></asp:TextBox>
                        <p style="padding:5px;clear:both;"><input type="button" value="留言/回复" id="btnLeaveWordAdd" onclick="$.leavewordFunction.leavewordReply()" class="inp_L1" />
                        <span style="color:Red;">*</span> <span style="font-size:12px;"><asp:Literal runat="server" Text="<%$ Resources:ManageOrder, IDS_Field_LeaveWordMsg1 %>"></asp:Literal></span>
                        </p>
               <UI:CallBack id="CBLeaveWord" ClientSideOnCallbackComplete="ResetPager" CacheContent="false" runat="server" PostState="true" Debug="false">
                     <Content>
                        <div >                                                            
                            <UI:TemplatedList ID="dlstLeaveWord" runat="server" Width="100%" DataKeyField="LeaveId" RunningMode="Callback">   
                                <ItemTemplate>
                                <table class="GridViewStyle" cellspacing="0" border="0" style=" width:100%; border-style:solid; border-width:thin;">
                                     <tr >
                                        <td>
                                            [<asp:Literal Id="litlUserRank" runat="server" Text='<%# Eval("UserId") %>'></asp:Literal>]                                                                                   
                                            <asp:Literal runat="server" Text='<%# Eval("UserName") %>'></asp:Literal> 
                                            <Hishop:FormatedTimeLabel Time='<%# Eval("PublishDate") %>' runat="server" /> <asp:Literal runat="server" Text="<%$ Resources:ManageOrder, IDS_Field_LeaveWordMsg2 %>"></asp:Literal>：
                                        </td>
                                     </tr>
                                     <tr>
                                        <td>
                                            <div style="padding:5px;width:670px;white-space:normal;overflow:hidden;"><asp:Literal runat="server" Text='<%# Eval("PublishContent") %>'></asp:Literal></div>
                                        </td>
                                     </tr>   
                                </table>
                                </ItemTemplate>                                            
                            </UI:TemplatedList>                                
                        </div>
                    </Content>
                 </UI:CallBack>
                 <!--分页开始-->
                 <UI:CallBack id="CBPager" CacheContent="false" PostState="true" Debug="false" runat="server">
                    <Content>
                        <div class="grdGroupTabhead">
                            <UI:Pager runat="server" ListToPaging="dlstLeaveWord" ListToCallBackID="CBLeaveWord" RunningMode="Callback" ID="leaveWordPager" />
                        </div>
                    </Content>
                 </UI:CallBack>
                  <!--分页结束-->
              </Content>
           </UI:Dialog>
           
<script type="text/javascript">
    $(document).ready(function() {
        $(".mdiv ul li").each(function() {

            if (this.innerHTML == "") 
                this.style.display = 'none';            
        });
    });
</script>


<script type="text/javascript">
    var urlLocationStr = document.location.href;
              
     var ActivityStatusKey=/OrderStatus=/;
     var OrderPaymentStatusKey=/OrderPaymentStatus=/;
     var OrderShippingStatusKey=/OrderShippingStatus=/;
     var OrderRefundStatusKey=/OrderRefundStatus=/;
     var IsAllSelectKey=/IsAllSelect=/;

     ActivityStatusKey.exec(urlLocationStr); var activityStatusString = RegExp.rightContext; 
     OrderPaymentStatusKey.exec(urlLocationStr); var orderPaymentStatusString = RegExp.rightContext; 
     OrderShippingStatusKey.exec(urlLocationStr); var orderShippingStatusString = RegExp.rightContext; 
     OrderRefundStatusKey.exec(urlLocationStr); var orderRefundStatusString = RegExp.rightContext;    
     IsAllSelectKey.exec(urlLocationStr); var isAllSelectString = RegExp.rightContext
     
     activityStatusSelect=activityStatusString.substr(0,activityStatusString.indexOf("&"));
     orderPaymentStatusSelect=orderPaymentStatusString.substr(0,orderPaymentStatusString.indexOf("&"));
     orderShippingStatusSelect=orderShippingStatusString.substr(0,orderShippingStatusString.indexOf("&"));
     orderRefundStatusSelect=orderRefundStatusString.substr(0,orderRefundStatusString.indexOf("&"));
     
     isAllSelect = isAllSelectString.substr(0,isAllSelectString.indexOf("&"));     
     if (isAllSelect=="")
     {
        isAllSelect = isAllSelectString;
     }

     if (isAllSelect.toUpperCase()== "TRUE" || isAllSelect=="")
     {
        document.getElementById("anchors_0").className = "tabs-selected";
     }
     else if (orderPaymentStatusSelect != "" && orderPaymentStatusSelect == 0 && orderShippingStatusSelect == 0) {
         document.getElementById("anchors_1").className = "tabs-selected";
     }
     else if (orderPaymentStatusSelect == 1 && orderShippingStatusSelect == 0) {
         document.getElementById("anchors_2").className = "tabs-selected";
     }
     else if (orderShippingStatusSelect == 2) {
         document.getElementById("anchors_3").className = "tabs-selected";
     }
     else if (orderShippingStatusSelect == 1) {
         document.getElementById("anchors_4").className = "tabs-selected";
     }
     else if (activityStatusSelect == 7) {
         document.getElementById("anchors_5").className = "tabs-selected";
     }
     else if (orderRefundStatusSelect == 1) {
         document.getElementById("anchors_6").className = "tabs-selected";
     }
     else if (orderRefundStatusSelect == 2) {
         document.getElementById("anchors_7").className = "tabs-selected";
     }


</script>
                </SkinTemplate>
            </Hishop:ManageOrder>
        </div>
        <br />
        <div class="botCopyInfo">
            <hr style="width:500px;" />
            <Hishop:SiteCopyright ID="SiteCopyright1" runat="server" />
        </div>
        <br />
        <Hishop:ValidatorContainer runat="server" ID="ValidatorContainer" />
    </form>
</body>
</html>