<%
    //-----------------------------------------------------------
    // 文件名称: Article_Article_Operate.aspx
    // 页面名称: 文章添加/编辑
    //
    // 描    述:
    //
    // 创建标识: Add By 吴建春 2008-06-02
    // 修改标识: Add By 钟治宇 2008-11-12  文章添加不能调用文档文件 添加了几个控件
    //-----------------------------------------------------------
%>

<%@ page language="C#" autoeventwireup="true" inherits="V5Shop.Admin.Article_Article_Operate, V5Shop.Shop.Article" culture="auto" uiculture="auto" meta:resourcekey="PageResource1" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Assembly="V5Shop.Control" Namespace="V5Shop.Control" TagPrefix="cc1" %>
<%@ Register Src="control/PageBottom.ascx" TagName="PageBottom" TagPrefix="uc2" %>
<%@ Register Src="control/HiddenField.ascx" TagName="HiddenField" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
a {
  color:#000000;
  text-decoration:none;
}
   
#header {
  height:26px;
  background:url(images/bg_cate.gif) bottom repeat-x;
  margin-bottom:20px;
}
#header ul {
  margin:0;
  padding:0px;
  list-style:none;
}
#header li {
  float:left;
 background:#DCE1EF;
 border:solid 1px #8EA2C2;
 border-bottom:solid 0px #8EA2C2;
 margin-left:2px;
}
#header a {
  display:block;
 padding:5px 15px 4px;
}
#header .current {
 background:#FFFFFF;
 border:solid 1px #8EA2C2;
 border-bottom:solid 1px #ffffff;
 
}
#header .current a{
 padding-bottom:5px;
}
.content {
 
}
.content .contentHeader {
  background-color:#BCC7E0;
  border:solid 1px #4B66A5;
  font-weight:bold;
}

