<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="Admin_Admin_AddLabel, mallz" title="标签选项" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<table class="adminheading">                       
   <tr>
      <th class="edit">标签管理</th> 
      <td align="right"><div style="width:50px"><a href="Admin_Lable.aspx">返回</a></div></td>
      <td class="rtdw"></td>
   </tr>                        
</table>

<table class="nick">
       <tr>
           <td class="tit" colspan="2">编辑标签</td>
       </tr>
       <tr>
           <td class="ltd">标签名称：</td>
           <td class="rtd"><asp:TextBox ID="LabelName"　 runat="server" Width="300px" />
           <asp:Label id="LabelNameErr" runat="server"></asp:Label>
               <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="LabelName" runat="server" ErrorMessage="<font color='red'>请输入标签名称！</font>"></asp:RequiredFieldValidator>
           </td>
       </tr>
        <tr>
           <td class="ltd">标签分类：</td>
           <td class="rtd">
                <asp:TextBox ID="LabelClass"　 runat="server" Width="200px" />
                <asp:DropDownList ID="LabelClassSelect" runat="server"  AppendDataBoundItems="true">
                   <asp:ListItem Text="全部分类" Value="全部分类" />
                </asp:DropDownList><asp:Label id="LabelClassErr" runat="server"></asp:Label>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="LabelClass" runat="server" ErrorMessage="<font color='red'>请输入标签分类，方便查找！</font>"></asp:RequiredFieldValidator>
            </td>
       </tr>
        <tr>
           <td class="ltd">数据源设置：</td>
           <td class="rtd">
                <asp:DropDownList ID="LabelDataSourceSet" runat="server">
                   <asp:ListItem Value="static" Text="无数据源" />
                   <asp:ListItem Value="sql_sysquery" Text="系统数据库" />
                   <asp:ListItem Value="sql_sysstorequery" Text="系统数据库存储过程" />
                   <asp:ListItem Value="sql_outquery" Text="外部MSSQL数据库" />
                   <asp:ListItem Value="mdb" Text="ACCESS数据库" />
                   <asp:ListItem Value="xml" Text="XML文件" />
                   <asp:ListItem Value="mysql" Text="MYSQL数据库" />
                </asp:DropDownList>
                <div id="LabelTemplateShow" style="display:none;">                    
                    <div id="div_datasourceshow">
                       数据源连接字符串：<asp:TextBox ID="LabelDataSourceConn" runat="server" Width="550px" />
                    </div>
                </div>
                
            </td>
       </tr>
        <tr>
           <td class="ltd">标签模板处理方式：</td>
           <td class="rtd"><asp:RadioButtonList ID="LabelTemplateType" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Text="HTML静态模板标签" Value="simple" />
                            <asp:ListItem Text="纯编程模板标签" Value="programe" />
                            <asp:ListItem Text="带数据源可编程模板标签" Value="data_programe" />
                            <asp:ListItem Text="XML数据" Value="xml" />
                            <asp:ListItem Text="单一数据" Value="text" />
                        </asp:RadioButtonList>
           </td>
       </tr>
       <tr>
           <td class="ltd">生成标签内容方式：</td>
           <td class="rtd"><asp:DropDownList ID="LabelOutPutType" runat="server">
                    <asp:ListItem Text="静态标签页" Value="static" />
                    <asp:ListItem Text="动态标签页" Value="activity" />  
               </asp:DropDownList>
           </td>
       </tr>
       <tr id="label_static">
           <td class="ltd">静态标签生成类型：</td>
           <td class="rtd">生成名称 ：<asp:TextBox ID="StaticLabelOutPutName" runat="server" />．<asp:DropDownList ID="StaticLabelOutPutType" runat="server">
                    <asp:ListItem Text="html" Value="html" Selected="True" />
                    <asp:ListItem Text="txt" Value="txt" />
                    <asp:ListItem Text="js" Value="js" /> 
               </asp:DropDownList>             
           </td>
       </tr>
        <tr id="label_activity">
            <td class="ltd">缓存时间（单位５秒）：</td>
            <td class="rtd"><asp:TextBox ID="LabelCacheTime" runat="server" Text="0" Width="200px" />
                       <select name="LabelCacheTimeSelect"  onchange="javascript:document.getElementById('ctl00_ContentPlaceHolder1_LabelCacheTime').value=this.value">
		                    <option selected="selected" value="">快速选择</option>
		                    <option value="0">不缓存</option>
		                    <option value="12">1分钟</option>
		                    <option value="720">1小时</option>
		                    <option value="17280">1天</option>		            
	                    </select></td>
       </tr>
       <tr>
            <td class="ltd">标签说明：</td>
            <td class="rtd"><asp:TextBox ID="LabelIntro" TextMode="MultiLine" runat="server" Rows="5" Width="400"/></td>
       </tr>
       <tr>
            <td class="btm" colspan="2">
       <asp:Button ID="NextStep" runat="server" Text="下一步" OnClick="NextSetp_Click" />&nbsp;
       <asp:Button ID="SaveButton" runat="server" Text="保　存" OnClick="SaveButton_Click"  Visible="false"/>
       <input id="BtnCancel" type="button"  value="取　消" onclick="window.location.href='Admin_Lable.aspx'" />&nbsp;&nbsp;&nbsp;&nbsp;
       <asp:DropDownList ID="GoToStep" Visible="false" runat="server"/> 
            </td>	
       </tr>
</table>

<script type="text/javascript">
function display_labelTemplate(objValue,ctlTextID)
{   
   var showObj=document.getElementById("LabelTemplateShow");
   if(objValue=="static")
   {
     showObj.style.display="none";
     document.getElementById("ctl00_ContentPlaceHolder1_LabelTemplateType_2").disabled = "true";
     document.getElementById("ctl00_ContentPlaceHolder1_LabelTemplateType_3").disabled = "true";
     document.getElementById("ctl00_ContentPlaceHolder1_LabelTemplateType_4").disabled = "true";
   }
   else
   {   
     document.getElementById("ctl00_ContentPlaceHolder1_LabelTemplateType_2").disabled = "";
     document.getElementById("ctl00_ContentPlaceHolder1_LabelTemplateType_3").disabled = "";
     document.getElementById("ctl00_ContentPlaceHolder1_LabelTemplateType_4").disabled = "";
   
       var datasourceshowObj=document.getElementById("div_datasourceshow");
       var datasourceText=document.getElementById(ctlTextID);
       showObj.style.display="block";
       switch(objValue)
       {
          case "sql_sysquery":
              datasourceshowObj.style.display="none";
              break;
          case "sql_outquery":
               datasourceshowObj.style.display="block";
               datasourceText.value="Data Source=数据库IP;Initial Catalog=数据库名;User ID=登录帐号;Password=登录密码;Persist Security Info=True";
               break;
          case "sql_sysstorequery":
               datasourceshowObj.style.display="block";
               datasourceText.value="存储过程名称";
               break;
          case "mdb":
               datasourceshowObj.style.display="block";
               datasourceText.value="temp/test.mdb";
               break;          
          case "xml":
               datasourceshowObj.style.display="block";
               datasourceText.value="temp/test.xml";
               break;            
          
       }
   }

}
function ShowLabelType(objValue)
{
   var _static=document.getElementById("label_static");
   var _activity=document.getElementById("label_activity");
   if(_static!=null && _activity!=null)
   { 
       _static.style.display=_activity.style.display="none";
       document.getElementById("label_"+objValue).style.display="";    
   }
   

}
</script>
<asp:Literal ID="show_label_type_js" runat="server" />
</asp:Content>

