<%@ page language="C#" autoeventwireup="true" validaterequest="false" inherits="Knowledge_KnowledgeManage_E, App_Web_okxwxbf0" stylesheettheme="Themes" theme="Themes" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="cc1" %>
<%@ Register Src="../UserControls/KnowledgeAttachment.ascx" TagName="KnowledgeAttachment"
    TagPrefix="uc1" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<!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 id="Head1" runat="server">
    <title>企业知识管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../css/layout.css" rel="stylesheet" type="text/css" />
    <link href="../css/layerDiv.css" rel="stylesheet" type="text/css" />

    <script src="../js/LayerDiv.js" type="text/javascript"></script>

    <script type="text/javascript" src="../js/jquery.js"></script>

    <script type="text/javascript" src="../js/jquery.pngFix.pack.js"></script>

    <script type="text/javascript" src="../js/WebValidator.js"></script>

    <script type="text/javascript" src="../js/InterfaceContrl.js"></script>

    <script src="../js/common.js" type="text/javascript"></script>
    
            <script src="../js/artDialog3/artDialog.min.js"></script>
      <script>          (function($) { var d = $.dialog.defaults; d.skin = ['chrome']; })(art);</script>

    <script language="javascript">
        function CheckAll() {
            var cked = false;
            cked = document.getElementById("chkSelAll").checked;
            for (var i = 0; i < document.getElementsByTagName("*").length; i++) {
                var e = document.getElementsByTagName("*")[i];
                try {
                    if (e.name.substring(e.name.length - 6, e.name.length) == "chkSel") {
                        e.checked = cked;
                    }
                }
                catch (exception) {
                }
            }
        }

        function CheckSelect() {
            var count = 0;
            for (var i = 0; i < document.getElementsByTagName("*").length; i++) {
                var e = document.getElementsByTagName("*")[i];
                try {
                    if (e.name.substring(e.name.length - 6, e.name.length) == "chkSel") {
                        if (e.checked == true) {
                            count++;
                        }
                    }
                }
                catch (exception) {
                }
            }
            if (count == 0) {
                //alert("请选择您要删除的项！");
                art.dialog({ content: '请选择您要删除的项!', lock: true, icon: 'alert', width: '200px' }, function() { return true; });
                return false;
            }
            else {
                return confirm('您确定要删除所选项吗?');
            }
        }

        function upload() {
            var sURL = "KnowledgeAdjunctUpload.aspx?id=" + document.form1.txtProductID.value + "&type=1";
            var sFeatures = 'dialogHeight:450px; dialogWidth:750px; scroll:no; status:no; help:no; resizable:yes; center:yes';
            var result = window.showModalDialog(sURL, "", sFeatures);
        }
    </script>

