<%@ Page Language="C#" MasterPageFile="~/masterpages/eDashboard.master" AutoEventWireup="true" Inherits="site_AccessManagement_Roles_Create" Title="eSecuritel Role Add"
    Culture="auto" UICulture="auto" Codebehind="Create.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="eContent" runat="Server">
    <script type="text/javascript" >
        $(document).ready(function () {
            $("#<%=m_txtRoleHierarhcy.ClientID%>").keydown(function (event) {
                // Allow: backspace, delete, tab, escape, and enter
                if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || event.keyCode == 13 ||
                // Allow: Ctrl+A
                (event.keyCode == 65 && event.ctrlKey === true) ||
                // Allow: home, end, left, right
                (event.keyCode >= 35 && event.keyCode <= 39)) {
                    // let it happen, don't do anything
                    return;
                }
                else {
                    // Ensure that it is a number and stop the keypress
                    if (event.shiftKey || (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105)) {
                        event.preventDefault();
                    }
                }
            });
        });
    </script>
    <h1>
        <asp:Label ID="m_lblRoleType" runat="server" Text="<%$ Resources: SecurityManagement, LabelAddRoleColon %>" ></asp:Label></h1>
    <table class="gvTable" cellpadding="0" cellspacing="0">
        <tr>
            <td align="right">
                <asp:Literal ID="m_litName" runat="server" Text="<%$ Resources: SecurityManagement, LabelRoleNameColon %>" /></td>
            <td>
                <asp:Label ID="m_lblName" runat="server"></asp:Label></td>
        </tr>
        <tr>
            <td align="right">
                <asp:Literal ID="m_litDescription" runat="server" Text="<%$ Resources: SecurityManagement, LabelDescriptionColon %>" /></td>
            <td>
                <asp:TextBox ID="m_txtDescription" Width="300px" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <td align="right">
                <asp:Literal ID="m_litRoleHierarchy" runat="server" Text="<%$ Resources: SecurityManagement, LabelRoleHierarchy %>" /></td>
            <td>
                <asp:TextBox ID="m_txtRoleHierarhcy" Width="100px" runat="server" MaxLength="4"></asp:TextBox>
                </td>
        </tr>
        <tr>
            <td colspan="2">
                &nbsp;</td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Literal ID="m_litSelections" runat="server" Text="<%$ Resources: SecurityManagement, LabelTaskSelectionsColon %>" /></td>
        </tr>
    </table>
    <asp:UpdatePanel runat="server" ID="update" UpdateMode="Conditional">
        <ContentTemplate>
            <div class="subpanelAddition">
                <asp:Repeater ID="m_rTaskLists" runat="server" OnItemDataBound="m_rTaskLists_ItemDataBound">
                    <ItemTemplate>
                        <div class="subpanelheader hr">
                            <img src="../../../images/Collapse_13x13.jpg" class="showstate" onclick="expandcontent(this, '<%# DataBinder.Eval(Container.DataItem, "TaskListName") %>')"
                                alt="contract" />
                            &nbsp;
                            <%# DataBinder.Eval(Container.DataItem, "TaskListName") %>
                        </div>
                        <div id='<%# DataBinder.Eval(Container.DataItem, "TaskListName") %>' class="switchcontent">
                        <div style="background-color: #fbedd2; width: 100%;">
                            &nbsp;
                            <eSecuritelHITSControls:CheckBoxListToggle runat="server" ID="CheckBoxListToggle" CheckBoxListControlId="m_cklTasks" SelectAllButtonText="<%$ Resources: Default, CheckBoxListToggleSelectAll %>" UnselectAllButtonText="<%$ Resources: Default, CheckBoxListToggleDeSelectAll %>" />

                        </div>
                            <asp:CheckBoxList ID="m_cklTasks" runat="server" RepeatColumns="5" RepeatDirection="Horizontal">
                            </asp:CheckBoxList></div>
                        <br />
                    </ItemTemplate>
                </asp:Repeater>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <asp:Button ID="m_btnSave" runat="server" Text="<%$ Resources: Default, ButtonConfirm %>" OnClick="m_btnSave_Click"
        CssClass="pagebutton" />
    <asp:Button ID="m_btnCancel" runat="server" Text="<%$ Resources: Default, ButtonCancel %>" CausesValidation="False"
        OnClick="m_btnCancel_Click" CssClass="pagebutton" />
</asp:Content>
