<%@ Page Title="" Language="C#" MasterPageFile="~/SiteMaster.Master" AutoEventWireup="true" CodeBehind="NotificationLogPage.aspx.cs" Inherits="MKInsight.Online.ActionTracking.Support.NotificationLogPage" %>

<%@ Register Assembly="UIWebControls" Namespace="UIWebControls" TagPrefix="cc4" %>
<%@ Register Src="../UIControls/Header.ascx" TagName="Header" TagPrefix="uc1" %>
<%@ Register Src="../UIControls/MessageBox.ascx" TagName="MessageBox" TagPrefix="uc2" %>

<%@ Register Src="../UIControls/Interface/DropDownListEX.ascx" TagName="DropDownListEX" TagPrefix="uc3" %>

<%@ Register Src="../UIControls/Interface/Filters/ListFilterInput.ascx" TagName="ListFilterInput" TagPrefix="uc4" %>

<%@ Register Src="../UIControls/Interface/Filters/DateRangeInput.ascx" TagName="DateRangeInput" TagPrefix="uc5" %>

<%@ Register Src="../UIControls/Interface/TextBoxNumberEx.ascx" TagName="TextBoxNumberEx" TagPrefix="uc6" %>

<%@ Register Src="../UIControls/Interface/SimpleSectionBreak.ascx" TagName="SimpleSectionBreak" TagPrefix="uc7" %>