</head>
<body>

    <form id="form1" runat="server">
    <table cellpadding="0" cellspacing="0" class="table_box">
        <tr>
            <td class="right_bg">
                <span class="right_title">
                    <img src="../Images/homen.gif" class="img_style" />
                    您的当前位置：资源管理 &gt; 企业知识库维护 &gt;
                    <asp:Label ID="lblNav" runat="server" Text=""></asp:Label></span>
            </td>
        </tr>
    </table>
    <asp:Panel ID="panelGrid" runat="server" Height="100%" CssClass="table_box">
        <table width="100%" height="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td class="r_top_box">
                    <table cellspacing="0" cellpadding="5" class="r_top_title_box">
                        <tr>
                            <td style="width: 83px; height: 34px;" align="left">
                                &nbsp;&nbsp;查询条件：
                            </td>
                            <td style="width: 100px; height: 34px;">
                                <asp:DropDownList ID="ddlFieldName" runat="server" Width="95px" Height="22px">
                                    <asp:ListItem Value="Title">标题</asp:ListItem>
                                    <asp:ListItem Value="Keyword">关键字</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td style="width: 148px; height: 34px;">
                                <asp:TextBox ID="txtFieldValue" runat="server" Width="135px" MaxLength="50"></asp:TextBox>
                            </td>
                            <td align="left" width="100">
                                <asp:Button ID="btnSearch" runat="server" Text="查 询" OnClick="btnSearch_Click" />
                            </td>
                            <td style="width: 100px;" align="right">
                                排序规则：
                            </td>
                            <td width="">
                                <asp:RadioButtonList ID="rblStatus" runat="server" RepeatDirection="Horizontal" Style="cursor: pointer;"
                                    AutoPostBack="True" OnSelectedIndexChanged="rblStatus_SelectedIndexChanged">
                                    <asp:ListItem Value="CreateTime" Selected="True">创建时间</asp:ListItem>
                                    <asp:ListItem Value="ClickRate">点击量</asp:ListItem>
                                    <%--<asp:ListItem Value="All">全部</asp:ListItem>--%>
                                </asp:RadioButtonList>
                            </td>
                            <td align="right">
                                <asp:Button ID="btnAdd" runat="server" Text="添加" OnClick="btnAdd_Click" />
                                <asp:Button ID="btnBatchDel" runat="server" Text="批量删除" OnClick="btnBatchDel_Click" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td class="margintop5">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
                        <tr>
                            <td align="left" id="ClassArea" runat="server" valign="top" class="tree_box" style="height:100%;">
                                <asp:TreeView ID="tree" runat="server" ShowLines="True" DataSourceID="XmlDataSource1"
                                    ExpandDepth="1" OnDataBound="tree_DataBound" OnSelectedNodeChanged="tree_SelectedNodeChanged">
                                    <LevelStyles>
                                        <asp:TreeNodeStyle Font-Underline="False" />
                                        <asp:TreeNodeStyle Font-Underline="False" />
                                    </LevelStyles>
                                    <SelectedNodeStyle ForeColor="" />
                                    <NodeStyle ForeColor="Black" />
                                    <RootNodeStyle HorizontalPadding="0px" />
                                    <DataBindings>
                                        <asp:TreeNodeBinding DataMember="Item" TextField="ClassName" ValueField="ID" />
                                        <asp:TreeNodeBinding DataMember="Root" TextField="ClassName" ValueField="ID" />
                                    </DataBindings>
                                </asp:TreeView>
                                <asp:XmlDataSource ID="XmlDataSource1" runat="server" EnableCaching="False"></asp:XmlDataSource>
                            </td>
                            <td valign="top" style="width:99%;">
                                <table cellpadding="0" cellspacing="0" width="100%">
                                    <tr>
                                        <td>
                                            <asp:GridView ID="gvKnowledge" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
                                                OnRowDataBound="gvKnowledge_RowDataBound" OnRowEditing="gvKnowledge_RowEditing"
                                                OnRowDeleting="gvKnowledge_RowDeleting" HorizontalAlign="Center">
                                                <Columns>
                                                    <asp:TemplateField>
                                                        <HeaderTemplate>
                                                            全选<input id="chkSelAll" name="chkSelAll" onclick="javascript:CheckAll();" type="checkbox">
                                                        </HeaderTemplate>
                                                        <HeaderStyle Width="60" />
                                                        <ItemStyle />
                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="chkSel" runat="server" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField DataField="ClassName" HeaderText="分类" HeaderStyle-Width="70px">
                                                        <HeaderStyle Width="70px" />
                                                        <ItemStyle HorizontalAlign="Left" />
                                                    </asp:BoundField>
                                                    <asp:TemplateField HeaderText="标题">
                                                        <ItemStyle HorizontalAlign="Left" CssClass="tdOverflow" />
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="txtUserID" runat="server" Visible="false" Text='<%# Eval("UserID") %>'></asp:TextBox>
                                                            <a target="_blank" href='KnowledgeInfo.aspx?id=<%# Eval("ID") %>&type=1&source=ke'>
                                                                <%# Common.CutString(Eval("Title").ToString(), 26) %></a>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField DataField="UserName" HeaderText="创建者">
                                                        <HeaderStyle Width="90px" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="ClickRate" HeaderText="点击量" HeaderStyle-Width="60px">
                                                        <HeaderStyle Width="60px" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="CreateTime" DataFormatString="{0:yyyy/MM/dd HH:mm}" HeaderText="创建时间">
                                                    </asp:BoundField>
                                                    <asp:CommandField ShowEditButton="True" EditText="编辑" CancelText="取消" UpdateText="更新"
                                                        ShowDeleteButton="True" DeleteText="删除" HeaderText="操作" ControlStyle-CssClass="linkBtn">
                                                        <ControlStyle CssClass="linkBtn" />
                                                        <HeaderStyle Width="60" />
                                                    </asp:CommandField>
                                                    <%-- <asp:CommandField  ControlStyle-CssClass="gridBtn" ControlStyle-ForeColor="Blue" >
                    <HeaderStyle Width="40" />
                  </asp:CommandField>    --%>
                                                </Columns>
                                                <EmptyDataRowStyle BackColor="#E0E0E0" />
                                                <EmptyDataTemplate>
                                                    <img src="../Images/waring_pic01.gif" width="32px" height="32px" class="nodata_img" /><asp:Label
                                                        ID="lblEmpty" class="no_found" runat="server" Text="没有符合条件的数据！"></asp:Label>
                                                </EmptyDataTemplate>
                                            </asp:GridView>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="page_bg_left">
                                           <cc1:AspNetPager ID="myAspNetPager" runat="server" AlwaysShow="True" CssClass="cut_pager" PageSize="10"
                                FirstPageText="首页&nbsp;&nbsp;" HorizontalAlign="Right" InputBoxStyle="width:20px;" 
                                LastPageText="尾页" NextPageText="&nbsp;&nbsp;下一页&nbsp;&nbsp;" NumericButtonTextFormatString="  {0}"
                                OnPageChanging="AspNetPager1_PageChanging" PrevPageText="上一页"  ShowCustomInfoSection="Left" CustomInfoTextAlign="Left"
                                ShowInputBox="Always">
                            </cc1:AspNetPager>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="panelAdd_Edit" runat="server" Height="100%" Visible="false"
        CssClass="table_box">
         <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
            <td class="r_top_box">
                <table cellspacing="0" cellpadding="5" class="r_top_title_box">
                <tr>
                    <td id="tab_title">
                        企业知识管理
                    </td>
                    <td align="right">
                        <asp:Button ID="btnSave" runat="server" Text="保存" OnClick="btnSave_Click" />
                        <asp:Button ID="btnAddGoOn" runat="server" Text="继续添加" Visible="false" OnClick="btnAddGoOn_Click" />
                        <asp:Button ID="btnReturn" runat="server" Text="返回" OnClick="btnReturn_Click" />
                    </td>
                </tr>
            </table></td>
            </tr>
            <tr>
                <td class="margintop5"><table border="0" cellpadding="0" cellspacing="1" width="100%" class="table_notitle">
                <tr>
                    <td width="150" align="right" bgcolor="#ffffff" class="td01">
                        分类：
                    </td>
                    <td bgcolor="#ffffff">
                        <asp:Label ID="lblClassName" runat="server" Text=""></asp:Label>
                        <asp:Button ID="btnSelectClas" runat="server" OnClick="btnSelectClas_Click" Text="选择分类" />
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#ffffff" class="td01">
                        标题：
                    </td>
                    <td bgcolor="#ffffff">
                        <asp:TextBox ID="txtName" runat="server" CssClass="input1" MaxLength="50" Width="550px"></asp:TextBox>
                        &nbsp;<span
                            style="color: Red;">*</span>
                        <%--<span style="color:Red; font-size:12px;">*</span>--%>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#ffffff" class="td01">
                        关键字：
                    </td>
                    <td bgcolor="#ffffff">
                        <asp:TextBox ID="txtKeyWord" runat="server" MaxLength="20" TabIndex="3" Width="300px"></asp:TextBox>
                        <asp:DropDownList ID="ddlKeyWord" runat="server" Width="95px">
                            <asp:ListItem></asp:ListItem>
                            <asp:ListItem></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#ffffff" class="td01">
                        内容：
                    </td>
                    <td bgcolor="#ffffff">
                        <%--<asp:TextBox ID="txtDescription" runat="server" CssClass="input1" 
                Height="129px" TextMode="MultiLine" Width="550px"></asp:TextBox>--%>
                        <div style="float: left;">
                            <FCKeditorV2:FCKeditor ID="txtDescription" runat="server" BasePath="../Edit/" Height="250px"
                                Width="650px">
                            </FCKeditorV2:FCKeditor>
                        </div>
                        &nbsp;<span style="color: Red; display: block; margin-top: 140px;">*</span>
                    </td>
                </tr>
                <%--<tr>
        <td width="200" align="right" bgcolor="#ffffff">
            &nbsp;</td>
        <td width="300" bgcolor="#ffffff" colspan="2" style="width: 400px">
            <asp:RadioButtonList ID="rblOwnerOrUse" runat="server" AutoPostBack="True" style="float:left; margin-right:10px;"
                CssClass="hand" RepeatDirection="Horizontal">
                <asp:ListItem Selected="True" Value="owner">领用</asp:ListItem>
                <asp:ListItem Value="use">占用</asp:ListItem>
            </asp:RadioButtonList>
            <asp:CheckBox ID="cbIsAapproval" runat="server" CssClass="hand" Text="是否主任审批" />
        </td>
        <td bgcolor="#ffffff">
            &nbsp;</td>
    </tr>--%>
                <tr>
                    <td align="right" bgcolor="#ffffff" class="td01">
                        附件上传：
                    </td>
                    <td bgcolor="#ffffff" height="30px">
                        <%--<asp:Button ID="btnUpload" runat="server"
        Text="上传" onclick="btnUpload_Click" />--%>
                        <asp:Button ID="btnUpload" runat="server" Enabled="false" OnClick="btnUpload_Click"
                            OnClientClick="upload()" Text="附件上传" />
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#ffffff" height="30px" colspan="2">
                        <uc1:KnowledgeAttachment ID="KnowledgeAttachment" runat="server" />
                    </td>
                </tr>
            </table></td>
            </tr></table>
    </asp:Panel>
    <div id="LayerShow" runat="server" style="width: 400px; top: 8%; overflow: auto;
        padding-left: 10px; padding-right: 10px; padding-top: 10px; display: none; background-color: #fff;">
        <div id="m_onlineuser" class="b2">
            <div class="rct">
                <div class="l tl1">
                </div>
                <div class="r tr1">
                </div>
            </div>
            <div class="cnt f14">
                <div style="color: #666" align="center">
                    <table class="" cellpadding="5" height="400">
                        <tr>
                            <td>
                                <div style="overflow: auto; height: 400px;">
                                    <asp:TreeView ID="TreeView1" runat="server" ShowLines="True" DataSourceID="XmlDataSource2"
                                        ExpandDepth="1" OnDataBound="tree_DataBound1" OnSelectedNodeChanged="tree_SelectedNodeChanged1">
                                        <LevelStyles>
                                            <asp:TreeNodeStyle Font-Underline="False" />
                                            <asp:TreeNodeStyle Font-Underline="False" />
                                        </LevelStyles>
                                        <SelectedNodeStyle ForeColor="" />
                                        <NodeStyle ForeColor="Black" />
                                        <RootNodeStyle HorizontalPadding="0px" />
                                        <DataBindings>
                                            <asp:TreeNodeBinding DataMember="Item" TextField="ClassName" ValueField="ID" />
                                            <asp:TreeNodeBinding DataMember="Root" TextField="ClassName" ValueField="ID" />
                                        </DataBindings>
                                    </asp:TreeView>
                                    <asp:XmlDataSource ID="XmlDataSource2" runat="server" EnableCaching="False"></asp:XmlDataSource>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Button ID="btnSelectClass" runat="server" Text="确定" OnClick="btnSelectClass_Click" />
                                <asp:Button ID="btnCancel" runat="server" Text="取消" OnClick="btnCancel_Click" />
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="rcb">
                <div class="l bl1">
                </div>
                <div class="r br1">
                </div>
            </div>
        </div>
    </div>
    <div id="LayerOKConfirm" runat="server" style="width: 300px; z-index: 2; height: 200px;
        overflow: auto; padding-left: 10px; padding-right: 10px; padding-top: 10px; display: none;
        background-color: #fff; position: absolute; left: 20%; top: 15%;">
        <div id="Div3" class="b2">
            <div class="rct">
                <div class="l tl1">
                </div>
                <div class="r tr1">
                </div>
            </div>
            <div class="cnt f14">
                <div style="color: #666" align="center">
                    <table class="style1">
                        <tr>
                            <td>
                                保存成功！可以上传附件。 是否继续添加
                        </tr>
                        <tr>
                            <td>
                                <asp:Button ID="btnYes" runat="server" Text="是" OnClick="btnYes_Click" />
                                <asp:Button ID="btnNo" runat="server" Text="否" OnClick="btnNo_Click" />
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="rcb">
                <div class="l bl1">
                </div>
                <div class="r br1">
                </div>
            </div>
        </div>
    </div>
    <div id="LayerAll" runat="server">
    </div>
    <asp:TextBox ID="txtClassID" runat="server" Visible="false"></asp:TextBox>
    <asp:TextBox ID="txtProductID" runat="server" Style="display: none"></asp:TextBox>
    </form>

</body>
<%--<script language="javascript" type="text/javascript">
    $(document).ready(function()
    {
        Validator();
    });
    function Validator()
    {
        $('#<%= btnSave.ClientID %>').bind('click', function()
        {

            return GetValidatorMessage();
        });
        $("#<%=txtDescription.ClientID %>").textlimit(500);
    }
    </script>--%>
</html>
