<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/WFAdmin/AdmMaster.Master" CodeBehind="Logs.aspx.vb" Inherits="WebFoundations.WFPortal.UI.Logs"
    Title="Untitled Page" %>
<%@ Register Assembly="WebFoundations.ServerControls" Namespace="WebFoundations.ServerControls" TagPrefix="cc1" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="wff" Namespace="WebFoundations.ServerControls" Assembly="WebFoundations.ServerControls" %>

<asp:Content ContentPlaceHolderID="TagHead" runat="server">
    <script type="text/javascript">
        function postBackHiddenField(hiddenFieldID) {
            var hiddenField = $get(hiddenFieldID);
            if (hiddenField) {
                hiddenField.value = (new Date()).getTime();
                __doPostBack(hiddenFieldID, '');
            }
        }
    </script>
</asp:Content>

<asp:Content ContentPlaceHolderID="FilterContent" runat="server">
    <div class="fields">
        <label>
            <asp:Label ID="lblcategory" runat="server" />
            <asp:DropDownList ID="lstcategory" runat="server" />
        </label>
        <label>
            <asp:Label ID="lbltype" runat="server" />
            <asp:DropDownList ID="lsttype" runat="server" />
        </label>
        <label>
            <asp:Label ID="lbldatefrom" runat="server" />
            <div>
                <cc1:DatePicker ID="datefrom" DisableLowerValuesFor="dateto" width="115px" runat="server" />
                <asp:Label ID="lbldateto" runat="server" />
                <cc1:DatePicker ID="dateto" runat="server"  width="115px"/>
            </div>
        </label>
    </div>
    <asp:Button ID="btnbuscar" runat="server" CssClass="search" />
</asp:Content>

<asp:Content ContentPlaceHolderID="ActionContent" runat="server">
    <ul>
        <li>
            <asp:HyperLink ID="lnkdelete" runat="server" CssClass="delete" /></li>
        <li>
            <asp:HyperLink ID="lnkrefresh" runat="server" CssClass="refresh" /></li>
        <li>
            <asp:LinkButton ID="lnkExport" runat="server" CssClass="export" /></li>
    </ul>
</asp:Content>

<asp:Content ContentPlaceHolderID="MainContent" runat="server">
    <asp:ObjectDataSource ID="LogODS" runat="server" SelectMethod="GetItems"
        TypeName="WebFoundations.WFPortal.Management.ObjectDataSources.Logs"
        EnablePaging="True" SortParameterName="column" SelectCountMethod="CountItems"
        MaximumRowsParameterName="MaximumRows" StartRowIndexParameterName="StartRowIndex">
        <SelectParameters>
            <asp:ControlParameter ControlID="ctl00$FilterContent$lstcategory" Name="Category" PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="ctl00$FilterContent$lsttype" Name="LogType" PropertyName="SelectedValue" Type="Int32" />
            <asp:ControlParameter ControlID="ctl00$FilterContent$datefrom" Name="FromDate" PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="ctl00$FilterContent$dateto" Name="ToDate" PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="updateform">
        <ProgressTemplate>
            <div class="up-loading"></div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="updateform" runat="server">
        <ContentTemplate>
            <telerik:RadGrid ID="grdLog" runat="server"
                AutoGenerateColumns="false" 
                DataSourceID="LogODS" AllowSorting="true" AllowCustomPaging="true"
                GridLines="None" AllowPaging="True" PageSize="13">
                <MasterTableView DataSourceID="LogODS">
                    <Columns>
                        <telerik:GridBoundColumn DataField="EventCategory" HeaderText="EventCategory" UniqueName="EventCategory" ItemStyle-HorizontalAlign="center" />
                        <telerik:GridBoundColumn DataField="EventTimeStamp" HeaderText="EventTimeStamp" UniqueName="EventTimeStamp" ItemStyle-HorizontalAlign="center" />
                        <telerik:GridBoundColumn DataField="EventMessage" HeaderText="EventMessage" UniqueName="EventMessage" ItemStyle-HorizontalAlign="center" />
                        <telerik:GridBoundColumn DataField="UserName" HeaderText="UserName" UniqueName="UserName" ItemStyle-HorizontalAlign="center" />
                    </Columns>
                </MasterTableView>
                <ClientSettings AllowColumnsReorder="false" AllowDragToGroup="false"
                    AllowColumnHide="false"
                    Selecting-AllowRowSelect="true" Scrolling-AllowScroll="False"
                    Scrolling-UseStaticHeaders="true">
                </ClientSettings>
                <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                <ExportSettings ExportOnlyData="True" FileName="Logs" IgnorePaging="True" OpenInNewWindow="True" />
            </telerik:RadGrid>
            <asp:HiddenField ID="PostBackHidden" runat="server"></asp:HiddenField>
            <telerik:RadGrid ID="printgrid" runat="server"
                AutoGenerateColumns="false" 
                DataSourceID="" AllowSorting="false"
                GridLines="None" AllowPaging="False" EnableViewState="False">
                <MasterTableView>
                    <ExpandCollapseColumn Visible="False">
                        <HeaderStyle />
                    </ExpandCollapseColumn>
                    <RowIndicatorColumn Visible="False">
                        <HeaderStyle />
                    </RowIndicatorColumn>
                    <Columns>
                        <telerik:GridBoundColumn DataField="Id" HeaderText="Id" UniqueName="Id">
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="EventCategory" HeaderText="EventCategory" UniqueName="EventCategory">
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="EventTimeStamp" HeaderText="EventTimeStamp" UniqueName="EventTimeStamp">
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="EventMessage" HeaderText="EventMessage" UniqueName="EventMessage">
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="UserName" HeaderText="UserName" UniqueName="UserName">
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="EventCode" HeaderText="EventCode" UniqueName="EventCode">
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="EventType" HeaderText="EventType" UniqueName="EventType">
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Url" HeaderText="Url" UniqueName="Url">
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="UserAddress" HeaderText="UserAddress" UniqueName="UserAddress">
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="UserAuthType" HeaderText="UserAuthType" UniqueName="UserAuthType">
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings AllowColumnsReorder="True">
                    <Selecting AllowRowSelect="True" />
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                </ClientSettings>
                <ExportSettings ExportOnlyData="True" FileName="Logs" IgnorePaging="False" OpenInNewWindow="True" />
            </telerik:RadGrid>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="ctl00$FilterContent$btnbuscar" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="PostBackHidden" EventName="ValueChanged" />
        </Triggers>
    </asp:UpdatePanel>
    </div>
    <wff:WindowManager ID="EditWindow" runat="server">
        <Windows>
            <telerik:RadWindow ID="EditDialog" runat="server" Height="420px" Width="450px" ReloadOnShow="true" Modal="true" />
        </Windows>
    </wff:WindowManager>
</asp:Content>