<%@ Register Src="../UIControls/Interface/TextBoxEx.ascx" TagName="TextBoxEx" TagPrefix="uc8" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="c_M" runat="server">

    <uc1:Header ID="u_H" runat="server" />
    <uc2:MessageBox ID="u_M" runat="server" />

    <asp:Panel ID="tbP" runat="server" CssClass="w-bar">

        <asp:LinkButton runat="server" ID="tbl_NotificationLogs" CssClass="w-button" Style="background: url(../images/folder_time32.png); " OnClick="OnNotification">
            <asp:Label ID="tbl_NotificationLogsLabel" runat="server"></asp:Label>

        </asp:LinkButton>

        <asp:LinkButton runat="server" ID="tbl_LegacyLogs" CssClass="w-button" Style="background: url(../images/folder_disable32.png); " OnClick="OnLegacy">
            <asp:Label ID="tbl_LegacyLogsLabel" runat="server"></asp:Label>

        </asp:LinkButton>

    </asp:Panel>

    <asp:MultiView ID="mv" runat="server">
        <asp:View ID="v_main" runat="server">
            <table style="width: 100%">
                <tr>
                    <td>

                        <uc7:SimpleSectionBreak ID="lbl_Filters" runat="server" />

                    </td>
                </tr>
                <tr>
                    <td>
                        <uc4:ListFilterInput ID="u_Templates" runat="server" />
                    </td>

                </tr>
                <tr>
                    <td>
                        <uc4:ListFilterInput ID="u_Trigger" runat="server" />
                    </td>

                </tr>
                <tr>
                    <td>
                        <uc4:ListFilterInput ID="u_Groups" runat="server" />
                    </td>

                </tr>
                <tr>
                    <td>
                        <uc4:ListFilterInput ID="u_Users" runat="server" />
                    </td>

                </tr>
                <tr>
                    <td>
                        <uc4:ListFilterInput ID="u_States" runat="server" />
                    </td>

                </tr>
                <tr>
                    <td>

                        <uc5:DateRangeInput ID="u_DRange" runat="server" />

                    </td>
                </tr>
                <tr>
                    <td>

                        <uc8:TextBoxEx ID="u_Recipient" runat="server" />

                    </td>
                </tr>
                <tr>
                    <td>

                        <uc6:TextBoxNumberEx ID="u_EntityID" runat="server" />

                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Button ID="btn_Search" runat="server" OnClick="OnSearch" />
                        &nbsp;<asp:Button ID="btn_clear" runat="server" OnClick="OnClear" />
                    </td>
                </tr>
                <tr>
                    <td>

                        <uc7:SimpleSectionBreak ID="lbl_Results" runat="server" />

                    </td>
                </tr>
                <tr>
                    <td>
                        <cc4:MKGridView ID="u_log" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
                            BorderStyle="None" CellPadding="3" OnPageIndexChanging="OnIndexChanging" OnSorting="OnGridSorting"
                            OnRowDataBound="OnRowDataBound" Width="95%">
                            <AlternatingRowStyle CssClass="alternatingrowstyle" />
                            <FooterStyle BackColor="White" ForeColor="#000066" />
                            <HeaderStyle CssClass="headerstyle" Font-Bold="True" HorizontalAlign="Left" Wrap="False" />
                            <PagerStyle HorizontalAlign="Left" />
                            <Columns>

                                <asp:BoundField DataField="Date" HeaderText="Date_" SortExpression="Date" />
                                <asp:BoundField DataField="template" HeaderText="¬NotificationTemplate" SortExpression="template" />
                                <asp:BoundField DataField="trigger" HeaderText="NotificationTrigger" SortExpression="trigger" />
                                <asp:BoundField DataField="State" HeaderText="State" SortExpression="State" />
                                <asp:BoundField DataField="user" HeaderText="user" SortExpression="user" />
                                <asp:BoundField DataField="group" HeaderText="GroupingName" SortExpression="group" />
                                <asp:BoundField DataField="entityId" HeaderText="entityId" SortExpression="entityId" />
                                <asp:BoundField DataField="entityDetails" HeaderText="Details" SortExpression="entityDetails" />
                                <asp:BoundField DataField="failureReason" HeaderText="¬FailureReason" SortExpression="failureReason" />

                            </Columns>
                            <PagerTemplate>
                                <asp:Label ID="lbl_ShowRows" runat="server" Text="Show rows:" /><asp:DropDownList
                                    ID="ddlPageSize" runat="server" AutoPostBack="true" OnSelectedIndexChanged="OnSelectedIndexChanged">

                                    <asp:ListItem Value="20" />
                                    <asp:ListItem Value="50" />
                                    <asp:ListItem Value="100" />
                                    <asp:ListItem Value="150" />
                                    <asp:ListItem Value="250" />
                                </asp:DropDownList>
                                &#160;&#160;<asp:Label ID="lbl_page" runat="server" Text="Page" />
                                <asp:TextBox ID="txtGoToPage" runat="server" AutoPostBack="true" CssClass="gotopage"
                                    OnTextChanged="GoToPageOnTextChanged" />
                                <asp:Label ID="lbl_Of" runat="server" Text="of" />
                                <asp:Label ID="lblTotalNumberOfPages" runat="server" />
                                &nbsp;&nbsp;<asp:Button ID="btn_p" runat="server" CommandArgument="Prev" SkinID="_" CommandName="Page"
                                    CssClass="previous" ToolTip="Previous Page" /><asp:Button ID="btn_n" runat="server"
                                        CommandArgument="Next" SkinID="_" CommandName="Page" CssClass="next" ToolTip="Next Page" />
                            </PagerTemplate>
                            <SelectedRowStyle BackColor="#D6E8FF" ForeColor="Black" />
                        </cc4:MKGridView>
                        
                    </td>
                </tr>
            </table>

        </asp:View>
        <asp:View ID="v_legacy" runat="server">
            <table style="width: 100%">
                <tr>
                    <td>

                        <uc7:SimpleSectionBreak ID="lbl_legacy_filter" runat="server" />

                    </td>
                </tr>
                <tr>
                    <td>
                          <uc4:ListFilterInput ID="u_legacy_type" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                         <uc4:ListFilterInput ID="u_legacy_user" runat="server" />
                    </td>
                </tr>

                <tr>
                    <td>
                          <asp:Button ID="btn_legacy_search" runat="server" OnClick="OnSearchLegacy"  />
                        &nbsp;<asp:Button ID="btn_legacy_clear" runat="server" OnClick="OnLegacyClear"  />
                    </td>
                </tr>

                 <tr>
                    <td>

                        <uc7:SimpleSectionBreak ID="lbl_legacy_result" runat="server" />

                    </td>
                </tr>
                 <tr>
                    <td>
                        <cc4:MKGridView ID="u_legacyLog" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
                            BorderStyle="None" CellPadding="3" OnPageIndexChanging="OnLeacyIndexChanging" OnSorting="OnLegacyGridSorting"
                            OnRowDataBound="OnLeacyRowDataBound" Width="95%">
                            <AlternatingRowStyle CssClass="alternatingrowstyle" />
                            <FooterStyle BackColor="White" ForeColor="#000066" />
                            <HeaderStyle CssClass="headerstyle" Font-Bold="True" HorizontalAlign="Left" Wrap="False" />
                            <PagerStyle HorizontalAlign="Left" />
                            <Columns>

                                <asp:BoundField DataField="Date" HeaderText="Date_" SortExpression="Date" />
                                <asp:BoundField DataField="type" HeaderText="type" SortExpression="type" />                                
                                <asp:BoundField DataField="user" HeaderText="user" SortExpression="user" />
                                <asp:BoundField DataField="entityType" HeaderText="¬entityType" SortExpression="entityType" />
                                <asp:BoundField DataField="entityId" HeaderText="entityId" SortExpression="entityId" />                                
                                <asp:BoundField DataField="FailState" HeaderText="¬FailureReason" SortExpression="FailState" />

                            </Columns>
                            <PagerTemplate>
                                <asp:Label ID="lbl_ShowRows" runat="server" Text="Show rows:" /><asp:DropDownList
                                    ID="ddlPageSize" runat="server" AutoPostBack="true" OnSelectedIndexChanged="OnLeacySelectedIndexChanged">

                                    <asp:ListItem Value="20" />
                                    <asp:ListItem Value="50" />
                                    <asp:ListItem Value="100" />
                                    <asp:ListItem Value="150" />
                                    <asp:ListItem Value="250" />
                                </asp:DropDownList>
                                &#160;&#160;<asp:Label ID="lbl_page" runat="server" Text="Page" />
                                <asp:TextBox ID="txtGoToPage" runat="server" AutoPostBack="true" CssClass="gotopage"
                                    OnTextChanged="GoToLegacyPageOnTextChanged" />
                                <asp:Label ID="lbl_Of" runat="server" Text="of" />
                                <asp:Label ID="lblTotalNumberOfPages" runat="server" />
                                &nbsp;&nbsp;<asp:Button ID="btn_p" runat="server" CommandArgument="Prev" SkinID="_" CommandName="Page"
                                    CssClass="previous" ToolTip="Previous Page" /><asp:Button ID="btn_n" runat="server"
                                        CommandArgument="Next" SkinID="_" CommandName="Page" CssClass="next" ToolTip="Next Page" />
                            </PagerTemplate>
                            <SelectedRowStyle BackColor="#D6E8FF" ForeColor="Black" />
                        </cc4:MKGridView>

                    </td>
                </tr>
                
            </table>
        </asp:View>
    </asp:MultiView>

</asp:Content>
