<%@ control language="VB" autoeventwireup="false" inherits="PCC_DC_CC_IAMRole, MachSol.MachPanel.Web" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<%@ Register Assembly="MachSol.MachPanel.Utility" Namespace="MachSol.MachPanel.Utility" TagPrefix="EM" %>
<%@ Register Src="~/Template/GVPager.ascx" TagName="Pager" TagPrefix="EM" %>
<%@ Register Src="~/Template/CC/Selectable_Selected_LBX.ascx" TagName="AddSelectableSelected" TagPrefix="EM" %>


<asp:Panel ID="Pnl_List" runat="server">

    <div class="row">
        <div class="col-xs-12">
            <div class="card">
                <div class="header">
                    <h3>
                        <asp:Literal ID="Literal8" runat="server" Text='<%$ Resources:Content,strIAMRoles%>' EnableViewState="false" />
                    </h3>
                </div>
                <div class="body">
                    <asp:Button ID="BTN_AddIAMRole" class="btn btn-primary waves-effect btnAction" runat="server" Text='<%$ Resources:Content,strAddIAMRole %>' />
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-xs-12">
            <EM:MPGridView ID="GV_IAMRoles" DataKeyNames="RoleId" CurrentSortExpression="RoleName" CurrentSortDirection="Asc"
                CssClass="table table-bordered table-striped table-hover" runat="server" AllowPaging="true" AllowSorting="true" EmptyDataText='<%$ Resources:Content, GN00001375 %>'
                AutoGenerateColumns="false">

                <Columns>
                    <asp:TemplateField HeaderText="<%$ Resources:Content, SMI724 %>" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                        <ItemTemplate>
                            <asp:Label ID="Lb_RoleName" runat="server"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="<%$ Resources:Content, strPermissions %>" HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3">
                        <ItemTemplate>
                            <%--<asp:Label ID="Lb_Permissions" runat="server"></asp:Label>--%>
                            <asp:LinkButton ID="LB_PerDetails" runat="server" />
                            <div id="Div_PerDetails" runat="server" style="display: none" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="<%$ Resources:Content, strUsers/Groups %>" HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3">
                        <ItemTemplate>
                            <%--<asp:Label ID="Lb_Users" runat="server"></asp:Label>--%>
                            <asp:LinkButton ID="LB_UserDetails" runat="server" />
                            <div id="Div_UserDetails" runat="server" style="display: none" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="<%$ Resources:Content, strAttachto %>" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                        <ItemTemplate>
                           <%-- <asp:Label ID="Lb_Attachto" runat="server"></asp:Label>--%>
                              <asp:LinkButton ID="LB_VMsDetails" runat="server" />
                            <div id="Div_VMsDetails" runat="server" style="display: none" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="<%$ Resources:Content, GN0000360 %>" HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-2">
                        <ItemTemplate>
                            <asp:LinkButton ID="LB_Edit" runat="server" CommandName="EditRole" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.RoleId") %>' class="btn btn-primary waves-effect btnAction" Text="<%$ Resources:Content,GN0000276%>" />
                            <asp:LinkButton class="btn btn-primary waves-effect btnAction" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.RoleId") %>'
                                ID="LB_Remove" CommandName="RemoveRole" runat="server" Text="<%$ Resources:Content,GN0000278%>" />
                            <EM:ConfirmButtonExtender ID="CBE_Remove" ConfirmText="<%$ Resources:Content,GN000200%>"
                                TargetControlID="LB_Remove" runat="server">
                            </EM:ConfirmButtonExtender>
                             <asp:LinkButton ID="LB_Clone" runat="server" CommandName="CloneRole" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.RoleId") %>' class="btn btn-primary waves-effect btnAction" Text="<%$ Resources:Content,DGN1110198%>" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <PagerTemplate>
                    <EM:Pager ID="Pager" runat="server" />
                </PagerTemplate>
            </EM:MPGridView>
        </div>
    </div>
</asp:Panel>

<asp:Button ID="Dummy" runat="server" Style="display: none" />

<asp:Panel ID="Panel1" runat="server" CssClass="width-modal-popup-auto"
    Style="display: none;">
    <div class="col-xs-12">
        <div class="card">
            <div class="header">
                <h3>
                    <%= Resources.Content.strDetails%>
                    <span>
                        <button type="button" class="close" onclick="$find('<%=MP1.ClientID%>').hide();">&times;</button>
                    </span>
                </h3>
            </div>
            <div class="body">
                <div class="row">
                    <div class="col-xs-12">
                        <div id="Div_ShowDetails" runat="server" />

                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-12 row-label">
                    <asp:Button ID="Btn_Close" CssClass="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,GN000150%>" />
                </div>
            </div>
        </div>
    </div>

