<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true"
    CodeBehind="SmsMessageToConsignee.aspx.cs" Inherits="PowerEasy.Module.General.WebSite.Admin.SMS.SmsMessageToConsignee"
    Title="发送给订单中的收货人" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CphNavigation" runat="server">
    <pe:ExtendedSiteMapPath ID="SmpNavigator" SiteMapProvider="AdminMapProvider" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CphContent" runat="server">
    <asp:Panel ID="Panel2" runat="server">
        <table width="100%" border="0" cellpadding="2" cellspacing="1" class="border">
            <tr align="center">
                <td colspan="2" class="spacingtitle">
                    预览短信
                </td>
            </tr>
            <tr class="tdbg" valign="top">
                <td>
                    下面是根据您指定的条件查找到的接收人：<br />
                    <asp:TextBox ID="TxtSendNum" TextMode="multiline" runat="server" Width="260px" Height="301px"></asp:TextBox>
                </td>
                <td>
                    <b>短信内容：</b><br />
                    <asp:TextBox ID="TxtContent" TextMode="multiline" ReadOnly="true" Width="360px" runat="server"
                        Height="150px"></asp:TextBox>
                    <br />
                    <b>短信统计：</b><br />
                    需要向
                    <asp:Label ID="LabRecieverCount" runat="server"></asp:Label>
                    个号码发送
                    <asp:Label ID="LabMessageCount" runat="server"></asp:Label>
                    条短信<br />
                    <br />
                    <b>说明：</b><br />
                    因为每条短信不能超过70个字，所以短信数可能会大于号码数。<br />
                    因为短信内容中的变量替换等原因，可能会导致实际发送的短<br />
                    信数会超过这里计算的短信数，最终结果以动易短信通平台上<br />
                    的实际发送数目为准。
                </td>
            </tr>
            <tr class="tdbgbottom">
                <td colspan="2">
                    <asp:Button ID="BtnSubmitServer" runat="server" Text="提交给短信服务器" OnClick="BtnSubmitServer_Click" />
                    <asp:HiddenField ID="SendTiming" runat="server" />
                    <asp:HiddenField ID="SendTime" runat="server" />
                    <asp:HiddenField ID="MD5String" runat="server" />
                    <asp:HiddenField ID="Reserve" runat="server" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="Panel1" runat="server">
        <table width="100%" border="0" cellpadding="2" cellspacing="1" class="border">
            <tr align="center">
                <td colspan="2" class="spacingtitle">
                    发送给订单中的收货人
                </td>
            </tr>
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>接收人：</strong>
                </td>
                <td>
                    <table>
                        <tr>
                            <td>
                                <asp:RadioButton ID="RadIncept1" runat="server" GroupName="InceptGroup" Checked="true" />所有订单中的收货人
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top">
                                <asp:RadioButton ID="RadIncept2" runat="server" GroupName="InceptGroup" />查询订单
                            </td>
                            <td>
                                <div id="order" runat="server" style="display: none">
                                    <table width="100%" border="0" cellpadding="2" cellspacing="1" class="border">
                                        <tr align="center">
                                            <td colspan="2" class="spacingtitle">
                                                订单查询条件
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                ID范围：
                                            </td>
                                            <td>
                                                起始ID<asp:TextBox ID="TxtBeginId" runat="server" Width="78px"></asp:TextBox>&nbsp;终止ID<asp:TextBox
                                                    ID="TxtEndId" runat="server" Width="78px"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                日期范围：
                                            </td>
                                            <td>
                                                起始日期
                                                <asp:TextBox ID="TxtBeginDate" runat="server" MaxLength="10" Width="78px"></asp:TextBox>&nbsp;结束日期
                                                <asp:TextBox ID="TxtEndDate" runat="server" MaxLength="10" Width="78px"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                金额范围：
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtMinMoney" runat="server" Width="78px"></asp:TextBox>&nbsp;至&nbsp;<asp:TextBox
                                                    ID="TxtMaxMoney" runat="server" Width="78px"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                订单状态：
                                            </td>
                                            <td>
                                                <asp:RadioButtonList ID="RadlOrderStatus" RepeatDirection="Horizontal" runat="server">
                                                    <asp:ListItem Value="0" Text="等待确认&nbsp;&nbsp;" />
                                                    <asp:ListItem Value="1" Text="已经确认&nbsp;&nbsp;" />
                                                    <asp:ListItem Value="2" Text="已经结清&nbsp;&nbsp;" />
                                                    <asp:ListItem Value="3" Text="已经作废&nbsp;&nbsp;" />
                                                    <asp:ListItem Value="4" Text="暂停处理&nbsp;&nbsp;" />
                                                    <asp:ListItem Value="-1" Text="所有状态" Selected="True" />
                                                </asp:RadioButtonList>
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                付款状态：
                                            </td>
                                            <td>
                                                <asp:RadioButtonList ID="RadlPayStatus" RepeatDirection="Horizontal" runat="server">
                                                    <asp:ListItem Value="0" Text="等待付款&nbsp;&nbsp;" />
                                                    <asp:ListItem Value="1" Text="已付定金&nbsp;&nbsp;" />
                                                    <asp:ListItem Value="2" Text="已经付清&nbsp;&nbsp;" />
                                                    <asp:ListItem Value="-1" Text="所有状态" Selected="True" />
                                                </asp:RadioButtonList>
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                物流状态：
                                            </td>
                                            <td>
                                                <asp:RadioButtonList ID="RadlDeliverStatus" RepeatDirection="Horizontal" runat="server">
                                                    <asp:ListItem Value="-1" Text="不需要发货"></asp:ListItem>
                                                    <asp:ListItem Value="0" Text="未开始流程" />
                                                    <asp:ListItem Value="1" Text="等待配送&nbsp;" />
                                                    <asp:ListItem Value="2" Text="配送中&nbsp;&nbsp;" />
                                                    <asp:ListItem Value="3" Text="部分发货&nbsp;"></asp:ListItem>
                                                    <asp:ListItem Value="4" Text="已发货&nbsp;&nbsp;" />
                                                    <asp:ListItem Value="5" Text="已签收&nbsp;&nbsp;" />
                                                    <asp:ListItem Value="-2" Text="所有状态&nbsp;" Selected="True" />
                                                </asp:RadioButtonList>
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                订单类型：
                                            </td>
                                            <td>
                                                <asp:RadioButtonList ID="RadlOrderType" runat="server" RepeatDirection="horizontal"
                                                    DataTextField="DataTextField" DataValueField="DataValueField">
                                                </asp:RadioButtonList>
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                订单编号：
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtOrderNum" runat="server"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                客户名称：
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtClientName" runat="server"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                用户名称：
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtUserName" runat="server"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                代理商：
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtAgentName" runat="server"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                收货人姓名：
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtContacterName" runat="server"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                联系地址：
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtAddress" runat="server"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                联系电话：
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtPhone" runat="server"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                手机号：
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtMobile" runat="server"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                备注留言：
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtRemark" runat="server"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr class="tdbg">
                                            <td style="width: 160px; text-align: right" class="tdbgleft">
                                                商品名称：
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtProductName" runat="server"></asp:TextBox>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:RadioButton ID="RadIncept3" runat="server" GroupName="InceptGroup" />指定订单ID
                            </td>
                            <td>
                                <asp:TextBox ID="TxtOrderId" runat="server"></asp:TextBox>多个订单ID间请用<span style="color: Blue">英文的逗号</span>分隔
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>短信内容：</strong>
                </td>
                <td>
                    可以在短信内容中使用几个变量：<br />
                    {$1}：手机号码或小灵通号码<br />
                    {$2}：收货人姓名<br />
                    {$3}：订单编号<br />
                    <asp:TextBox ID="TxtMessage" TextMode="MultiLine" Text="{$2}，您好！您的订单已经××。----动易软件（请勿回复此短信）"
                        runat="server" Height="87px" Width="337px"></asp:TextBox>
                    <pe:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="TxtMessage"
                        Display="dynamic" runat="server"></pe:RequiredFieldValidator><br />
                    每70个字计算为一条短信发送 已经填写的字数：&nbsp;<asp:TextBox ID="TxtMessageNumber" ReadOnly="true" runat="server"
                        Width="60px"></asp:TextBox>&nbsp;字
                </td>
            </tr>
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>发送时间：</strong>
                </td>
                <td>
                    <asp:RadioButton ID="RadSendType" GroupName="SendType" Checked="true" Text="立即发送"
                        runat="server" />
                    <asp:RadioButton ID="RadTimeSen" GroupName="SendType" Text="定时发送" runat="server" />
                    <pe:DatePicker ID="Dpk" DateFormat="yyyy-MM-dd HH:mm:ss" runat="server"></pe:DatePicker><span
                        style="color: Red">初始定时时间已加1天，如需定时在当天发送，请注意修改日期。</span>
                </td>
            </tr>
            <tr align="center" class="tdbg">
                <td colspan="2" style="height: 50px;">
                    <asp:Button ID="BtnSubmit" runat="server" Text="发送" OnClick="BtnSubmit_Click" />
                </td>
            </tr>
        </table>

        <script language="javascript" type="text/javascript">
            function checkLength() {
                document.getElementById("<%=TxtMessageNumber.ClientID %>").value = document.getElementById("<%=TxtMessage.ClientID %>").value.length;
            }
            function ShowOrder(value) {
                if (value) {
                    document.getElementById("<%=order.ClientID %>").style.display = "";
                } else {
                    document.getElementById("<%=order.ClientID %>").style.display = "none";
                }
            }
        </script>

    </asp:Panel>
</asp:Content>
