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

<%@ Import Namespace="Microsoft.Security.Application" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="MainContent">

    <script lang="javascript" type="text/javascript">

        //        function CheckOpt() {

        //            var mUserChecked = window.Form1.optUser.checked;
        //            var mGroupChecked = window.Form1.optGroup.checked;

        //            if (mUserChecked == true) {
        //                document.getElementById("rptLogIn").Disabled = False;
        //            }

        //            if (mGroupChecked == true) {
        //                document.getElementById("cboGroup").style.visibility = "visible";
        //                document.getElementById("rptLogIn").Disabled = True;
        //            }
        //        }
        //        function CheckOptUser() {
        //            document.getElementById("rptLogIn").Disabled = False;
        //        }

        //        function CheckOptGroup() {
        //            document.getElementById("rptLogIn").style.visibility = "hidden";
        //            document.getElementById("rptLogIn").Disabled = True;
        //        }

        function checkAll() {
            for (i = 0; i < document.forms[0].elements.length; i++) {
                elm = document.forms[0].elements[i]

                if (elm.type == 'checkbox') {
                    if (document.getElementById("chk_all").checked == true)
                        elm.checked = true;
                    else
                        elm.checked = false;
                }
            }
        }

        //function disableItem() {
        //    if (document.getElementById('ddlGroupUser').value = 'Group') {
        //        var selectedItem = document.getElementById('LstLoginID');
        //        var index = selectedItem.selectedIndex;
        //        index.disable();

        //        return false;
        //    }
        //}
        //<Added by Suraj Jaigude || 11-Apr-2020 || RHBUPINT-554 || search work on enter/tab out>
        function EnterKeyOnSearch(evt) {
            var code = (evt.which) ? evt.which : evt.keyCode;

            if (code == 13 || code == 9) {
                document.getElementById('<%=BtnLoad.ClientID%>').click();
            }
        }
        //</Added by Suraj Jaigude || 11-Apr-2020 || RHBUPINT-554 || search work on enter/tab out>
    </script>
    <style type="text/css">
        .Grid {
           table-layout: fixed;
       }     
       .Grid th, .Grid td {
         
             word-wrap:break-word;
       }
       /* <START> Commented by Suraj J || 18-Feb-2021 || Removed hard codes td width and adding padding class */
        /*.tdOne {
            width: 110px;
        }

        .tdTwo {
            width: 60px;
        }

        .tdThree {
            width: 156px;
        }

        .tdFour {
            width: 186px;
        }

        .tdSix {
            width: 100px;
        }

        .tdSeven {
            width: 50px;
        }

        .tdThirteen {
            width: 80px;
        }*/
        /* <END> Commented by Suraj J || 18-Feb-2021 || Removed hard codes td width and adding padding class */

		 .NewApplicationAccess {
             background-color: White !important;
        }
        .AccessGranted {
            background-color: LightGreen !important;
        }
        .AccessGrantPending {
            background-color: LightBlue !important;
        }
        .RevokePending {
             background-color: Pink !important;
        }
        .lblBlotterPaddingRight {
            padding-right: 10px !important;
        }
        .ctlBlotterPaddingRight {
            padding-right: 20px !important;
        }
    </style>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table class="" width="100%">
                <tr>
                    <td>
                        <table class="" width="100%">
                            <%-- <tr>
                                <td nowrap="nowrap" class="background_gray">
                                    Application Access
                                </td>
                            </tr>--%>
                            <tr>
                                <td>
                                    <asp:Label ID="LblError" runat="server" CssClass="lblerror"></asp:Label>
                                    <asp:Label ID="lblSuccess" runat="server" CssClass="lblSuccess" ></asp:Label>
                                    <asp:Label ID="lblInfo" runat="server" CssClass="lblInfo" ></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <table class="" width="100%">
                                        <tr>
                                            <td>
                                                <table>
                                                    <tr>
                                                        <td class="ctlBlotterPaddingRight">
                                                            <%--  <asp:RadioButtonList ID="rblappaccess" runat="server" AutoPostBack="True" CssClass="RadioBtn"
                                                                RepeatColumns="2" Enabled="false">
                                                                <asp:ListItem Value="User">User</asp:ListItem>
                                                                <asp:ListItem Value="Group"  Selected="True">Group</asp:ListItem>
                                                            </asp:RadioButtonList>--%>
                                                            <asp:DropDownList ID="ddlGroupUser" runat="server" AutoPostBack="true" Width="80px" CssClass="ddl">
                                                                <asp:ListItem Text="Group" Value="Group"></asp:ListItem>
                                                                <asp:ListItem Text="User" Value="User"></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </td>
                                                        <td class="lblBlotterPaddingRight">
                                                            <asp:Label ID="lblFilter" runat="server" Text="Search On" CssClass="lbl"></asp:Label>
                                                        </td>
                                                        <td class="lblBlotterPaddingRight">
                                                            <asp:DropDownList ID="ddlList" runat="server" Width="150px" AutoPostBack="true"  CssClass="ddl">
                                                                <asp:ListItem Text="ALL" Value="ALL" Selected="True"></asp:ListItem>
                                                                <asp:ListItem Text="Application ID" Value="Application ID"></asp:ListItem>
                                                                <asp:ListItem Text="Application Name" Value="Application Name"></asp:ListItem>
                                                                <asp:ListItem Text="Tab Name" Value="Tab Name"></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </td>
                                                        <td class="lblBlotterPaddingRight">
                                                            <asp:TextBox ID="txtFilter" runat="server" CssClass="txt" Width="184px" onkeydown="EnterKeyOnSearch(event)"></asp:TextBox>
                                                        </td>
                                                        <td class="lblBlotterPaddingRight">
                                                            <asp:Button ID="BtnLoad" runat="server" CssClass="btn" Text=" Find "  Width="70px" />
                                                        </td>
                                                        <td class="ctlBlotterPaddingRight">
                                                            <asp:Button ID="BtnExport" runat="server" Visible="true" CssClass="btnExcel" Text="" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="TxtGranted" runat="server" BackColor="LightGreen" ReadOnly="true"
                                                                 Width="20px" Height="20px" CssClass="txt"></asp:TextBox>
                                                        </td>
                                                        <td class="lblBlotterPaddingRight">
                                                            <asp:Label ID="LblGranted" runat="server" CssClass="lbl" Text="Granted"></asp:Label>
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="TxtRevoked" runat="server"  Width="20px" Height="20px" BackColor="Pink" ReadOnly="true"
                                                                CssClass="txt"></asp:TextBox>
                                                        </td>
                                                        <td class="lblBlotterPaddingRight">
                                                            <asp:Label ID="LblRevoked" runat="server" Text="Revoked" CssClass="lbl"></asp:Label>
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="TxtPending" runat="server" Width="20px" Height="20px" BackColor="LightBlue" ReadOnly="true"
                                                                CssClass="txt"></asp:TextBox>
                                                        </td>
                                                        <td class="lblBlotterPaddingRight">
                                                            <asp:Label ID="LblPending" runat="server" Text="Pending" CssClass="lbl"></asp:Label>
                                                        </td>
                                                      <td>
                                                            <asp:Label ID="LblName" runat="server" CssClass="lbl">Name : </asp:Label><asp:Label
                                                                ID="LblNameValue" runat="server" CssClass="lbl"></asp:Label>
                                                        </td>
                                                          <%--<td>
                                                            <asp:Label ID="lblSpace" Text="     " runat="server"></asp:Label>
                                                        </td>--%>
                                                        <td class="lblBlotterPaddingRight">
                                                            <asp:Label ID="LblApplicationSelCount" runat="server" CssClass="lbl" Text="Total Records : "></asp:Label>
                                                        </td>
                                                        <td>
                                                            <asp:Label ID="LblAppselcountvalue" runat="server" CssClass="lbl"></asp:Label>
                                                        </td>


                                                    </tr>
                                                    <tr>
                                                        <td></td>
                                                        <td class="lblBlotterPaddingRight">
                                                            <asp:Label ID="LblGroup" runat="server" Text="Group" CssClass="lbl"></asp:Label>
                                                        </td>
                                                        <td class="lblBlotterPaddingRight">
                                                            <asp:DropDownList ID="ddlGroup" runat="server" AutoPostBack="true" Width="150px" CssClass="ddl">
                                                            </asp:DropDownList>
                                                        </td>
                                                        <td class="lblBlotterPaddingRight">
                                                            <asp:DropDownList ID="ddlCase" runat="server" AutoPostBack="true" Width="184px" CssClass="ddl">
                                                                <asp:ListItem Text="Access Grant Pending" Value="Access Grant Pending"></asp:ListItem>
                                                                <asp:ListItem Text="Access Granted" Value="Access Granted"></asp:ListItem>
                                                                <asp:ListItem Text="New Application Access" Value="New Application Access" Selected="True"></asp:ListItem>
                                                                <asp:ListItem Text="Revoke Pending" Value="Revoke Pending"></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </td>

                                                        <td colspan="8">
                                                            <asp:Button ID="BtnUpdate" runat="server" CssClass="btn" Text="Update" Width="70px" />
                                                        </td>
                                                        
                                                    </tr>

                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table>
                            <tr class="">
                                <td valign="top">
                                    <asp:Label ID="LblLoginID" runat="server" Text="Login ID" CssClass="lbl"></asp:Label>
                                    <br /> 
                                    <asp:ListBox ID="LstLoginID" runat="server" Height="375px" Width="234px" CssClass="lst"
                                        AutoPostBack="true" Enabled="False"></asp:ListBox>
                                </td>
                                <td valign="top">
                                   <%-- <table width="100%">
                                        <tr>
                                            <td>--%>
                                     <br /> 
                                                <% Dim scrollPosURL As String = "ScrollPos.htc"%>
                                                <div style="behavior: url(<%= ResolveURL(scrollPosURL)%>); overflow:auto;height:760px;padding:5px;" class="filter"
                                                    scrollpos="<%= saveScrollPos.value %>" persistid="<%= saveScrollPos.UniqueID %>">
                                                    <asp:DataGrid ID="dtgAppliation" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                                                        CellPadding="3" CssClass="Grid" >
                                                        <SelectedItemStyle CssClass="GridItemSelect" />
                                                        <ItemStyle CssClass="GridItem" />
                                                        <HeaderStyle CssClass="GridHeader" />
                                                        <FooterStyle CssClass="GridFooter" />
                                                        <PagerStyle CssClass="GridPager" />
                                                        <Columns>
                                                            <asp:TemplateColumn>
                                                                <HeaderStyle HorizontalAlign="Center" />
                                                                <ItemStyle HorizontalAlign="Center" />
                                                                <HeaderTemplate>
                                                                    <input id="chk_all" onclick="checkAll()" type="checkbox"> </input>
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <asp:CheckBox ID="chk_AppId" runat="server" Checked='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.New_Application_Access"))%>' />
                                                                </ItemTemplate>
                                                            </asp:TemplateColumn>
                                                            <asp:BoundColumn HeaderText="Sr No." Visible="false" >
                                                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                                            </asp:BoundColumn>
                                                            <asp:BoundColumn DataField="AppMisc1" HeaderText="Tab Name" SortExpression="AppMisc1" ItemStyle-Width="120px">
                                                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                                <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />
                                                            </asp:BoundColumn>
                                                            <asp:BoundColumn DataField="ApplicationName" HeaderText="Application Name" SortExpression="ApplicationName" ItemStyle-Width="240px">
                                                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                                <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />
                                                            </asp:BoundColumn>
                                                            <asp:BoundColumn DataField="ApplicationID" HeaderText="Application  ID" SortExpression="ApplicationID" ItemStyle-Width="200px">
                                                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                                <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />
                                                            </asp:BoundColumn>
                                                            <asp:BoundColumn DataField="ApplicationPath" HeaderText="Application Path" SortExpression="ApplicationPath" ItemStyle-Width="280px">
                                                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                                <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />
                                                            </asp:BoundColumn>
                                                            <asp:BoundColumn DataField="RegistrationDate" HeaderText="Time Stamp"  Visible="true" ItemStyle-Width="160px"  SortExpression="RegistrationDate">
                                                              <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                                                </asp:BoundColumn>
                                                            <asp:BoundColumn DataField="AppDnetVersion" HeaderText="App Dnet Web Version" Visible="true" ItemStyle-Width="160px">
                                                                 <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                                                <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />
                                                                </asp:BoundColumn>
                                                            <%--      <asp:BoundColumn DataField="ApplicationAccess" HeaderText="Application_Access" Visible="False">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                                </asp:BoundColumn>
                                                <asp:BoundColumn DataField="NewApplicationAccess" HeaderText="New_Application_Access"
                                                    Visible="False"></asp:BoundColumn>--%>
                                                            <%--<asp:BoundColumn DataField="AppCount" HeaderText="AppCount" Visible="False"></asp:BoundColumn>--%>
                                                            <%--<asp:BoundColumn DataField="Createdby" HeaderText="Created By">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                    <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />
                                                </asp:BoundColumn>
                                              <asp:BoundColumn DataField="CreatedAt" HeaderText="Created At">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                                </asp:BoundColumn>
                                                <asp:BoundColumn DataField="Authorisedby" HeaderText="Authorised By">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                    <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />
                                                </asp:BoundColumn>
                                                <asp:BoundColumn DataField="AuthorisedAt" HeaderText="Authorised At">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                                </asp:BoundColumn>
                                                <asp:BoundColumn DataField="Revokedby" HeaderText="Revoked By">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                    <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />
                                                </asp:BoundColumn>
                                                <asp:BoundColumn DataField="RevokedAt" HeaderText="Revoked At">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                    <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />
                                                </asp:BoundColumn>
                                                <asp:BoundColumn DataField="RevokeAutby" HeaderText="RevokeAut By">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                    <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />
                                                </asp:BoundColumn>
                                                <asp:BoundColumn DataField="RevokeAuthAt" HeaderText="RevokeAuth At">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                    <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />
                                                </asp:BoundColumn>--%>
                                                        </Columns>
                                                        <PagerStyle CssClass="GridFooter" HorizontalAlign="Left" Mode="NumericPages" />
                                                    </asp:DataGrid>
                                                </div>
                                                <input id="saveScrollPos" type="hidden" name="saveScrollPos" runat="server" />
                                            <%--</td>
                                        </tr>
                                    </table>--%>

                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <asp:HiddenField ID="hdnUseMakerCheckerInLssApplication" runat="server" />
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="BtnExport" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
