<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="EmailMonitor.aspx.vb" Inherits="FinIQWebApp.EmailMonitor" MasterPageFile="~/FiniqAppMasterPage.Master" %>

<%@ Register Src="../FinIQ_User_Controls/DateControl.ascx" TagName="DateControl" TagPrefix="uc1" %>

<%-- INT1FIN47-369 || 03Feb2022 || Email Monitor page to be added in 1FinIQ (from SCB FXD) || asked by Sandip B. Sir --%>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <style>
        .Hiddenpanel {
            display: none;
        }
    </style>
    <asp:UpdatePanel ID="UpdatepanelMain" runat="server" UpdateMode="Always">
        <ContentTemplate>
            <table>
                <tr>
                    <td style="height: 5px;"></td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblError" runat="server" CssClass="lblerror" Style="margin-top: 10px"></asp:Label>
                        <asp:Label ID="lblInfo" runat="server" CssClass="lblinfo" Style="margin-top: 10px"></asp:Label>
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td style="height: 5px;"></td>
                </tr>
                <tr>
                    <td class="lblBlotterPaddingRight">
                        <asp:Label ID="lblEntityId" runat="server" Text="<%$ Resources:LocalizedText, Entity %>" CssClass="lbl"></asp:Label>
                    </td>
                    <td class="ctlBlotterPaddingRight">
                        <asp:DropDownList ID="ddlentity" runat="server" CssClass="ddl " Width="200px" TabIndex="1"></asp:DropDownList>
                    </td>
                    <td class="lblBlotterPaddingRight">
                        <asp:Label ID="lblTemplate" runat="server" Text="Template" CssClass="lbl"></asp:Label>
                    </td>
                    <td class="ctlBlotterPaddingRight">
                        <asp:DropDownList ID="ddlTemplate" runat="server" CssClass="ddl " Width="200px" TabIndex="2"></asp:DropDownList>
                    </td>

                    <td class="lblBlotterPaddingRight">
                        <asp:Label ID="fromDate" runat="server" CssClass="lbl" Text="From Date"></asp:Label>
                    </td>
                    <td class="ctlBlotterPaddingRight">
                        <uc1:DateControl ID="dtFromDate" runat="server" CalenderCss="btn1" />
                    </td>

                    <td class="ctlBlotterPaddingRight">
                        <asp:Button ID="btnLoad" runat="server" CssClass="btn" Text="Load" Width="80px" TabIndex="4" />
                    </td>
                    <td class="lblBlotterPaddingRight">
                        <asp:Label ID="clrGreen" runat="server" BackColor="#006600" Height="15" Width="15"></asp:Label>
                        <asp:Label ID="lblGreen" runat="server" Text="Email Sent Successfully" Style="vertical-align: top"></asp:Label>
                    </td>
                    <td class="lblBlotterPaddingRight">
                        <asp:Label ID="clrBlue" runat="server" BackColor="#03396c" Height="15" Width="15"></asp:Label>
                        <asp:Label ID="lblBlue" runat="server" Text="Email Not Sent Yet" Style="vertical-align: top"></asp:Label>
                    </td>
                    <td class="lblBlotterPaddingRight">
                        <asp:Label ID="clrRed" runat="server" BackColor="#ce0000" Height="15" Width="15"></asp:Label>
                        <asp:Label ID="lblRed" runat="server" Text="Email Not Sent" Style="vertical-align: top"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="lblBlotterPaddingRight">
                        <asp:Label ID="lblEmail" runat="server" Text="Email Status" CssClass="lbl"></asp:Label>
                    </td>
                    <td class="ctlBlotterPaddingRight">
                        <asp:DropDownList ID="ddlEmail" runat="server" CssClass="ddl " Width="200px" TabIndex="2">
                            <asp:ListItem Text="All" Value="All"></asp:ListItem>
                            <asp:ListItem Text="Deactivated" Value="Deactivated"></asp:ListItem>
                            <asp:ListItem Text="Sent" Value="send"></asp:ListItem>
                            <asp:ListItem Text="Not sent" Value="Not send"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td class="lblBlotterPaddingRight">
                        <asp:Label ID="lblEvent" runat="server" Text="Event" CssClass="lbl"></asp:Label>
                    </td>
                    <td class="ctlBlotterPaddingRight">
                        <asp:DropDownList ID="ddlEvent" runat="server" CssClass="ddl " Width="200px" TabIndex="2"></asp:DropDownList>
                    </td>
                    <td class="lblBlotterPaddingRight">
                        <asp:Label ID="toDate" runat="server" CssClass="lbl" Text="To Date"></asp:Label>
                    </td>
                    <td class="ctlBlotterPaddingRight">
                        <uc1:DateControl ID="dtToDate" runat="server" CalenderCss="btn1" />
                    </td>
                    <td class="ctlBlotterPaddingRight">
                        <asp:Button ID="btnResend" runat="server" CssClass="btn" Text="Resend" Width="80px" TabIndex="4" />
                    </td>
                    <td class="lblBlotterPaddingRight">
                        <asp:Label ID="lblTotalRecords" runat="server" CssClass="lbl" Text="Total Record(s) "></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <asp:Label ID="txtTotalRecords" runat="server" CssClass="lbl"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="labelsearch" runat="server" CssClass="lbl" Text="Deal Ref"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtsearch" runat="server" Width="188px"></asp:TextBox>
                        <asp:Button ID="btnSearch" class="btnSearch" style="float: right; margin-right: 20px !important;" runat="server"></asp:Button>
                    </td>
                    <td class="lblBlotterPaddingRight">
                        <asp:CheckBox ID="chkRefresh" runat="server" AutoPostBack="True" />
                        <%--</td>
                    <td class="lblBlotterPaddingRight">--%>
                        <asp:Label ID="lblAutoRefresh" CssClass="lbl" runat="server" Text="Auto Refresh "></asp:Label>
                    </td>
                    <td class="ctlBlotterPaddingRight">
                        <asp:TextBox ID="txtRefreshTime" CssClass="txt" runat="server" AutoPostBack="True" Width="30px" Style="text-align: center" Text="10" MaxLength="3" onkeypress="return isNumberKey(event)"></asp:TextBox>
                        <asp:Label ID="lblSec" CssClass="lbl" runat="server" Text="Sec"></asp:Label>
                    </td>
                    <td></td>
                    <td></td>
                    <td >
                        <asp:Button ID="btnDeactivate" runat="server" CssClass="btn" Text="Deactivate" Width="80px" TabIndex="4" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Panel ID="Panel3" runat="server" Width="290px" GroupingText="Auto Refresh" CssClass="lbl Hiddenpanel">
                            <asp:Label ID="Label2" runat="server" Text="In sec "></asp:Label>
                            <asp:TextBox ID="TextBox1" runat="server" Width="150px" Text="100" Style="text-align: right"
                                onkeydown="return AutoRefereshOnEnter(event)"></asp:TextBox>
                            <asp:Timer ID="Timer1" runat="server" Enabled="FALSE" Interval="100" OnTick="Timer1_Tick">
                            </asp:Timer>
                        </asp:Panel>
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td style="margin-top: 20px"></td>
                </tr>
                <tr>
                    <td>
                        <asp:GridView ID="grdEmailMonitor" runat="server" AllowSorting="True" AutoGenerateColumns="False" CssClass="Grid" AllowPaging="true" PageSize="15" ShowHeaderWhenEmpty="true"
                            EmptyDataText="No data found" RowStyle-Wrap="false" HeaderStyle-Wrap="false">
                            <SelectedRowStyle CssClass="GridItemSelect" />
                            <RowStyle CssClass="GridItem" />
                            <HeaderStyle CssClass="GridHeader" HorizontalAlign="Center" />
                            <FooterStyle CssClass="GridFooter" />
                            <PagerStyle CssClass="GridPager" />
                            <Columns>
                                <asp:TemplateField HeaderText="" HeaderStyle-Font-Bold="false" Visible="True">
                                    <HeaderStyle Font-Bold="False" HorizontalAlign="Center" VerticalAlign="Middle" Width="50" />
                                    <HeaderTemplate>
                                        <asp:CheckBox ID="chkAll" runat="server" AutoPostBack="True" OnCheckedChanged="chkAll_Changed" />
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chk" runat="server" AutoPostBack="True" OnCheckedChanged="chk_Changed" />
                                    </ItemTemplate>
                                    <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle" Width="50" />
                                </asp:TemplateField>

                                <%--<asp:TemplateField HeaderText="ID" Visible="false">
                                    <ItemTemplate>
                                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("ENS_ID")%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>--%>

                                <asp:BoundField HeaderText="ID" DataField="ENS_ID" ItemStyle-HorizontalAlign="center"></asp:BoundField>

                                <asp:BoundField HeaderText=" Deal No." DataField="ENS_Deal_Ref" ItemStyle-HorizontalAlign="right"></asp:BoundField>

                                <%--<asp:BoundField HeaderText="Entity Name" DataField="Entity_Name" ItemStyle-HorizontalAlign="left"></asp:BoundField>

                                <asp:BoundField HeaderText="Template Name" DataField="Template_Name" ItemStyle-HorizontalAlign="left"></asp:BoundField>--%>

                                <asp:BoundField HeaderText=" Action Name" DataField="ENS_Action_Name" ItemStyle-HorizontalAlign="left"></asp:BoundField>

                                <%--<asp:BoundField HeaderText="Email Send" DataField="Email_Send" ItemStyle-HorizontalAlign="Center"></asp:BoundField>--%>

                                <asp:BoundField HeaderText="Docgen Status" DataField="Docgen_Status" ItemStyle-HorizontalAlign="Left"></asp:BoundField>

                                <asp:BoundField HeaderText="Active Y/N" DataField="Email_Active_YN" ItemStyle-HorizontalAlign="center"></asp:BoundField>

                                <asp:BoundField HeaderText=" Email Status" DataField="Email_Status" ItemStyle-HorizontalAlign="left"></asp:BoundField>

                                <asp:BoundField HeaderText="Email Retry Count" DataField="ENS_Misc3" Visible="true"></asp:BoundField>

                                <%--<asp:BoundField HeaderText="TO Email" DataField="TO_Email"></asp:BoundField>

                                <asp:BoundField HeaderText="CC Email" DataField="CC_Email"></asp:BoundField>--%>

                                 <asp:BoundField HeaderText="Email Generated By" DataField="ENS_Action_Done_by" ItemStyle-HorizontalAlign="left"></asp:BoundField>
                                
                                <asp:BoundField HeaderText="Email Generated At" DataField="ENS_Action_Done_At" ItemStyle-HorizontalAlign="center" DataFormatString="{0:dd-MMM-yyyy hh:mm tt}" HtmlEncode="false"></asp:BoundField>

                                <asp:BoundField HeaderText="Email Sent By" DataField="ENS_Processed_by" ItemStyle-HorizontalAlign="left"></asp:BoundField>

                                <asp:BoundField HeaderText="Email Sent At" DataField="ENS_Processed_At" DataFormatString="{0:dd-MMM-yyyy hh:mm tt}" HtmlEncode="false" ItemStyle-HorizontalAlign="center"></asp:BoundField>

                                 <%--<asp:BoundField HeaderText="Date" DataField="ED_Date" DataFormatString="{0:dd-MMM-yyyy hh:mm tt}" HtmlEncode="false" ItemStyle-HorizontalAlign="left"></asp:BoundField>

                                <asp:BoundField HeaderText="Failure Reasons" DataField="ED_FailureReasons"></asp:BoundField>--%>

                                
                                <asp:BoundField HeaderText="ED Template ID" DataField="Template_ID" Visible="false"></asp:BoundField>
                                <asp:BoundField HeaderText="Entity Id" DataField="entity_id" Visible="false"></asp:BoundField>
                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>


