<%@ page language="C#" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" autoeventwireup="true" inherits="CreateRole, App_Web_1jrlsqiq" uiculture="auto" meta:resourcekey="PageResource1" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="../../../UserControls/GridViewPager/GridViewPager.ascx" TagName="GridViewPager" TagPrefix="uc1" %>
<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl" TagPrefix="ScreenGroup" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="PageUpdatePanel" runat="server">
        <ContentTemplate>
            <div id="divContentPage" class="divcontentpagemargin">
                <!-- ContentPlaceHolder Box Starts -->

                <div class="dashBoardLeftCont" valign="top">
                    <div class="himssuHeader3WireBox">
                        <%--<div class="himsBoxHeader">
                                        <div class="leftdiv">
                                        </div>
                                        <div class="himsBoxTitle">
                                            <div class="headerText">
                                            <asp:Label runat="server" ID="ScreenGroupNameLabel"></asp:Label>    
                                            </div>
                                        </div>
                                    </div>--%>
                        <table width="0px" cellpadding="0" cellspacing="0">
                            <tr>
                                <td>
                                    <div class="himsBoxContent">
                                        <div class="leftUlMenu">
                                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="122"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="row whiteboxpaddingleft">
                    <div class="himssuHeader5WireBox card card-box" runat="server" id="SearchDiv">
                        <div class="himsBoxHeader card-head">
                            <asp:Panel ID="TopPanel" runat="server" meta:resourcekey="TopPanelResource1">
                                <div class="leftdiv">
                                </div>
                                <div class="himsBoxTitle">
                                    <%--<asp:Image ID="Image1" runat="server" class="fLeft" meta:resourcekey="Image1Resource1" />--%>
                                    <div class="headerText">
                                        <header>
                                            <i class="fas fa-search"></i>
                                            <asp:Label ID="Label1" runat="server" Text="Search" meta:resourcekey="Label1Resource1"></asp:Label>
                                        </header>
                                        <%--<cc1:CollapsiblePanelExtender ID="cpe" runat="server" TargetControlID="DetailPanel"
                                                        ExpandControlID="Image1" CollapseControlID="Image1" TextLabelID="Label1" Collapsed="True"
                                                        ImageControlID="Image1" ExpandedImage="~/images/buttonCollapse.gif" CollapsedImage="~/images/buttonExpand.gif"
                                                        Enabled="True" />--%>
                                    </div>
                                    <div class="fRight mt-27">
                                        <asp:Button ID="AddNewButtonID" runat="server" OnClick="AddNewButton_Click" SkinID="0" CssClass="btn btn-add fas" Text="&#xf067; Add" />
                                    </div>
                                </div>
                            </asp:Panel>
                        </div>
                        <asp:Panel ID="DetailPanel" runat="server" meta:resourcekey="DetailPanelResource1">
                            <div class="himsBoxContent card-body">
                                <div class="contentHolder">
                                    <asp:Panel ID="SearchCriteriaPanel" runat="server" meta:resourcekey="SearchCriteriaPanelResource1">
                                        <div class="outerBox pTop5 col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="UserNameLabel" runat="server" Text="Role" meta:resourcekey="UserNameLabelResource1"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <asp:TextBox ID="RoleSearchTextBox" runat="server" TabIndex="1" onmouseleave="showHideTooltip()"
                                                    onmouseenter="showHideTooltip()" SkinID="CustomWidthTextBox" meta:resourcekey="RoleSearchTextBoxResource1"></asp:TextBox>
                                            </div>
                                        </div>
                                        <div class="outerBox pTop5 col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="LoginNameLabel" runat="server" Text="Remark" meta:resourcekey="LoginNameLabelResource1"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <asp:TextBox ID="RemarkSearchTextBox" runat="server" TabIndex="2" onmouseleave="showHideTooltip()"
                                                    onmouseenter="showHideTooltip()" SkinID="CustomWidthTextBox" meta:resourcekey="RemarkSearchTextBoxResource1"></asp:TextBox>
                                            </div>
                                        </div>
                                        <div class="cBoth">
                                        </div>
                                        <div class="alignCenter pTop5">
                                            <asp:Button ID="SearchButton" runat="server" OnClick="SearchButton_Click"
                                                CausesValidation="False" TabIndex="3" SkinID="0" CssClass="btn-search btn fas" Text="&#xf002; Search" />
                                            <asp:Button ID="ClearSearchButton" runat="server" OnClick="ClearSearchButton_Click"
                                                Text="&#xf0e2; Reset" CssClass="btn-reset btn fas" SkinID="0" TabIndex="4" meta:resourcekey="ClearSearchButtonResource1" />
                                        </div>
                                        <div class="cBoth">
                                        </div>
                                    </asp:Panel>
                                    <div class="spacer">
                                        <asp:Image ID="Image2" runat="server" ImageUrl="~/Images/spacer.gif" meta:resourcekey="Image2Resource1" />
                                    </div>
                                    <div class="himssuHeader7WireBox col-md-12" id="PatientRelationDiv" runat="server">
                                        <div class="himsBoxHeader">
                                            <div class="leftdiv">
                                            </div>
                                            <div class="himsBoxTitle">
                                                <%--<div class="headerText">
                                                                <div class="fLeft">
                                                                    <asp:Label ID="GridViewLabel" Text="List" runat="server" meta:resourcekey="GridViewLabelResource1" />
                                                                </div>
                                                            </div>--%>
                                                <%--<div align="right" class="fRight" style="margin-top: 0px;">
                                                                <uc1:GridViewPager ID="AvialableRoleGridViewPager" runat="server" OnFirstRecordClick="AvialableRoleGridViewPager_FirstRecordClick"
                                                                    OnLastRecordClick="AvialableRoleGridViewPager_LastRecordClick" OnNextRecordClick="AvialableRoleGridViewPager_NextRecordClick"
                                                                    OnPrevRecordClick="AvialableRoleGridViewPager_PrevRecordClick" OnTextBoxValueChange="AvialableRoleGridViewPager_TextBoxValueChange" />
                                                            </div>--%>
                                            </div>
                                        </div>
                                        <div class="himsBoxContent">
                                            <div id="Div3" runat="server" class="table-responsive">
                                                <asp:GridView ID="AvialableRoleGridView" runat="server" AutoGenerateColumns="False"
                                                    EmptyDataText="Roles not avialable" OnSelectedIndexChanged="AvialableRoleGridView_SelectedIndexChanged" CssClass="table table-striped table-bordered table-hover"
                                                    OnPageIndexChanging="AvialableRoleGridView_PageIndexChanging" DataKeyNames="Id" ShowHeader="true"
                                                    AllowPaging="false" PageSize="5" Width="100%" meta:resourcekey="AvialableRoleGridViewResource1">
                                                    <Columns>
                                                        <asp:CommandField ShowSelectButton="True" meta:resourcekey="CommandFieldResource1">
                                                            <HeaderStyle HorizontalAlign="Center" />
                                                            <ItemStyle HorizontalAlign="Center" Width="10%" />
                                                        </asp:CommandField>
                                                        <asp:TemplateField HeaderText="Role" meta:resourcekey="TemplateFieldResource1" HeaderStyle-HorizontalAlign="Left">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lblRole" runat="server" Text='<%# ((Eval("Title").ToString()).Length) > 40 ? (Eval("Title").ToString().Substring(0,40)) + "..." : (Eval("Title").ToString()) %>'
                                                                    ToolTip='<%# Eval("Title") %>' />
                                                            </ItemTemplate>
                                                            <ItemStyle Width="40%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Remarks" meta:resourcekey="TemplateFieldResource2" HeaderStyle-HorizontalAlign="Left">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lblRemark" runat="server" Text='<%# ((Eval("Remark").ToString()).Length) > 40 ? (Eval("Remark").ToString().Substring(0,40)) + "..." : (Eval("Remark").ToString()) %>'
                                                                    ToolTip='<%# Eval("Remark") %>' />
                                                            </ItemTemplate>
                                                            <ItemStyle Width="40%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="InActive" meta:resourcekey="TemplateFieldResource3">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lblObsolete" runat="server" Text='<%# Eval("ObsoleteDisplay") %>'
                                                                    meta:resourcekey="lblObsoleteResource1" />
                                                            </ItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" />
                                                            <ItemStyle HorizontalAlign="Center" Width="10%" />
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <PagerSettings Visible="False" />
                                                </asp:GridView>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </asp:Panel>
                    </div>

                    <div class="himssuHeader1WireBox card card-box" runat="server" id="DetailDiv" visible="false">
                        <div class="himsBoxHeader card-head">
                            <div class="leftdiv">
                            </div>
                            <div class="himsBoxTitle">
                                <div class="headerText">
                                    <header>
                                        <i class="fas fa-cog"></i>
                                        <asp:Label ID="RoleLabel1" runat="server" Text="Maintenance" meta:resourcekey="RoleLabel1Resource1"></asp:Label>
                                    </header>
                                </div>
                            </div>
                            <div class="fRight mt-27 pagination display-flex ">
                                <%-- <asp:ImageButton AlternateText="First page" ToolTip="First page" ID="FirstRecordImageButton"
                                    runat="server" ImageUrl="~/Images/arrowLlast.gif" OnClick="FirstRecordImageButton_Click" />
                                <asp:ImageButton AlternateText="Previous page" ToolTip="Previous page" ID="PreviousImageButton"
                                    runat="server" ImageUrl="~/Images/arrowLeft.gif" OnClick="PreviousImageButton_Click" />
                                <asp:Label ID="LabelPage" runat="server" Text="Record " AssociatedControlID="ReCordNumber" />
                                <asp:Label ID="ReCordNumber" Font-Bold="true" SkinID="Dummy" runat="server"></asp:Label>
                                <asp:Label ID="ofLabel" Text="of" runat="server" />
                                <asp:Label ID="TotalRecord" runat="server" />
                                <asp:ImageButton AlternateText="Next page" ToolTip="Next page" ID="NextImageButtom"
                                    runat="server" ImageUrl="~/Images/arrowRight.gif" OnClick="NextImageButton_Click" />
                                <asp:ImageButton AlternateText="Last page" ToolTip="Last page" ID="LastRecordImageButton"
                                    runat="server" ImageUrl="~/Images/arrowRLast.gif" OnClick="LastRecordImageButton_Click" />
                                <asp:Button ID="BackButton" runat="Server" OnClick="BackButton_Click" SkinID="0" CssClass="BackButton" Text="Back" />--%>
                                <table>
                                    <tr>
                                        <td class="formLabel">
                                            <div id="NumberOfRecordDiv" class="display-flex" runat="server" visible="true">
                                                <asp:LinkButton AlternateText="First page" ToolTip="First page" ID="FirstRecordImageButton"
                                                    runat="server" CommandName="Page" CommandArgument="First"
                                                    OnClick="FirstRecordImageButton_Click" CssClass="btn btn-default gridviewpagerbuttonpadding">
                                                    <i class="fa fa-fast-backward"></i>
                                                </asp:LinkButton>
                                                <asp:LinkButton AlternateText="Previous page" ToolTip="Previous page" ID="PreviousImageButton"
                                                    runat="server" CommandName="Page" CommandArgument="Prev"
                                                    OnClick="PreviousImageButton_Click" CssClass="btn btn-default gridviewpagerbuttonpadding">
                                                    <i class="fa fa-play fa-rotate-180"></i>

                                                </asp:LinkButton>
                                                &nbsp;
                                                <asp:Label ID="LabelPage" runat="server" Text="Record " AssociatedControlID="ReCordNumber" />
                                                <asp:Label ID="ReCordNumber" Font-Bold="true" SkinID="Dummy" runat="server"></asp:Label>
                                                <asp:Label ID="ofLabel" Text="of" runat="server" />
                                                <asp:Label ID="TotalRecord" runat="server" />
                                                &nbsp;
                                                <asp:LinkButton AlternateText="Next page" ToolTip="Next page" ID="NextImageButtom"
                                                    runat="server" CssClass="btn btn-default gridviewpagerbuttonpadding" CommandName="Page" CommandArgument="Next"
                                                    OnClick="NextImageButton_Click">
                                                     <i class="fa fa-play"></i>
                                                </asp:LinkButton>

                                                <asp:LinkButton AlternateText="Last page" ToolTip="Last page" ID="LastRecordImageButton"
                                                    runat="server" CssClass="btn btn-default gridviewpagerbuttonpadding" CommandName="Page" CommandArgument="Last"
                                                    OnClick="LastRecordImageButton_Click">
                                                      <i class="fa fa-fast-forward"></i>
                                                </asp:LinkButton>
                                                &nbsp;  &nbsp; &nbsp;
                                            </div>
                                        </td>
                                        <td>
                                            <asp:Button ID="BackButton" runat="Server" OnClick="BackButton_Click" SkinID="0" CssClass="btn btn-back fas" Text="&#xf30a;  back" />
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                        <div class="himsBoxContent card-body">
                            <div class="contentHolder">
                                <div class="outerBox pTop5 col-md-3">
                                    <div class="controlLabelWidth">
                                        <asp:Label ID="RoleTitleLabel" Text="Role" runat="server" SkinID="MandatoryLabel"
                                            meta:resourcekey="RoleTitleLabelResource1"></asp:Label>
                                    </div>
                                    <div class="fLeft pRight5">
                                        <asp:HiddenField ID="RoleIDHiddenField" runat="server" />
                                        <asp:HiddenField ID="UpdatedDateHiddenField" runat="server" />
                                        <asp:TextBox ID="RoleTitleTextBox" AutoPostBack="True" runat="server" OnTextChanged="RoleTitleTextBox_TextChanged"
                                            TabIndex="5" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                            SkinID="CustomWidthTextBox" meta:resourcekey="RoleTitleTextBoxResource1"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="outerBox pTop5 col-md-3">
                                    <div class="controlLabelWidth">
                                        <asp:Label ID="RemarkLabel" Text="Remarks" runat="server" SkinID="MandatoryLabel"
                                            meta:resourcekey="RemarkLabelResource1"></asp:Label>
                                    </div>
                                    <div class="fLeft pRight5">
                                        <asp:TextBox ID="RemarkTextBox" runat="server" TabIndex="6" onmouseleave="showHideTooltip()"
                                            onmouseenter="showHideTooltip()" SkinID="CustomWidthTextBox" meta:resourcekey="RemarkTextBoxResource1"></asp:TextBox>
                                    </div>
                                </div>

                                <div class="outerBox pTop15 col-md-3" runat="server" visible="False" id="IsSystemDiv">
                                    <%--   <div class="fLeft">
                                        <asp:CheckBox ID="IsSystemCheckBox" Enabled="False" runat="server" Visible="False"
                                            TabIndex="7" meta:resourcekey="IsSystemCheckBoxResource1" />
                                    </div>
                                    <div class="fLeft pLeft5 pTop5">
                                        <asp:Label ID="IsSystemLabel" Text="Is System" runat="server" Visible="False" meta:resourcekey="IsSystemLabelResource1"></asp:Label>
                                    </div>--%>


                                    <div class="controlLabelWidth">
                                        <asp:Label CssClass="rt-chkbox rt-chkbox-outline" runat="server" AssociatedControlID="IsSystemCheckBox" Visible="False" ID="IsSystemLabel">
                                            <asp:CheckBox ID="IsSystemCheckBox" Enabled="False" runat="server" Visible="False" />
                                            <span></span>
                                            Is System
                                        </asp:Label>
                                    </div>
                                </div>
                                <div class="outerBox pTop15 col-md-3">
                                    <%--   <div class="fLeft">
                                        <asp:CheckBox ID="IsObsoleteCheckBox" runat="server" TabIndex="8" meta:resourcekey="IsObsoleteCheckBoxResource1" />
                                    </div>
                                    <div class="fLeft pLeft5 pTop5">
                                        <asp:Label ID="IsObsoleteLabel" Text="InActive" runat="server" meta:resourcekey="IsObsoleteLabelResource1"></asp:Label>
                                    </div>--%>
                                    <div class="controlLabelWidth">
                                        <asp:Label CssClass="rt-chkbox rt-chkbox-outline" runat="server" AssociatedControlID="IsObsoleteCheckBox" ID="IsObsoleteLabel">
                                            <asp:CheckBox ID="IsObsoleteCheckBox" runat="server" />
                                            <span></span>
                                            InActive
                                        </asp:Label>
                                    </div>
                                </div>
                                <div Id="SubRoleDiv" runat="server" class="himsBoxContent himssuHeader7WireBox col-md-12" visible="false">
                                    <div class="himsBoxHeader card-head inner">
                                        <div class="leftdiv">
                                        </div>
                                        <div class="himsBoxTitle">
                                            <div class="headerText fLeft">
                                                <header>
                                                    <asp:Label ID="SubRoleLabel" Text="Assign SubRole" runat="server" />
                                                </header>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="himsBoxContent">
                                        <div class="table-responsive" >
                                            <asp:GridView ID="SubRoleGridView" runat="server" AutoGenerateColumns="False"
                                                EmptyDataText="Roles not avialable" DataKeyNames="Id" ShowHeader="true" CssClass="table table-striped table-bordered table-hover"
                                                AllowPaging="false" PageSize="5" Width="100%" meta:resourcekey="AvialableRoleGridViewResource1" OnRowDataBound="SubRoleGridView_RowDataBound">
                                                <Columns>
                                                    <asp:TemplateField>
                                                        <HeaderTemplate>
                                                            <label class="rt-chkbox  rt-chkbox-outline">
                                                                <asp:CheckBox ID="RoleModuleCheckBox" AutoPostBack="true" runat="server" OnCheckedChanged="RoleModuleCheckBox_CheckedChanged" />
                                                                <span></span>
                                                            </label>
                                                        </HeaderTemplate>
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                        <ItemTemplate>
                                                            <label class="rt-chkbox  rt-chkbox-outline">
                                                                <asp:CheckBox ID="RoleCheckBox" runat="server" />
                                                                <span></span>
                                                            </label>
                                                        </ItemTemplate>
                                                        <ItemStyle HorizontalAlign="Center" Width="1%" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Role" meta:resourcekey="TemplateFieldResource1" HeaderStyle-HorizontalAlign="Left">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblRole" runat="server" Text='<%# ((Eval("Title").ToString()).Length) > 40 ? (Eval("Title").ToString().Substring(0,40)) + "..." : (Eval("Title").ToString()) %>'
                                                                ToolTip='<%# Eval("Title") %>' />
                                                        </ItemTemplate>
                                                        <ItemStyle Width="40%" />
                                                    </asp:TemplateField>
                                                </Columns>
                                                <PagerSettings Visible="False" />
                                            </asp:GridView>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>

            <div class="spacer">
                <img src="../../../Images/spacer.gif" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--  <script data-main="../../../JavaScript/rjs/encrypt/create-role-encrypt" src="../../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/create-role")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
</asp:Content>
