<%@ Page  Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.Weixin.WebSite.weixin_Template3"  Title="模板管理" Codebehind="KS.TemplateIndex.aspx.cs" %>

<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.Publics" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">
<div class="content01">
<div id="manage_top" class="menu_top_fixed">
   <ul>
   <li id="p8"><asp:LinkButton ID="LinkButton1" runat="server" OnClick="addclassbutton_Click"><b></b>新建模板</asp:LinkButton></li>
   </ul>

  
  <span style="float:right;">
   <asp:DropDownList ID="DrpClassID1"  Width="180px" runat="server" 
         OnSelectedIndexChanged="DrpClassID1_SelectedIndexChanged"  AutoPostBack="true">
       <asp:ListItem Value="0">--按模板类型查看--</asp:ListItem>
 </asp:DropDownList>
  </span>
</div>

<div class="menu_top_fixed_height"></div>  

<asp:Panel ID="mainlist" runat="server" Width="100%">

 <style>
  .Exlbos{padding-left:20px;padding-top:20px;} 
  .template li{ list-style:none; float: left; margin-bottom:30px;width:33%; height:250px; margin-bottom:20px} 
  .template li .button{ text-decoration:none; line-height:25px; margin-bottom:5px;}
 </style>
 <script type="text/javascript">
     function setRadio(nowRadio) {
         var myForm, objRadio;
         myForm = document.forms[0];
         for (var i = 0; i < myForm.length; i++) {
             if (myForm.elements[i].type == "radio") {
                 objRadio = myForm.elements[i];
                 if (objRadio != nowRadio && objRadio.name.indexOf("list") > -1 && objRadio.name.indexOf("RdbIsDefault") > -1) {
                     if (objRadio.checked) {
                         objRadio.checked = false;
                     }
                 }
             }
         }
     }
 </script>
 <div class="Exlbos">
         <asp:Repeater ID="list" runat="server"   OnItemCommand="list_ItemCommand" >
          <HeaderTemplate>
         <div class="template">
           <ul>
          </HeaderTemplate>
          <ItemTemplate>
         <li>
           <table>
            <tr >
             <td>
              <img src="<%# Eval("TemplatePic") %>"  width="130px;" height="200px;"/>
             </td>
             <td>
            默认情况：<%# Utils.StrToInt(Eval("IsDefault").ToString()) == 0 ? "是" : "否"%><br />模板名称：<%# Eval("TemplateName")%><br />模板文件夹： <%# Eval("TemplateFolder") %><br />
            模板类型： <%# Eval("ClassName")%><br />
            作者：<%# Eval("TemplateAuthor") %><br />版本： <%# Eval("CopyRight") %><br />
             <asp:Button ID="LinkButton1" ToolTip="编辑"  runat="server" commandargument=<%#Eval("ID") %> commandname="modify" CssClass="button" Text="编辑" />
           
            <asp:Button  ToolTip="删除" runat="server" id="delete" commandargument=<%#Eval("ID") %> commandname="del"  CssClass="button"  Text="删除" />
             <br />
           <asp:Button ID="LinkButton2"   runat="server" commandargument=<%#Eval("ID") %> commandname="btn" CssClass="button"  Text="替换为本模板"/>
             </td>             
            </tr>
            </table>
     </li>
   </ItemTemplate>
         <FooterTemplate>
           </ul>
         </div>
          </FooterTemplate>
         </asp:Repeater>
          <KS:Page ID="Page1" runat="server" />
       </div>
  
</asp:Panel>
<asp:Panel ID="AddPanel" runat="server" Width="98%"><br />
  <table style="margin:6px" width="100%" align="center" cellpadding="1" cellspacing="1" class="CTable" border="0">
    <tr>
      <td class="lefttd" style="height: 30px; text-align: right">
        <strong>模板名称：</strong>
      </td>
      <td runat="server" class="righttd" style="height: 30px; text-align: left">
        <asp:TextBox  ID="TxtTemplateName" runat="server"   Height="25px" CssClass="textbox"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtTemplateName"
         Display="Dynamic" ErrorMessage="模板名称必须输入"></asp:RequiredFieldValidator>
       </td>
    </tr>
    <tr>
     <td class="lefttd" style="text-align: right; height: 30px;">
         <strong>模板文件夹：</strong>
     </td>
     <td class="righttd" style="text-align: left; height: 30px;">
       <asp:TextBox ID="TxtTemplateFolder" runat="server"   Height="25px" CssClass="textbox"></asp:TextBox>
       <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="TxtTemplateFolder"
          Display="Dynamic" ErrorMessage="模板文件夹必须输入"></asp:RequiredFieldValidator>
      </td>
    </tr>
    <tr>
      <td class="lefttd" style="height: 30px; text-align: right">
         <strong>模板类型：</strong>
       </td>
       <td class="righttd" style="height: 30px; text-align: left">
           <asp:DropDownList ID="DrTempalteType" runat="server">
             <asp:ListItem Value="0" >--选择隶属模板类型--</asp:ListItem>
           </asp:DropDownList>
           <a href="javascript:void(0)" onclick="top.openWin('模板类型管理','Weixin/KS.TemplateClass.aspx',true,800,400)" title="模板类型管理">模板类型管理</a>
        </td>
      </tr>
      <tr>
         <td class="lefttd" style="height: 30px; text-align: right">
            <strong>模板作者：</strong>
         </td>
         <td class="righttd" style="text-align: left; height: 30px;">
           <asp:TextBox ID="TxtTemplateAuthor" runat="server"    Height="25px" CssClass="textbox"></asp:TextBox>
         </td>
      </tr>
      <tr>
         <td class="lefttd" style="height: 30px; text-align: right">
           <strong>模板图片：</strong>
          </td>
          <td class="righttd" style="height: 30px; text-align: left">
             <asp:TextBox CssClass="righttd" ID="TxtTempaltePic" runat="server" Width="245px"  Height="25px" ></asp:TextBox>
             <input type="button" class="button" onclick="SelectFiles('<%=this.TxtTempaltePic.ClientID %>    ',0);" value="选择图片...">
          </td>
      </tr>
      <tr>
        <td class="lefttd" style="height: 30px; text-align: right">
            <strong>是否为默认：</strong>
        </td>
        <td id="Td1" runat="server" class="righttd" style="height: 30px; text-align:left;">
          <asp:RadioButtonList ID="IsDefault" runat="server" RepeatDirection="Horizontal">
            <asp:ListItem Value="0" Selected="True">是</asp:ListItem>
            <asp:ListItem Value="1">否</asp:ListItem>
           </asp:RadioButtonList>
         </td>
        </tr>
        <tr>
          <td class="lefttd" style="height: 30px; text-align: right">
            <strong>模板版本信息：</strong>
          </td>
          <td id="Td3" runat="server" class="righttd" style="height: 30px; text-align: left">
            <asp:TextBox ID="TxtCopyRight" runat="server" Rows="8" TextMode="MultiLine" Width="350"  Height="100" CssClass="textbox textarea"></asp:TextBox>
            <a class="textarea_min" href="javascript:zoomtextarea(-5,'<%=this.TxtCopyRight.ClientID %>');"></a>
           <a class="textarea_max" href="javascript:zoomtextarea(5,'<%=this.TxtCopyRight.ClientID %>');">
          </td>
       </tr>
    </table><br />
 <div style="text-align:center">
  <asp:Button ID="btn" runat="server"  Text="添加" OnClick="btn_Click"  class="button_on"  />
  <input type="button" class="button_on" onclick="window.history.go(-1);" value=" 返 回 "/> 
 </div>
</asp:Panel>
</div>

</asp:Content>