.content .contentMain {
 border-left:solid 1px #4B66A5;
 border-top:solid 0px #4B66A5;
 border-right:solid 1px #4B66A5;
 border-bottom:solid 1px #4B66A5;
}
</style>
    <link href="css/css.css" rel="stylesheet" type="text/css" />
    <link href="css/css_list.css" rel="stylesheet" type="text/css" />
    <link href="css/control.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/Common.js"></script>
    <script type="text/javascript" src="editor/fckeditor.js"></script>
    <script type="text/javascript">
    var number = 3;
    function change_option(index){
        for (var i = 1; i <= number; i++) {
          document.getElementById('current' + i).className = '';
          document.getElementById('content' + i).style.display = 'none';
        }
        document.getElementById('current' + index).className = 'current';
        document.getElementById('content' + index).style.display = 'block';
    }
     function addArticle(id)
    {
        var disp=document.getElementById(id);
        disp.visible=true;
    }
   
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div class="OperateTitle">
            <div>
                <asp:Label ID="lblAdd" runat="server" Text="【文章添加】" />
                <asp:Label ID="lblEdit" runat="server" Text="【文章编辑】" />
                <asp:HyperLink ID="lkReturn" runat="server" Text="返回列表" ForeColor="#696969" />
            </div>
        </div>
        <div style="text-align: center;">
            <div id="header">
                <ul>
                    <li id="current1" class="current"><a style="cursor: pointer;" onclick="change_option(1);">
                        <asp:Label runat="server" ID="tab01" Text="基本信息" /></a></li>
                    <li id="current2"><a style="cursor: pointer;" onclick="change_option(2);">
                        <asp:Label runat="server" ID="tab02" Text="相关商品" /></a></li>
                    <li id="current3"><a style="cursor: pointer;" onclick="change_option(3);">
                        <asp:Label runat="server" ID="tab03" Text="相关文章" /></a></li>
                </ul>
                <br style="clear: both;" />
            </div>
            <div>
                <div id="content1" runat="server">
                    <table id="OperateTable" style="width: 100%; border: 0px; text-align: center;" cellpadding="0" cellspacing="0" runat="server">
                        <tr class="F7tr">
                            <td style="width: 20%; height: 30pt; text-align: right">
                                <asp:Label ID="Label1" runat="server" Text="标题：" /></td>
                            <td style="width: 80%; text-align: left; color: red">
                                <asp:TextBox ID="txtTitle" runat="server" Width="300px" Height="17px" MaxLength="250" />
                                *
                                <asp:RequiredFieldValidator ID="rfvTitle" runat="server" ControlToValidate="txtTitle" Display="Dynamic" ErrorMessage="必须输入"></asp:RequiredFieldValidator></td>
                        </tr>
                        <tr class="FFtr">
                            <td style="width: 20%; height: 40px; text-align: right">
                                <cc1:HelpCtrl ID="HelpCtrl1" runat="server" FontColor="red" Header="所属类别" HideSelects="False" ImageURL="images/help.gif" Text="选择一个文章的分类。" />
                                <asp:Label ID="Label4" runat="server" Text="所属类别：" /></td>
                            <td style="width: 80%; text-align: left; color: red; height: 40px;">
                                <asp:DropDownList ID="ddlCategory" runat="server" Width="150px">
                                    <asp:ListItem Value="-1">请选择</asp:ListItem>
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlCategory" Display="Dynamic" ErrorMessage="必须输入"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr class="F7tr">
                            <td style="width: 20%; height: 30pt; text-align: right">
                                <asp:Label ID="Label5" runat="server" Text="作者/发布人：" /></td>
                            <td style="width: 80%; text-align: left; color: red">
                                <asp:TextBox ID="txtAuther" runat="server" Width="300px" MaxLength="250" /></td>
                        </tr>
                        <tr class="FFtr">
                            <td style="width: 20%; height: 30px; text-align: right;">
                                <cc1:HelpCtrl ID="HelpCtrl2" runat="server" FontColor="red" Header="来源" HideSelects="False" ImageURL="images/help.gif" Text="输入该文章的来源，比如：(原创，摘自网易)。" />
                                <asp:Label ID="Label6" runat="server" Text="来源：" /></td>
                            <td style="width: 80%; text-align: left; color: red">
                                <asp:TextBox ID="txtSource" runat="server" Width="300px" MaxLength="250" /></td>
                        </tr>
                        <tr class="F7tr">
                            <td style="width: 20%; height: 30px; text-align: right;">
                                <cc1:HelpCtrl ID="HelpCtrl3" runat="server" FontColor="red" Header="导航图片" HideSelects="true" ImageURL="images/help.gif" Text="显示在管理列表里的图片。" />
                                <asp:Label ID="Label7" runat="server" Text="导航图片：" /></td>
                            <td style="width: 80%; text-align: left; color: red">
                                <cc1:ImageBox ID="imgSrcList" runat="server" ShowSelect="true" Text="选择导航图片" BoxWidth="300px" />
                            </td>
                        </tr>
                        <tr class="FFtr">
                            <td style="width: 20%; text-align: right; height: 26px;">
                                <asp:Label ID="Label8" runat="server" Text="新闻关键字：" /></td>
                            <td style="width: 80%; text-align: left; color: red; height: 26px;">
                                <asp:TextBox ID="txtKeywords" runat="server" Height="60px" TextMode="MultiLine" Width="300px" />
                                <span style="color: Red;">*</span>
                                 <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtKeywords" Display="Dynamic" ErrorMessage="必须输入"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="revKeywords" runat="server" ControlToValidate="txtKeywords" ErrorMessage="长度必须在250以内" ValidationExpression="^[\s\S]{0,250}$" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr class="F7tr">
                            <td style="width: 20%; text-align: right; height: 30px;">
                                <asp:Label ID="Label9" runat="server" Text="新闻描述：" /></td>
                            <td style="width: 80%; text-align: left; color: red; height: 30px;">
                                <asp:TextBox ID="txtDescription" runat="server" Height="60px" TextMode="MultiLine" Width="300px" />
                                <span style="color: Red;">*</span>
                                 <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtDescription" Display="Dynamic" ErrorMessage="必须输入"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="revDescription" runat="server" ControlToValidate="txtDescription" ErrorMessage="长度必须在250以内" ValidationExpression="^[\s\S]{0,250}$" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr class="FFtr">
                            <td style="width: 20%; text-align: right;">
                                <cc1:HelpCtrl ID="HelpCtrl4" runat="server" FontColor="red" Header="文章导读" HideSelects="true" ImageURL="images/help.gif" Text="文章导读信息。" />
                                <asp:Label ID="Label10" runat="server" Text="文章导读：" /></td>
                            <td style="width: 80%; text-align: left; color: red">
                                <asp:TextBox ID="txtArticleReview" runat="server" Height="60px" TextMode="MultiLine" Width="300px" />
                                <span style="color: Red;">*</span>
                                  <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtArticleReview" Display="Dynamic" ErrorMessage="必须输入"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="revArticleReview" runat="server" ControlToValidate="txtArticleReview" ErrorMessage="长度必须在250以内" ValidationExpression="^[\s\S]{0,250}$" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr class="F7tr">
                            <td style="width: 20%; height: 30px; text-align: right;">
                                <asp:Label ID="Label11" runat="server" Text="文章内容：" /></td>
                            <td style="width: 80%; text-align: left; color: red">
                                <div>
                                    <button id="btnSelectPicture" runat="server" class="button" style="vertical-align: middle; width: 72px; text-align: center" 
                                        type="button">图片选择</button>
                                </div>
                                <cc1:FCKeditor ID="fckContent" runat="server" Width="600px" />
                            </td>
                        </tr>
                        <tr class="FFtr">
                            <td style="width: 20%; height: 230px; text-align: right;">
                                &nbsp;<asp:Label ID="Label22" runat="server" Text="附件(可多个)：" /></td>
                            <td style="width: 80%; text-align: left; color: red; height: 230px;">
                                <div id="content">
                                    <!-- 明细数据编辑栏 -->
                                    <div style="text-align: left;">
                                        <input id="CheckAllBox" onclick="CheckAllByGridView('gvsAttachment', 0, 'CheckAllBox')" type="checkbox" class="checkbox" />
                                        <asp:Label ID="Label16" runat="server" Text="全选" />
                                    </div>
                                    <div class="listborder" style="text-align: left">
                                        <cc1:V5ShopGridView ID="gvsAttachment" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CssClass="datalist" EmptyDataText="没有任何附件。" PageSize="5">
                                            <PagerSettings Mode="NumericFirstLast" />
                                            <Columns>
                                                <asp:TemplateField meta:resourcekey="DetilData">
                                                    <itemtemplate>
                                                      <%--  <input id="chkID" onmouseover="this.mouse='over'" class="checkbox" onmouseout="this.mouse='out'" type="checkbox" value='<%# Eval("ID") %>' runat="server" /> --%>
                                                    <input runat="server" value='<%# Eval("ID") %>' id="CheckBoxID" type="checkbox" class="checkbox"  onmouseover="this.mouse='over'" onmouseout="this.mouse='out'" />
                                   
                                                    
</itemtemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="ID" HeaderText="ID" />
                                                <asp:BoundField HeaderText="附件名" DataField="Name" />
                                                <asp:BoundField HeaderText="附件编号" DataField="Src" />
                                            </Columns>
                                            <HeaderStyle CssClass="category" />
                                        </cc1:V5ShopGridView>
                                        &nbsp;&nbsp;
                                       <%-- 2008-11-12--%>
                                        <asp:LinkButton ID="btnAddMorePic" runat="server" ForeColor="#4B6888" CausesValidation="False"
                                                OnClick="btnAddMorePic_Click"><img src="images/icon/key_detail.gif" alt="" /> 添加</asp:LinkButton>
                                           <%-- <asp:LinkButton ID="btnEditMorePic" runat="server" ForeColor="#4B6888" OnClientClick="return CheckEdit()" CausesValidation="False"  ><img src="images/icon/key_edit.gif"  alt=""/> 编辑</asp:LinkButton>--%>
                                           <asp:LinkButton ID="btnDel" runat="server" CausesValidation="False" ForeColor="#4B6888" meta:resourcekey="btnDelResource2" OnClick="btnDel_Click" OnClientClick="return CheckDel()" Width="60px"><img src="images/icon/key_delete.gif" alt="删除" /> 删除</asp:LinkButton>
                                    </div> 
                                    <div style="padding: 3px 25px; " id="divMorePic" runat="server" visible="false" >
                                            <asp:Label ID="lblSrcDescription" runat="server" Text="附件名称："></asp:Label><asp:TextBox
                                                ID="txtSrcDescription" runat="server" Width="80px" MaxLength="50"></asp:TextBox>
                                            <asp:Label ID="lblSrc" runat="server" Text="附件编号："></asp:Label><asp:TextBox ID="txtSrc"
                                                runat="server" MaxLength="250"></asp:TextBox>&nbsp;<asp:Button ID="Button1" runat="server" Text="浏览文件" CssClass="button" CausesValidation="false" OnClientClick="OpenDialogDocument('txtSrc')"
                                               />&nbsp;
                                            <asp:Button ID="btnAddMorePic_T" runat="server" Text="添加" CssClass="button" CausesValidation="false" OnClick="btnAddMorePic_T_Click"
                                               />
                                            <asp:Button ID="btnEditMorePic_T" runat="server" Text="更新" CssClass="button" CausesValidation="false"
                                                Visible="false"  />
                                            <asp:Label ID="lblMorePicHelp" runat="server" Text="注意文件地址为不能为空，否则自动忽略，不会被添加。" Visible="False"></asp:Label>
                               </div>
                                     
                                </div>
                                  
                           
                            </td>
                        
                            
                        </tr>
                        
                        
                        
                        <tr class="F7tr">
                            <td style="width: 20%; height: 30px; text-align: right;">
                                <span style="font-size: 10pt; font-family: 宋体">
                                    <asp:Label ID="Label12" runat="server" Text="附件可下载会员：" /></span>
                            </td>
                            <td style="width: 80%; text-align: left; color: red;">
                                <asp:CheckBoxList ID="cblUserGroup" runat="server" RepeatDirection="Horizontal" CssClass="input2" /></td>
                        </tr>
                        <tr class="FFtr">
                            <td style="width: 20%; height: 30px; text-align: right;">
                                &nbsp;<asp:Label ID="Label14" runat="server" Text="排序号：" /></td>
                            <td style="width: 80%; text-align: left; color: red">
                                <cc1:NumberBox ID="txtOrderID" runat="server" IsInt="True" Width="100px" MaxLength="8" />
                            </td>
                        </tr>
                        <tr class="F7tr">
                            <td style="width: 20%; height: 30px; text-align: right;">
                                <cc1:HelpCtrl ID="HelpCtrl5" runat="server" FontColor="red" Header="文章属性" HideSelects="False" ImageURL="images/help.gif" Text="确定文章的相关属性。" />
                                <asp:Label ID="Label15" runat="server" Text="文章属性：" /></td>
                            <td style="width: 80%; text-align: left; color: red">
                                <asp:CheckBoxList ID="cblArticlePropertyCode" runat="server" RepeatDirection="Horizontal" CellPadding="1" CellSpacing="1" CssClass="input2" />
                            </td>
                        </tr>
                        <tr class="FFtr">
                            <td style="width: 20%; height: 30px; text-align: right;">
                            </td>
                            <td style="width: 80%; text-align: left; color: red">
                                <asp:CheckBox ID="chkIsShow" runat="server" CssClass="input3" Text="在前台显示" />
                                <asp:CheckBox ID="chkIsTop" runat="server" CssClass="input3" Text="置顶" />
                                <asp:CheckBox ID="chkIsImageArticle" runat="server" CssClass="input3" Text="是否为图文新闻" />
                                <asp:CheckBox ID="cbkIsCommet" runat="server" CssClass="input3" Text="是否允许评论" /></td>
                        </tr>
                    </table>
                </div>
            <div id="content2" runat="server" style="display: none;">
                <table style="width: 100%; border: 0px; text-align: center;" cellpadding="0" cellspacing="0">
                    <tr>
                        <td style="width: 20%; height: 30px; text-align: right;">
                            <cc1:HelpCtrl ID="HelpCtrl6" runat="server" FontColor="red" Header="文章属性" HideSelects="true" ImageURL="images/help.gif" Text="该文章相关联的商品， 将在显示文章时，显示相关的链接内容。" />
                            <asp:Label ID="Label18" runat="server" Text="关联商品" /></td>
                        <td style="width: 80%; text-align: left; color: red">
                            <cc1:SelectListBox ID="slbProduct" runat="server" CategoryHeaderText="商品分类：&nbsp;" DescHeaderText="已关联的商品" Height="200px" SrcHeaderText="待关联的商品" Width="500px" />
                        </td>
                    </tr>
                </table>
            </div>
            <div id="content3" runat="server" style="display: none;">
                <table style="width: 100%; border: 0px; text-align: center;" cellpadding="0" cellspacing="0">
                    <tr>
                        <td style="width: 20%; height: 195px; text-align: right;">
                            <cc1:HelpCtrl ID="HelpCtrl7" runat="server" FontColor="red" Header="相关商品" HideSelects="true" ImageURL="images/help.gif" Text="与本文有关的文章。" />
                            <asp:Label ID="Label20" runat="server" Text="相关文章：" /></td>
                        <td style="width: 80%; text-align: left; color: red; height: 195px;">
                            <asp:CheckBox ID="chkIsSingle" runat="server" CssClass="input3" Text="是否为单向关联" /><br />
                            <cc1:SelectListBox ID="slbArticle" runat="server" CategoryHeaderText="文章分类:" DescHeaderText="已选文章" Height="200px" SrcHeaderText="待选文章" Width="500px" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div>
            <br />
            <asp:Button ID="btnAdd" runat="server" meta:resourcekey="btnAddResource1" OnClick="btnAdd_Click" Text="确定" CssClass="button" />
            <input id="iptReset" runat="server" type="reset" value="重置" class="button" />
            <asp:Button ID="btnReturn" runat="server" CssClass="button" OnClick="btnReturn_Click" Text="返回列表" CausesValidation="False" /><br />
        </div>
        </div>
        <uc2:PageBottom ID="PageBottom" runat="server" />
        <div id="hiddenfield">
            <asp:HiddenField ID="OldOrderID" runat="server" Value="-1" />
            <asp:HiddenField ID="CheckedIDS" runat="server" Value="0" />
            <asp:HiddenField ID="RequestID" runat="server" Value="0" />
            <asp:HiddenField ID="IsEdit" runat="server" Value="0" />
            <asp:HiddenField ID="PageIndex" runat="server" Value="0" />
            <asp:HiddenField ID="MaxPageIndex" runat="server" Value="0" />
            <uc1:HiddenField ID="Alert" runat="server" />
        </div>
    </form>
  
</body>
</html>