</asp:Panel>

<EM:ModalPopupExtender runat="server" ID="MP1" BackgroundCssClass="modalBackground"
    DropShadow="false" PopupControlID="Panel1" TargetControlID="Dummy" CancelControlID="Btn_Close">
</EM:ModalPopupExtender>

<asp:Panel CssClass="row" ID="Pnl_AddIAMRole" runat="server" DefaultButton="Btn_Save">
    <div class="col-xs-12">
        <div class="card">
            <div class="header">
                <h3>
                    <asp:Literal ID="Literal33" runat="server" Text="<%$ Resources:Content,strAddEditIAMRole%>" EnableViewState="false"></asp:Literal>
                </h3>
            </div>
            <div class="body">
                <div class="row">
                    <div class="col-sm-1 col-xs-12 row-label">
                        <label>
                            *<asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:Content,SMI724%>"
                                EnableViewState="false" />:</label>
                    </div>
                    <div class="col-sm-4 col-xs-12">
                        <div class="form-group">
                            <div class="form-line">
                                <asp:TextBox ID="Txt_RoleName" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator16" runat="server" ControlToValidate="Txt_RoleName"
                                    Display="None" SetFocusOnError="True" ValidationGroup="SG"></asp:RequiredFieldValidator>
                                <asp:ValidationSummary ID="ValidationSummary4" runat="server" ShowMessageBox="true"
                                    ShowSummary="false" ValidationGroup="SG" HeaderText="<%$ Resources:Content,EM000001%>" />
                            </div>
                        </div>
                    </div>
                </div>

                <%--<div class="row">
                    <div class="col-sm-2 col-xs-12 row-label">
                        <label>
                            *<asp:Literal ID="Literal2" runat="server" Text="<%$ Resources:Content,DGN1110505%>" EnableViewState="false" />:</label>
                    </div>
                    <div class="col-sm-4 col-xs-12">
                        <div class="form-group">
                            <asp:DropDownList ID="DDL_BuiltInRoles" runat="server"></asp:DropDownList>
                        </div>
                    </div>
                </div>--%>

                <div class="row">
                    <div class="col-xs-12 row-label">
                        <asp:Label ID="Label4" runat="server" Text="<%$ Resources:Content,strPermissions %>" />:
                    </div>
                    <div class="col-xs-12">
                        <asp:Repeater ID="Rep_Permission" runat="server">
                            <ItemTemplate>
                                <div class="col-xs-3">
                                    <asp:CheckBox ID="ChBx_Permission" runat="server" />
                                    <asp:HiddenField ID="hdnPerId" runat="server" />
                                </div>


                            </ItemTemplate>
                        </asp:Repeater>
                    </div>
                    <%-- <div class="col-xs-12">
                        <EM:AddSelectableSelected ID="UCPermissions" runat="server" />
                    </div>--%>
                </div>
                <div class="row">
                    <div class="col-xs-12 row-label">
                        <asp:Label ID="Label3" runat="server" Text="<%$ Resources:Content,strVirtualMachines %>" />:
                    </div>
                    <div class="col-xs-12">
                        <EM:AddSelectableSelected ID="UCVMs" runat="server" />
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12 row-label">
                        <asp:Label ID="Label1" runat="server" Text="<%$ Resources:Content,strUsers %>" />:
                    </div>
                    <div class="col-xs-12">
                        <EM:AddSelectableSelected ID="UCUserMembers" runat="server" />
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12 row-label">
                        <asp:Label ID="Label2" runat="server" Text="<%$ Resources:Content,strGroups %>" />:
                    </div>
                    <div class="col-xs-12">
                        <EM:AddSelectableSelected ID="UCGroupMembers" runat="server" />
                    </div>
                </div>



                <div class="row">
                    <div class="col-xs-12">
                        <asp:Button ID="Btn_Save" runat="server" Text="<%$ Resources:Content,GN0000281%>"
                            class="btn btn-primary waves-effect btnAction" ValidationGroup="SG" CausesValidation="true" />
                        <asp:Button ID="Btn_Cancel" runat="server" Text="<%$ Resources:Content,GN0000572%>"
                            class="btn btn-primary waves-effect" CausesValidation="false" />
                    </div>
                </div>

            </div>
        </div>
    </div>
</asp:Panel>
