<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContentList.aspx.cs" Inherits="PowerEasy.Module.General.WebSite.Admin.Contents.ContentList" %>

<!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>
    <base target="_self" />
</head>
<body class="floatingIframe">
    <form id="form1" runat="server">
    <div>
        <table style="width: 100%; height: 100%;" cellpadding="2" cellspacing="0">
            <tr>
                <td class="title" style="height: 25px;" colspan="2" align="center">
                    选择内容信息
                </td>
            </tr>
        </table>
        <table width="100%" border="0" style="text-align: center" cellpadding="2" cellspacing="0">
            <tr class="title">
                <td style="text-align: left;">
                    <span style="float:left">节点：<asp:DropDownList ID="dropNode" runat="server" OnSelectedIndexChanged="dropNode_SelectedIndexChanged"
                        AutoPostBack="true">
                    </asp:DropDownList>
                    名称/标题关键字：<asp:TextBox ID="TxtKeyword" Width="80px" runat="server"></asp:TextBox>&nbsp;<asp:Button
                        ID="btnSearch" OnClick="BtnSearch_Click" CssClass="inputbutton" runat="server" Text="搜索" />&nbsp;</span>
                        <input type="button" style="float:right" class="inputbutton" onclick="closeFloatWindow()" value="确定" />
                </td>
            </tr>
        </table>
        <pe:ExtendedGridView ID="gdvCommList" AutoGenerateCheckBoxColumn="False" runat="server"
            AllowPaging="True" AutoGenerateColumns="False" CheckBoxFieldHeaderWidth="5%"
            DataKeyNames="GeneralId" DataSourceID="OdsCommonList" IsHoldState="True" PageSize="15">
            <Columns>
                <asp:TemplateField HeaderText="选择" SortExpression="GeneralId">
                    <ItemStyle HorizontalAlign="Center" />
                    <ItemTemplate>
                        <input type="checkbox" onclick='add(this,"<%# Eval("GeneralId") %>")' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="名称/标题" SortExpression="Title">
                    <ItemStyle HorizontalAlign="Left" />
                    <ItemTemplate>
                        <pe:ExtendedLabel ID="LblInfoTitle" runat="server" Text='<%# Eval("Title") %>' HtmlEncode="false"></pe:ExtendedLabel>
                        <asp:HiddenField ID="hdnModelId" Value='<%#Eval("ModelId") %>' runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </pe:ExtendedGridView>
        <asp:ObjectDataSource ID="OdsCommonList" runat="server" SelectMethod="GetCommonModelList"
            TypeName="PowerEasy.Module.General.BusinessLogic.CommonModel.ModelManager" EnablePaging="True"
            MaximumRowsParameterName="maxNumberRows" SelectCountMethod="GetTotalOfCommonModelInfo"
            StartRowIndexParameterName="startRowIndexId">
            <SelectParameters>
                <asp:ControlParameter ControlID="HdnNodeId" Type="Int32" Name="nodeId" PropertyName="Value" />
                <asp:ControlParameter ControlID="HdnSearchKeyword" Type="String" Name="keywords"
                    PropertyName="Value" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:HiddenField ID="HdnNodeId" runat="server" Value="0" />
        <asp:HiddenField ID="HdnSearchKeyword" runat="server" Value="a" />
    </div>

    <script type="text/javascript">
        function add(obj, generalId) {
            if (obj.checked) {
                parent.document.getElementById('<%= m_HdnGeneralIds %>').value = generalId;
                if(<%= m_Type %> > 0)
                {
                    parent.document.getElementById('<%= m_HdnType %>').value = <%= m_Type %>;
                }
                parent.document.getElementById('<%= m_btnAdd %>').click();
            }
        }
        
        function closeFloatWindow(){
            parent.document.getElementById('<%= CloseByID %>').style.display = "none";
            if (parent.document.getElementById('jqDnrFloatDivBg')) {
                parent.document.getElementById('jqDnrFloatDivBg').style.display = "none";
            }
        }
    </script>

    </form>
</body>
</html>
