<%@ Page Title="信息模板编辑" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Admin_Shop_KS_ShopMessage" Codebehind="KS.CouponMsgTp.aspx.cs" %>
<%@ Import Namespace="Kesion.BLL" %>
<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.APPCode" %>
<%@ Import Namespace="Kesion.Cache" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">
      <script>
          function CheckForm() {
              if (jQuery("#<%=this.TxtMessageType.ClientID%>").val() == '') {
                  
                  KesionJS.Alert('请输入模板名称!', 'jQuery("#<%=this.TxtMessageType.ClientID%>").focus();');
                    return false;
              }
              if (jQuery("#<%=this.TxtTitle.ClientID%>").val() == '') {

                  KesionJS.Alert('请输入消息提示标题!', 'jQuery("#<%=this.TxtTitle.ClientID%>").focus();');
                  return false;
              }
        
            }
        </script>
    <asp:Panel ID="MessageList" runat="server" Width="100%">  
      <div class="content-area mt20">
      	 
         <div class="tabs_header">
            <asp:LinkButton ID="addMessage" runat="server" OnClick="addMessage_Click" CssClass="fr button button_on ml15">添加消息模板</asp:LinkButton>
           	<asp:LinkButton ID="editMessage" runat="server" OnClick="editMessage_Click" CssClass="fr button">编辑消息模板</asp:LinkButton>
            <ul class="tabs"> 
                <li <%=KSCMS.S("MsgWarnType")==""?" class='active'":string.Empty %>><a href="KS.CouponMsgTp.Aspx"><span>红包发送提醒模板</span></a></li>
                <li <%=KSCMS.S("MsgWarnType")=="2"?" class='active'":string.Empty %>><a href="KS.CouponMsgTp.Aspx?MsgWarnType=2"><span>到期提醒模板</span></a></li>
               	<li <%=KSCMS.S("MsgWarnType")=="3"?" class='active'":string.Empty %>><a href="KS.CouponMsgTp.Aspx?MsgWarnType=3"><span>活动提醒模板</span></a></li>
            </ul>
         </div>
      <div>
       <KS:KSGV ID="list" cssclass="CTable" runat="server" AutoGenerateColumns="False" Width="99%" EmptyDataText="没有添加任何信息模板!" GridLines="None" OnRowDataBound="list_RowDataBound" OnRowCommand="list_RowCommand" OnRowCreated="list_RowCreated" AllowPaging="True" >
          <Columns>
              <asp:TemplateField HeaderText="选择">
                <itemstyle horizontalalign="Center" width="30px" />
                <itemtemplate>
                    <input type="checkbox"  name="ids" id="ids" value='<%#Eval("MessageID") %>' />
                </itemtemplate>
              </asp:TemplateField>

               <asp:TemplateField HeaderText="默认">
              <itemstyle width="30px" horizontalalign="Center"/>
              <itemtemplate>
                    <a href="?action=defaultnum&Messageid=<%#Eval("Messageid")%>" <%#Convert.ToString(Eval("defaultnum"))=="0"?"class='no' title='停用'":"class='ok' title='正常'"%>></a>
              </itemtemplate>
            </asp:TemplateField>

             <asp:TemplateField HeaderText="模板名称">
                 <itemstyle horizontalalign="Left"/>
             <itemtemplate>
             <%# Eval("MessageTypeName") %> 
             </itemtemplate>
             </asp:TemplateField> 
            
             
             <asp:TemplateField HeaderText="添加时间">
             <itemstyle horizontalalign="Center"  />
             <itemtemplate>
             <span class="tips">
             <%#Convert.ToString(Eval("AddDate"))%>
             </span>
             </itemtemplate>
             </asp:TemplateField>
             <asp:TemplateField HeaderText="编辑">
              <itemstyle width="30px" horizontalalign="Center"/>
              <itemtemplate>
             <asp:LinkButton ID="LinkButton1" ToolTip="编辑" CssClass="edit" runat="server" commandargument=<%#Eval("MessageID") %> commandname="modify"></asp:LinkButton>
              </itemtemplate>
            </asp:TemplateField>
             <asp:TemplateField HeaderText="删除">
              <itemstyle width="30px" horizontalalign="Center"/>
              <itemtemplate>
             <asp:LinkButton runat="server" id="delete" ToolTip="删除" CssClass="delete" commandargument=<%#Eval("MessageID") %> commandname="del"></asp:LinkButton>
              </itemtemplate>
            </asp:TemplateField>

            
          </Columns>
            <HeaderStyle CssClass="CTitle" />
            <EmptyDataRowStyle CssClass="emptycss" />
      </KS:KSGV>
      <asp:Panel ID="Panel2" runat="server" Height="30px" Width="741px">
            <div class="listedit">
                <input type="checkbox" name="chkall" id="chkall" onclick="CheckAll(this.form);"/><label for="chkall">全部选中</label>
                <input type="button" value="删除选中的模板消息" class="button" onclick="if (GetIDS('del')) { this.form.action = '?action=del'; this.form.submit() }" id="Button1" />
                <asp:LinkButton ID="delMessageBtn" runat="server" OnClick="delMessage_Click" CssClass="button">删除消息模板</asp:LinkButton>
            </div>
    
    </asp:Panel>  
    
   <KS:Page ID="Page1" runat="server" />
        
      </asp:Panel>
  </div>    
  <asp:Panel ID="Panel1" runat="server" Width="100%" Visible="false">
        <!--<KS:TopNav ID="TopNav1" runat="server" />-->
  <div class="content-area mt20">      
        <div class="myTitle">添加预约码项目</div>
        <table width="99%" align="center" border="0" cellpadding="0" cellspacing="0" class="CTable no-borderTable"> 
          <tr>
            <td class="lefttd" height="30" align="right" style="width: 198px"><strong>模板名称：</strong></td>
            <td class="righttd">
                <asp:TextBox ID="TxtMessageType" CssClass="textbox" runat="server"></asp:TextBox>
                <span class="tips">名称格式：春节版|春季版|秋季版等 </span>
           </td>
          </tr>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 198px"><strong>设置默认：</strong></td>
                <td class="righttd">
                    <asp:RadioButtonList ID="RbMessageType" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal">
                        <asp:ListItem Value="1">是</asp:ListItem>
                        <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 198px"><strong>短息提醒类型：</strong></td>
                <td class="righttd"> 
                      <script>
                          function ChangeText() {
                              if (jQuery("#<%=this.ddlMsgWarnType.ClientID%>").val() == "3") {
                                $("#action").show();

                                $("#CouponNum").hide();
                            }

                            else {
                                $("#action").hide();

                                $("#CouponNum").show();
                            }
                        }

                        $(document).ready(function () {
                            $("#action").hide();

                            $("#CouponNum").show();
                        });

                    </script>
                    <asp:DropDownList ID="ddlMsgWarnType" runat="server" onchange="ChangeText()">
                        <asp:ListItem Value="1">红包短信提醒</asp:ListItem>
                        <asp:ListItem Value="2">到期短息提醒</asp:ListItem>
                        <asp:ListItem Value="3">活动短息提醒</asp:ListItem>
                    </asp:DropDownList>
                    <br />
                </td>
            </tr>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 198px"><strong>消息标题模板：</strong>
                </td>
                <td class="righttd">
                    <asp:TextBox ID="TxtTitle" runat="server" style="width:420px;" CssClass="textbox"></asp:TextBox>
                    <span class="tips">如：恭喜您在科汛网站获得5元购物红包。</span>
                </td>
            </tr>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 198px"><strong>邮件内容模板：</strong>
                    <div class="tips" >
                               <br />
                           </div>
                </td>
                <td class="righttd">
                    <asp:TextBox ID="TxtMailContent1" runat="server" style="width:90%;height:200px;" TextMode="MultiLine"></asp:TextBox>
                     <% Kesion.APPCode.EditorAPI.EchoEditor("editor", this.TxtMailContent1.ClientID, "Basic");%>
                </td>
            </tr>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 198px"><strong>站内消费内容模板：</strong>
                    <div class="tips">
                        <br /> 
                    </div>
                </td>
                <td class="righttd">
                    <asp:TextBox ID="TxtSendContent2" runat="server" style="width:90%;height:200px;" TextMode="MultiLine"></asp:TextBox>
                    <% Kesion.APPCode.EditorAPI.EchoEditor("editor", this.TxtSendContent2.ClientID, "Basic");%></td>
            </tr>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 198px"><strong>手机短信内容：</strong>
                    <div class="tips" >
                               <br />
                               <br />
                           </div>
                </td>
                <td class="righttd">
                    <asp:TextBox ID="TxtMobileContent3" runat="server" Height="169px" TextMode="MultiLine" Width="80%"></asp:TextBox>
                     <br /><span class="tips">Tips：请控制字数，建议控制在66个字内。</span>
                </td>
            </tr>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 198px"><strong>添加时间：</strong></td>
                <td class="righttd">
                    <asp:TextBox ID="TxtAddDate" CssClass="Wdate textbox" runat="server" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});"></asp:TextBox>
                    <span class="tips">日期格式：年-月-日 时:分:秒 </span>
                </td>
            </tr>
             <tr>
                <td align="right" class="lefttd" height="30" style="width: 198px"><strong>标签：</strong></td>
                <td class="righttd"> <div class="tips" >
                             
                              <div id="action"> 
                                 {$GetSiteName}：网站名称<br />
                               {$UserName}：用户名<br />
                                  {$Title}：商品名称<br />
                               {$Price}：价格<br /></div>                              
                           </div>
                    <div id="CouponNum" class="tips">  {$GetSiteName}：网站名称<br />
                                       {$UserName}：用户名<br />
                                      {$BeginDate}：使用时间<br />
                                     {$EndDate}：过期时间<br />
                                     {$FaceValue}：面值<br />
                                     {$CouponNum}：优惠券号/红包号<br />
                           </div><br />
                   </td>
            </tr>
          <tr>
           <td class="lefttd" colspan="2" style="text-align:center">
           <KS:Foot ID="Foot1" runat="server" OnSubmit="Foot1_Submit" />
           </td>
          </tr>
         </table>
    </asp:Panel>
 </div>   
</asp:Content>

