<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="DocumentHistory.aspx.vb" Inherits="FinIQWebApp.DocumentHistory" MasterPageFile="~/FiniqAppMasterPage.Master" EnableEventValidation="false" EnableViewState="true" ViewStateEncryptionMode="Always" ValidateRequest="false" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="MainContent">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <script>
                function allowOnlyNumber(evt) {
                    var charCode = (evt.which) ? evt.which : event.keyCode
                    if (charCode > 31 && (charCode < 48 || charCode > 57))
                        return false;
                    return true;
                }
            </script>
            <script src="../FinIQJS/SortFilter_Grid.js"></script>
			<%--  FINNELPINT-286|| Header Freezing changes by ShraddhaD || 12-Aug-2020 --%>
            <script src="../FinIQJS/FreezeGrid.js"></script>
            <link href="../FinIQJS/FreezeGrid.css" rel="stylesheet" type="text/css"/>
            <table style="width: 90%;">
                <tr>
                    <td></td>
                </tr>
                <tr>
                    <td>
                         <asp:Label ID="lblSuccessMessge" runat="server" ForeColor="Green"></asp:Label>
                        <asp:Label ID="lblErrorMessage" runat="server" ForeColor="Red" ></asp:Label>
                        <asp:Label ID="lblWarningMessage" runat="server" ForeColor="Blue"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Panel ID="Pnlone" runat="server" Height="40px" BorderColor="LightGray" BorderWidth="1px" Width="100%" BorderStyle="None" >

                            <table style="margin-top: 2px; margin-bottom: 2px;">

                                <tr>
                                    <td>
                                        <asp:Label ID="lblSearch" runat="server" Text="Search" CssClass="lbl"></asp:Label></td>
                                    <td colspan="2" style="padding-left:10px;">
                                        <asp:TextBox ID="txtSearch" runat="server" AutoPostBack="true" Width="200px" CssClass="txt" AutoComplete="off"></asp:TextBox></td>
                                    <td colspan="3" style="padding-left:10px;">
                                        <asp:Button ID="btnLoad" runat="server" Text="Load" Width="100px" CssClass="btn" AutoPostBack="true" OnClick="btnLoad_click" />
                                    </td>
                                    <td style="padding-left:10px; vertical-align:middle;">
                                        <asp:CheckBox ID="ChkShowAllColumns" runat="server" Text="Detailed View" AutoPostBack="true" CssClass="lbl" />
                                    </td>
                                    <td style="padding-left:10px;">
                                        <asp:Label runat="server" ID="lblPageSize" CssClass="lbl" Text="Record(s) per page"></asp:Label>
                                    </td>
                                    <td><%--  FINNELPINT-286|| Removed Textmode || ShraddhaD || 12-Aug-2020 --%>
                                        <asp:TextBox ID="txtRecordCount"  runat="server" CssClass="txt" style="text-align:right" Height="20px" AutoPostBack="True" onkeypress="return allowOnlyNumber(event);" MaxLength="3" Width="40px" Text="99"  ></asp:TextBox>
                                    </td>
                                </tr>

                            </table>
                        </asp:Panel>
                    </td>
                </tr>

                <tr>
                    <td>
                      <%--  <asp:Panel ID="pnlTwo" runat="server" GroupingText="Show Document History" >--%>
                            <asp:GridView ID="grdHistory" runat="server" ShowHeaderWhenEmpty="true" EmptyDataText="No Records Found" AutoGenerateColumns="False" CssClass="Grid" AllowPaging="true" PageSize="20" OnRowDataBound="grdHistory_RowDataBound">
                                 <SelectedRowStyle CssClass="GridItemSelect" />
                                <RowStyle CssClass="GridItem" />
                                <HeaderStyle CssClass="GridHeader" />
                                <FooterStyle CssClass="GridFooter" />
								<%--  FINNELPINT-286|| Added pagersettings for paging || ShraddhaD || 12-Aug-2020 --%>
								<PagerSettings Mode="NumericFirstLast"
                                    FirstPageText="First"
                                    LastPageText="Last"
                                    Position="Bottom" />
                                 <PagerStyle CssClass="GridPager" /> 
                                <Columns>
                                    <asp:TemplateField HeaderText="Sr No" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" Visible="false">
                                        <HeaderStyle Width="50" CssClass="pinned" />
                                        <ItemStyle Width="50" CssClass="pinned" />
                                        <ItemTemplate>
                                            <asp:Label ID="LblSrNo" Width="50px" runat="server" Text='<%# Eval("SrNo")%>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="View" ItemStyle-HorizontalAlign="Center">
                                        <HeaderStyle Width="40" />
                                        <ItemStyle Width="40" />
                                        <ItemTemplate>
                                             <asp:LinkButton ID="btnViewDocument" CommandName="ViwedGeneratedDoc" runat="server"  
                                                                 CommandArgument='<%# CType(Container, GridViewRow).RowIndex%>'  
                                                                 Text='View Template' CausesValidation="False" ItemStyle-HorizontalAlign="Center" 
                                                                  Width="40">View</asp:LinkButton>                                            
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Primary Transaction Number" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle">
                                        <HeaderStyle Width="80" />
                                        <ItemStyle Width="80" HorizontalAlign ="Left"/>
                                        <ItemTemplate>
                                            <asp:Label ID="LblPrimaryTransactionNo" Width="80px" runat="server" Text='<%# Eval("PrimaryTransactionNo")%>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>


                                    <asp:TemplateField HeaderText="Entity Name" ItemStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Middle">
                                        <HeaderStyle Width="80" />
                                        <ItemStyle Width="80" />
                                        <ItemTemplate>
                                            <div style="word-break: break-word">
                                                <asp:Label ID="LblEntityName" Width="80" runat="server" Text='<%# Eval("EntityName")%>'></asp:Label>
                                            </div>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Template Name" ItemStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Middle">
                                        <HeaderStyle Width="80" />
                                        <ItemStyle Width="80" />
                                        <ItemTemplate>
                                            <div style="word-break: break-word">
                                                <asp:Label ID="LblTemplateName" Width="80" runat="server" Text='<%# Eval("TemplateName")%>'></asp:Label>
                                            </div>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Product Name" ItemStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Middle">
                                        <HeaderStyle Width="80" />
                                        <ItemStyle Width="80" />
                                        <ItemTemplate>
                                            <div style="word-break: break-word">
                                                <asp:Label ID="LblProductName" Width="80" runat="server" Text='<%# Eval("ProductName")%>'></asp:Label>
                                            </div>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Event Code" ItemStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Middle">
                                        <HeaderStyle Width="80" />
                                        <ItemStyle Width="80" />
                                        <ItemTemplate>
                                            <div style="word-break: break-word">
                                                <asp:Label ID="LblEventCode" Width="80" runat="server" Text='<%# Eval("EventCode")%>'></asp:Label>
                                            </div>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Transaction Type" ItemStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Middle">
                                        <HeaderStyle Width="40" />
                                        <ItemStyle Width="40" />
                                        <ItemTemplate>
                                            <asp:Label ID="LblTransactiontype" Width="40px" runat="server" Text='<%# Eval("Transactiontype")%>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Attached/ Generated" ItemStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Middle">
                                        <HeaderStyle Width="50" />
                                        <ItemStyle Width="50" />
                                        <ItemTemplate>
                                            <asp:Label ID="LblAttachedOrGenerated" Width="50px" runat="server" Text='<%# Eval("AttachedOrGenerated")%>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Attached/Generated Document Output Path" ItemStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Middle">
                                        <HeaderStyle Width="100" />
                                        <ItemStyle Width="100" />
                                        <ItemTemplate>
                                            <div style="word-break: break-all">
                                                <asp:Label ID="LblDocumentOutputPath" Width="100px" runat="server" Text='<%# Eval("DocumentOutputPath")%>'></asp:Label>
                                            </div>
                                        </ItemTemplate>
                                    </asp:TemplateField>
									<%--  FINNELPINT-278|| Alignment Changes made by ShraddhaD || 12-Aug-2020 --%>
                                    <asp:TemplateField HeaderText="GeneratedBy/ AttachedBy" ItemStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Middle">
                                        <HeaderStyle Width="80" />
                                        <ItemStyle Width="80" />
                                        <ItemTemplate>
                                            <asp:Label ID="LblGeneratedOrAttachedby" Width="80px" runat="server" Text='<%# Eval("GeneratedOrAttachedby")%>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
									<%--  FINNELPINT-286|| Changed width by ShraddhaD || 12-Aug-2020 --%>
                                    <asp:TemplateField HeaderText="GeneratedAt/ AttachedAt" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle">
                                        <HeaderStyle Width="100" />
                                        <ItemStyle Width="100" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:Label ID="LblGeneratedOrAttachedAt" Width="100px" runat="server" Text='<%# Eval("GeneratedOrAttachedAt","{0:dd-MMM-yyyy HH:mm:ss}")%>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>


                                    


                                    <asp:TemplateField HeaderText="Generated Document Location" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" Visible="false">
                                        <HeaderStyle Width="100" />
                                        <ItemStyle Width="100" />
                                        <ItemTemplate>
                                            <div style="word-break: break-all">
                                                <asp:Label ID="LblGeneratedDocLocation" Width="100px" runat="server" Text='<%# Eval("GeneratedDocLocation")%>'></asp:Label>
                                            </div>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="GeneratedBy Application" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" Visible="false">
                                        <HeaderStyle Width="80" />
                                        <ItemStyle Width="80" />
                                        <ItemTemplate>
                                            <div style="word-break: break-all">
                                                <asp:Label ID="LblDGT_GeneratedByApplication" Width="80px" runat="server" Text='<%# Eval("DGT_GeneratedByApplication")%>'></asp:Label>
                                            </div>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Generation System" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" Visible="false">
                                        <HeaderStyle Width="100" />
                                        <ItemStyle Width="100" />
                                        <ItemTemplate>
                                            <div style="word-break: break-all">
                                                <asp:Label ID="LblDocumentGenerationSystem" Width="100px" runat="server" Text='<%# Eval("DocumentGenerationSystem")%>'></asp:Label>
                                            </div>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Secondary Transaction Number" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" Visible="false">
                                        <HeaderStyle Width="50" />
                                        <ItemStyle Width="50" />
                                        <ItemTemplate>
                                            <div style="word-break: break-all">
                                                <asp:Label ID="LblSecondaryTransactionNo" Width="50px" runat="server" Text='<%# Eval("SecondaryTransactionNo")%>'></asp:Label>
                                            </div>
                                        </ItemTemplate>
                                    </asp:TemplateField>


                                    <asp:TemplateField HeaderText="Tertiary Transaction Number" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" Visible="false">
                                        <HeaderStyle Width="50" />
                                        <ItemStyle Width="50" />
                                        <ItemTemplate>
                                            <div style="word-break: break-all">
                                                <asp:Label ID="LblTertiaryTransactionNo" Width="50px" runat="server" Text='<%# Eval("TertiaryTransactionNo")%>'></asp:Label>
                                            </div>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Generated Document Id" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" Visible="false">
                                        <HeaderStyle Width="40" />
                                        <ItemStyle Width="40" />
                                        <ItemTemplate>
                                            <div style="word-break: break-all">
                                                <asp:Label ID="LblDGT_Id" Width="40px" runat="server" Text='<%# Eval("DGT_Id")%>'></asp:Label>
                                            </div>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        <%--</asp:Panel>--%>
						
                    </td>
                </tr>                
            </table>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger  ControlID="grdHistory"  />
            <asp:AsyncPostBackTrigger ControlID="btnLoad" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>

