<%@ Page Title="" Language="C#" MasterPageFile="~/Master/officeMaster.master" AutoEventWireup="true" CodeFile="NewsInfo.aspx.cs" Inherits="News_NewsInfo" %>
<%@ Register Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" TagPrefix="ucl" %>
<%@ Register Namespace="Karpach.WebControls" Assembly="_7he7.ColorPicker" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
 <script language="javascript" type="text/javascript">
     function CheckEmpty() {
         var newsNum = $("#<%=txtFileNumber.ClientID %>")[0]; //文件号$("#<%=txtSubscriptContent.ClientID %>")[0]
         var newstitle = $("#<%=txtNewsTitle.ClientID %>")[0]; //公告标题
         var newscontent = $("#<%=fckNewsContent.ClientID %>")[0]; //公告内容
         var fuFile = $("#<%=fuFile.ClientID %>")[0]; //公告上传控件
         var filenameNow = $("#<%=txtFileName.ClientID %>")[0]; //现上传文件名
         var subscriptContent = $("#<%=txtSubscriptContent.ClientID %>")[0]; //落款
         if (newsNum.value == '') {
             alert('文件号不能为空');
             newsNum.focus();
             return false;
         }
         if (newstitle.value == '') {
             alert('公告标题不能为空！');
             newstitle.focus();
             return false;
         }
         //           if(newscontent.value==''){
         //                alert('公告内容不能为空！');
         //                return false;
         //           }
         if (subscriptContent.value == '') {
             alert('落款不能为空！');
             subscriptContent.focus();
             return false;
         }
         if (fuFile.value != '') {//上传控件中不为空时，现上传文件名不能为空！
             if (filenameNow.value == '') {
                 alert('现上传文件名不能为空！');
                 filenameNow.focus();
                 return false;
             }
             else {
                 var fileArray = filenameNow.value.split('.');
                 if (fileArray.length > 1) {
                     alert('文件名不用带后缀，系统会自动添加，请确认后重新输入！');
                     filenameNow.value = '';
                     filenameNow.focus();
                     return false;
                 }
             }
         }

         return true;
     }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table class="usertableborder" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
        <tr>
            <th>
                公告信息
            </th>
        </tr>
    </table>
    <br />
    <table class="usertableborder" cellspacing="1" cellpadding="3" width="100%">
        <tr>
            <td width="35%" class="alignright">
                发布部门：
            </td>
            <td>
                <asp:DropDownList ID="ddlDepartment" runat="server" Width="160">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="alignright">
                文件号：
            </td>
            <td>
                <asp:TextBox ID="txtFileNumber" runat="server" Width="155"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="alignright">
                公告类型：
            </td>
            <td>
                <asp:DropDownList ID="ddlNewsType" runat="server" Width="160">
                    <asp:ListItem Text="公司" Value="1" Selected="True"></asp:ListItem>
                    <asp:ListItem Text="销售部" Value="2"></asp:ListItem>
                    <asp:ListItem Text="财务部" Value="3"></asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr height="70">
            <td class="alignright">
                公告标题：
            </td>
            <td>
                <asp:TextBox ID="txtNewsTitle" runat="server" Width="500px" Style="margin-right: 10px;"></asp:TextBox><asp:CheckBox ID="chktTop" runat="server" />置顶
                <cc1:ColorPicker ID="cclColor" runat="server" Width="100px" />
                <%--<ucl:FCKeditor ID="fckNewsTitle" runat="server" Width="600px"></ucl:FCKeditor>--%>
            </td>
        </tr>
        <tr>
            <td class="alignright">
                公告内容：
            </td>
            <td>
                <ucl:FCKeditor ID="fckNewsContent" runat="server" Height="450px" Width="800px">
                </ucl:FCKeditor>
            </td>
        </tr>
        <tr id="trFileName" runat="server">
            <td class="alignright">
                已上传文件名：
            </td>
            <td>
                <span id="spanFileName" runat="server"></span><a id="aSelectFile" runat="server">预览</a>
            </td>
        </tr>
        <tr>
            <td class="alignright">
                上传文件：
            </td>
            <td>
                <asp:FileUpload ID="fuFile" runat="server" />
            </td>
        </tr>
        <tr>
            <td class="alignright">
                现上传文件名：
            </td>
            <td>
                <asp:TextBox ID="txtFileName" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr id="trSubscriptContent" runat="server">
            <td class="alignright">
                落款：
            </td>
            <td>
                <asp:TextBox ID="txtSubscriptContent" runat="server"></asp:TextBox>
            </td>
        </tr>
        <%-- <tr>
                    <td>
                        汇签：
                    </td>
                    <td>
                        <asp:DropDownList ID="DdlSign" runat="server">
                            <asp:ListItem Value="0" Text="是" 

Selected="True"></asp:ListItem>
                            <asp:ListItem Value="1" Text="否"></asp:ListItem>
                        </asp:DropDownList>s
                    </td>
                </tr>--%>
        <%--<tr><td>可查看部门：</td><td><asp:CheckBoxList ID="chklSelectDepartment" 

runat="server" 
                            RepeatDirection="Horizontal"></asp:CheckBoxList></td></tr>--%>
        <tr>
            <td colspan="2" align="center">
                <asp:Button ID="btnSubmit" runat="server" Text="提 交" Width="72" BackColor="#CCCCCC" OnClick="btnSubmit_Click" OnClientClick="return CheckEmpty();" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <%--<asp:Button ID="btnDownLoad" runat="server" Text="下载文件" OnClick="btnDownLoad_Click" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--%>
                <asp:Button ID="btnCancel" runat="server" Text="返 回" Width="72" BackColor="#CCCCCC" OnClick="btnCancel_Click" />
            </td>
        </tr>
    </table>
</asp:Content>

