<%@ page language="C#" masterpagefile="~/MasterFile/TimeCheck.master" autoeventwireup="true" inherits="Masters_TA_UI_Master_groupView, App_Web_1ifqpvnn" %>

<%@ Register TagPrefix="dxgridview" Namespace="DevExpress.Web" Assembly="DevExpress.Web.v14.2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="Server">
    <div class="content-header">
        <h1 style="background-image: url(../dist/img/user-group-Icon.png); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lbl_HeaderUserGroups" runat="server"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">
        <div class="inr-ftr">
            <div class="row">
                <div class="col-sm-2">
                    <div class="inr-fil-text">
                        <asp:Label ID="lblFilter" runat="server" Text="Filter"></asp:Label>
                    </div>
                </div>
            </div>
        </div>
        <div class="Usergrp-filter">
            <div class="row">
                <div class="col-md-3">
                    <asp:Label ID="lbl_GroupName" Text="Group Name" runat="server"></asp:Label>
                </div>
                <div class="col-md-3 form-group">
                    <asp:TextBox onpaste="return true" ID="txt_GroupName" runat="server" CssClass="form-control"
                        Style="margin-bottom: 15px" MaxLength="40" onkeypress="return acceptCharsNumAmpUnder_MaxLength(event,this,40,MaxLength);"></asp:TextBox>
                </div>
                <div class="col-md-6" align="left">
                    <asp:LinkButton ID="btn_Search" Text="Search" CssClass="btn save-btn fa-search" runat="server"
                        OnClick="btn_Search_Click" />
                    <asp:LinkButton ID="btn_Clear" Text="Clear" CssClass="btn save-btn fa-refresh" runat="server"
                        OnClick="btn_Clear_Click" />
                    <asp:LinkButton ID="btn_add" CssClass="btn save-btn fa-plus" runat="server" OnClick="btn_add_Click" />
                </div>
            </div>
        </div>
        <div class="border-table new-space" style="margin-top: 0px !important">
            <div class="row">
                <div class="col-md-12">
                    <dxgridview:ASPxGridView ID="grdViewUserGroup" EnableCallBacks="false" runat="server"
                        ClientInstanceName="grdViewUserGroup" OnHtmlRowCreated="grdViewUserGroup_HtmlRowCreated"
                        AutoGenerateColumns="false" Width="100%" KeyFieldName="groupId">
                        <Columns>
                            <dxgridview:GridViewDataTextColumn FieldName="groupName" VisibleIndex="0" Caption="Group Name" Width="50%">
                                <Settings AllowGroup="false" />
                                <DataItemTemplate>
                                    <a style="text-decoration: underline !important" href="TA_UI_Master_groupEdit.aspx?gNa=<%# Eval("groupName") %>&gid=<%# Eval("groupId") %>&sid=<%=Session.SessionID %>&IndUsers=<%# Eval("IndividualUsers") %>&hasSpecialRights=<%# Eval("hasSpecialRights") %>&ReportsBasedOn=<%# Eval("ReportsBasedOn") %>&AllowLeaveApprovalPastEntry=<%# Eval("AllowLeaveApprovalPastEntry") %>">
                                        <asp:Label ID="lblHId" Style="font-family: robotoregular"
                                            Text='<%# Eval("groupName") %>' runat="server"></asp:Label>
                                    </a>
                                    <asp:Label ID="lblID" runat="server" Text='<%# Eval("groupId") %>' Visible="false"></asp:Label>
                                </DataItemTemplate>
                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                            </dxgridview:GridViewDataTextColumn>
                            <dxgridview:GridViewDataColumn HeaderStyle-VerticalAlign="Middle" HeaderStyle-HorizontalAlign="Center"
                                CellStyle-VerticalAlign="Middle" CellStyle-HorizontalAlign="Left" VisibleIndex="1" Width="50%">
                                <Settings AllowAutoFilter="false" />
                                <DataItemTemplate>
                                    <a style="text-decoration: underline !important" href="TA_UI_Master_LevelRights.aspx?gNa=<%# Eval("groupName") %>&gid=<%# Eval("groupId") %>&sid=<%=Session.SessionID %>">
                                        <asp:Label ID="lblEditLevel" runat="server"></asp:Label>
                                    </a>
                                    &nbsp;/&nbsp; 
                                        <a style="text-decoration: underline !important" href="TA_UI_Master_UserGroups_AddRights.aspx?gNa=<%# Eval("groupName") %>&gid=<%# Eval("groupId") %>&sid=<%=Session.SessionID %>">
                                            <asp:Label ID="lblEdit" runat="server"></asp:Label>
                                        </a>
                                    &nbsp;/&nbsp; 
                                    <a style="text-decoration: underline !important" href="TA_UI_Master_DashboardRights.aspx?gNa=<%# Eval("groupName") %>&gid=<%# Eval("groupId") %>&sid=<%=Session.SessionID %>&frm=dash">
                                        <asp:Label ID="lblDashboard" runat="server"></asp:Label>
                                    </a>
                                    <%--&nbsp;/&nbsp;--%>
                                    <%--<a href="TA_UI_Master_DashboardRights.aspx?gNa=<%# Eval("groupName") %>&gid=<%# Eval("groupId") %>&sid=<%=Session.SessionID %>>&frm=Assign">
                                            <asp:Label ID="lblAssignedText" runat="server"></asp:Label>
                                            <asp:Label ID="lblAssignedCount" Text='<%# Eval("Total") %>' runat="server"></asp:Label>
                                        </a>&nbsp;--%>
                                    <asp:Label ID="lblSep" runat="server"></asp:Label>
                                    &nbsp; 
                                        <a style="text-decoration: underline !important" href="TA_UI_Master_usergroups_del.aspx?gNa=<%# Eval("groupName") %>&gid=<%# Eval("groupId") %>&sid=<%=Session.SessionID %>"
                                            onclick="return confirm(SureToDelete)">
                                            <asp:Label ID="lblDele" runat="server"></asp:Label>
                                        </a>
                                </DataItemTemplate>
                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                            </dxgridview:GridViewDataColumn>
                        </Columns>
                        <SettingsPager PageSize="15">
                            <PageSizeItemSettings Visible="true" ShowAllItem="true" Items="10,20,50,100" />
                        </SettingsPager>
                        <Settings ShowFilterRow="true" ShowFilterRowMenu="true" HorizontalScrollBarMode="Auto" VerticalScrollBarMode="Hidden" VerticalScrollableHeight="400" />
                        <SettingsText EmptyDataRow="No Records Found" />
                        <SettingsBehavior AutoExpandAllGroups="True" ColumnResizeMode="Control" />
                        <SettingsBehavior AllowDragDrop="false" />
                    </dxgridview:ASPxGridView>
                    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="selectUserGroup"
                        TypeName="userRightsEventData">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="txt_GroupName" PropertyName="Text" Type="string"
                                Name="GroupName" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var MaxLength = "Maximum length is ";
        var SureToDelete = "Are you Sure to Delete?";
        function MaxLengthh(maxLength, sureToDelete) {
            MaxLength = maxLength;
            SureToDelete = sureToDelete;
        }
    </script>
</asp:Content>
