<%@ Page Language="vb" 
    MasterPageFile ="~/CITAD.Master" 
    AutoEventWireup="false" 
    CodeBehind="Group_RIGHT.aspx.vb" 
    Inherits="CITAD.WEB.VB.Group_RIGHT" 
    Culture="auto" meta:resourcekey="PageResource1" 
    UICulture="auto" Title="Phân quyền cho nhóm người sử dụng" %>

<%@ Register Src="../../Controls/MessageBox.ascx" TagName="MessageBox" TagPrefix="uc1" %>  
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript" language="javascript">
        window.onload = function()
        {
            var treev = document.getElementById('<%=tvwPermission.ClientID%>');
            var firstE = treev.getElementsByTagName('a');
            firstE[1].focus();
        }
        //Cài đặt sự kiện phím tắt
        window.document.onkeyup=ShortcutKeys;
        function ShortcutKeys()
        {
//            if(event.ctrlKey)
//            {
//                switch (event.keyCode)
//                {
//                    case 49://Ctrl + 1
//                        __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuAdd');
//                        break;
//                    case 50://Ctrl + 2
//                        __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuDetail');
//                        break;
//                    case 52://Ctrl + 4
//                        __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuQuery');
//                        break;
//                    case 69://Ctrl + E
//                        __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuClose');
//                        break;
//                }
//            }
            if(event.keyCode == 13)
            {
                var tablet = document.getElementById('eventSRC');
                if(tablet.contains(event.srcElement))
                {
                    __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuSave');
                }
            }
        }
    </script>
    <ajaxToolkit:ToolkitScriptManager runat="Server" ID="ScriptManager1" EnableScriptGlobalization="True"
             EnableScriptLocalization="True" CombineScripts="True" EnablePageMethods="true" />

    <div style="width:770px;">
        <table class="citad-toolbar" cellpadding="0" cellspacing="0">
            <tr>
                <td class="citad-toolbar-tdleft"></td>
                <td class="citad-toolbar-tdmain">
                    <asp:Menu ID="Menu1" runat="server"
                        Font-Names="Verdana"
                        Font-Size="11px"
                        
                        Orientation="Horizontal" 
                        CssClass="citad-menu" 
                        StaticSubMenuIndent="10px" 
                        meta:resourcekey="Menu1Resource1"
                        
                        StaticHoverStyle-CssClass="citad-menu-hover"
                        StaticMenuStyle-CssClass="citad-menu"
                        StaticSelectedStyle-CssClass="citad-menu-selected"
                        
                        StaticMenuItemStyle-HorizontalPadding="5px"
                        StaticMenuItemStyle-VerticalPadding="2px">
                        <Items>
                            <asp:MenuItem Text="Tho&#225;t" Value="mnuClose" SeparatorImageUrl="~/Images/toolbar/citad-toolbar-sperator.gif" ImageUrl="~/Images/Menu/home.gif" meta:resourcekey="MenuItemResource1">
                            </asp:MenuItem>
                            <asp:MenuItem Text="Ghi" Value="mnuSave" ImageUrl="~/Images/Menu/save.gif" meta:resourcekey="MenuItemResource2">
                            </asp:MenuItem>
                        </Items>  
                    </asp:Menu>
                </td>
            </tr>
        </table>
        <div>
            <asp:Label ID="lblGroup" runat="server" Text="Nh&#243;m sử dụng" meta:resourcekey="lblGroupResource1"></asp:Label>
            <asp:Label ID="txtGroupName" runat="server" Font-Bold="True" Text="Label" meta:resourcekey="txtGroupNameResource2"></asp:Label>
        </div>        
        <table cellpadding="0" cellspacing="0" border="0" width="770px">           
            <tr>
                <td valign="top" style="width: 375px" >
                    <asp:TreeView ID="tvwPermission" runat="server" 
                            ImageSet="Contacts" 
                            meta:resourcekey="tvwPermissionResource1" 
                            OnSelectedNodeChanged="tvwPermission_SelectedNodeChanged" 
                            BorderStyle="None" CssClass="tvPermission">
                            <ParentNodeStyle Font-Bold="False" />
                            <HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
                            <SelectedNodeStyle Font-Underline="False" HorizontalPadding="0px"
                                VerticalPadding="0px" BackColor="Silver" />
                            <NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black" HorizontalPadding="5px"
                                NodeSpacing="0px" VerticalPadding="1px" />
                        </asp:TreeView>
                </td>
                <td id="eventSRC" valign="top" >
            <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="tvwPermission" EventName="SelectedNodeChanged" />
                <asp:AsyncPostBackTrigger ControlID="Menu1" EventName="MenuItemClick" />
            </Triggers>
            <ContentTemplate>
                <asp:Label ID="lblRight" runat="server" Width="370px"></asp:Label><br />
                <asp:GridView ID="dgvUse" runat="server" 
                    AutoGenerateColumns="False" 
                    meta:resourcekey="dgvUseResource1" 
                    DataKeyNames="ACTION_ID,RIGHT_ID" 
                    CellPadding="1" 
                    CssClass="grid">
                    <FooterStyle CssClass="grid-footer" />
                    <SelectedRowStyle CssClass="grid-selectedRow" />
                    <PagerStyle HorizontalAlign="Center" CssClass="grid-pager" />
                    <HeaderStyle CssClass="grid-header" />
                    <AlternatingRowStyle CssClass="grid-alternating" />
                    <Columns>
                        <asp:TemplateField meta:resourceKey="TemplateFieldResource1">
                           <ItemStyle HorizontalAlign="Center" />
                           <HeaderStyle Width="20px" HorizontalAlign="Center" />
                            <HeaderTemplate>
                                <asp:CheckBox ID="chkCheckAll" runat="server" onclick="return CheckAll(this,'chkUsed');" meta:resourcekey="chkCheckAllResource1" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <input id="chkUsed" runat="server" type="checkbox" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="STT" meta:resourcekey="BoundFieldResource1">
                            <HeaderStyle Width="40px" HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="M&#227; dịch vụ" meta:resourcekey="BoundFieldResource2" DataField="SERV_CODE" />
                        <asp:BoundField DataField="NAME" HeaderText="T&#234;n dịch vụ" meta:resourcekey="BoundFieldResource3" >                           
                        </asp:BoundField>
                        <asp:BoundField DataField="RIGHT_ID" Visible="False" meta:resourcekey="BoundFieldResource4" />
                    </Columns>
                </asp:GridView>
                <asp:HiddenField ID="hidGroupID" runat="server" />
                <asp:HiddenField ID="hidMenuID" runat="server" />
                <asp:HiddenField ID="hidMenuType" runat="server" />
                <uc1:MessageBox id="MessageBox1" runat="server" />
         </ContentTemplate> 
         </asp:UpdatePanel>
        </td>
    </tr>
</table>
    </div>
</asp:Content>