<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="addInfoSearch.aspx.cs" Inherits="Web.User.addInfoSearch" %>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>addInfoSearch</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file = "../Css/userCssEdit.htm" -->

    <script language="javascript" type="text/javascript" src="../Editor/My97DatePicker/WdatePicker.js"></script>
<%--    <script type="text/javascript">
    //关闭弹出层 刷新列表
    function divClose(bigclassid,menuid){
        parent.$.fancybox.close();
        parent.location="manageInfoSearch1.aspx?type="+bigclassid+"&menuId="+menuid;
    }
    </script>--%>
</head>
<body>
    <form id="addNews" method="post" runat="server">
    <div class="edit-func-box func-box">
        <div class="hd">编辑</div>
        <div class="bd mb80">
            <table class="edit-table" id="Table1">
                <tr>
                    <th style="width:20%;">
                        标题：
                    </th>
                    <td colspan="3">
                        <asp:TextBox ID="intactTitle" runat="server" notNull="true" msgName="文章标题" class="input-txt3 input-txt" MaxLength="250"></asp:TextBox>&nbsp;&nbsp;
                        <asp:CheckBox ID="isTop" runat="server" Text="固顶" CssClass="form-checkbox"></asp:CheckBox>&nbsp;&nbsp;
                    </td>
                </tr>
                <tr>
                    <th>
                        链接标题：
                    </th>
                    <td colspan="3">
                        <asp:TextBox ID="txtZDYUrl" runat="server" class="input-txt3 input-txt" MaxLength="200">http://</asp:TextBox>&nbsp;&nbsp;
                        <asp:CheckBox ID="useListTitle" runat="server" Text="使用链接标题" ></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        发表时间：
                    </th>
                    <td colspan="3">
                        <asp:TextBox ID="releasetime" runat="server" MaxLength="19" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" CssClass="input-txt input-txt3"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        初始点击率：
                    </th>
                    <td>
                        <asp:TextBox ID="defaultClick" runat="server" notNull="true" dataType="integer" maxValue="99999999" minValue="0" msgName="初始点击率" class="input-txt w50"></asp:TextBox>
                    </td>
                    <th>
                        文章模板：
                    </th>
                    <td>
                        <asp:DropDownList ID="itemType" runat="server" DataTextField="name" DataValueField="pkId" class="input-txt w180"></asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <th>
                        所属专题：
                    </th>
                    <td>
                        <asp:DropDownList ID="ddlspecial" runat="server" DataTextField="name" DataValueField="pkId" class="input-txt w180"></asp:DropDownList>
                    </td>
                    <th>
                        部门：
                    </th>
                    <td>
                        <asp:DropDownList ID="department" runat="server" DataTextField="name" DataValueField="pkId" class="input-txt w180"></asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <th>
                        浏览权限：
                    </th>
                    <td>
                        <asp:DropDownList ID="gate" runat="server" class="input-txt w180">
                                    <asp:ListItem Value="0">无限制</asp:ListItem>
                                    <asp:ListItem Value="1">仅内网可见</asp:ListItem>
                                    <asp:ListItem Value="2">仅登录可见</asp:ListItem>
                                    <asp:ListItem Value="3">内网或登录可见</asp:ListItem>
                                </asp:DropDownList>
                    </td>
                    <th>
                        显示等级：
                    </th>
                    <td>
                        <asp:DropDownList ID="grade" runat="server" DataTextField="name" DataValueField="pkId" class="input-txt w180"></asp:DropDownList>
                    </td>
                </tr>
            </table>
        </div>
        <div class="ft ft02">
            <div class="action-field txt-c">
                <asp:Button ID="ok" class="btn" runat="server" Text="添 加" OnClientClick="return checkAll();" OnClick="ok_Click"></asp:Button>&nbsp;
                <asp:Button ID="cancel" runat="server" class="btn" Text="取 消" CausesValidation="False" OnClick="cancel_Click"></asp:Button>&nbsp;
            </div>
            <!--/action-field-->
        </div>
    </div>

    <script type="text/javascript">

     //在保存之前,验证输入是否正确；将有效日期值转换成相应的有效天数
     function checkAll()
     {
        //验证
        if (checkAllValidate()){
            return esave();
        }else{
            return false ;
        }
    }    
    
    //添加保存
    function esave(){

        //判断是否使用了链接标题
        if(document.getElementById("useListTitle").checked == true){
            var uzdyurl=document.getElementById("txtZDYUrl");
            if (uzdyurl.value=="" ||uzdyurl.value==null){
                alert("使用链接标题时，自定义网址不能为空！");
                return false ;
            }
        }
        return true ;
    }
   
    </script>
    </form>
</body>
</html>