<%@ Page Language="vb" MasterPageFile ="~/CITAD.Master" 
    AutoEventWireup="false" 
    CodeBehind="GroupList.aspx.vb" 
    Inherits="CITAD.WEB.VB.GroupList" 
    enableEventValidation="false" 
    Culture="auto" 
    meta:resourcekey="PageResource1" 
    UICulture="auto" 
    Title="Danh sách nhóm sử dụng"%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="../../Controls/MessageBox.ascx" TagName="MessageBox" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
	    //window.document.onkeydown=KeyDown;
	    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','mnuIquiry');                    
                }                
            }
        }
		window.onload = function(){
            document.getElementById('<%=txtGroupName.ClientID%>').focus();
        }
	</script>
	  <ajaxToolkit:ToolkitScriptManager runat="Server" ID="ScriptManager1" EnableScriptGlobalization="True"
             EnableScriptLocalization="True" CombineScripts="True" EnablePageMethods="true"  />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <Triggers>
                   <asp:AsyncPostBackTrigger ControlID ="Menu1" EventName ="MenuItemClick" /> 
           </Triggers> 
            <ContentTemplate>
            <table border="0" cellpadding="0" cellspacing="2" width="770px">
                <tr>
                    <td>
                        <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" OnMenuItemClick="Menu1_MenuItemClick"
                                    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="Đ&#243;ng" Value="mnuClose" SeparatorImageUrl="~/Images/toolbar/citad-toolbar-sperator.gif" ImageUrl="~/Images/Menu/home.gif" meta:resourcekey="MenuItemResource1"></asp:MenuItem>
                                    <asp:MenuItem Text="Th&#234;m mới" Value="mnuAdd" SeparatorImageUrl="~/Images/toolbar/citad-toolbar-sperator.gif" ImageUrl="~/Images/Menu/add.gif" meta:resourcekey="MenuItemResource2"></asp:MenuItem>
                                    <asp:MenuItem Text="Sửa" Value="mnuEdit" SeparatorImageUrl="~/Images/toolbar/citad-toolbar-sperator.gif" ImageUrl="~/Images/Menu/open.gif" meta:resourcekey="MenuItemResource3"></asp:MenuItem>
                                    <asp:MenuItem Text="Xo&#225;" Value="mnuDelete" SeparatorImageUrl="~/Images/toolbar/citad-toolbar-sperator.gif" ImageUrl="~/Images/Menu/delete.gif" meta:resourcekey="MenuItemResource4"></asp:MenuItem>
                                    <asp:MenuItem Text="Ph&#226;n quyền" Value="mnuPermission" SeparatorImageUrl="~/Images/toolbar/citad-toolbar-sperator.gif" ImageUrl="~/Images/Menu/unhold.gif" meta:resourcekey="MenuItemResource5"></asp:MenuItem>
                                    <asp:MenuItem Text="Truy vấn" Value="mnuIquiry" ImageUrl="~/Images/Menu/search.gif" meta:resourcekey="MenuItemResource6"></asp:MenuItem>
                                </Items>
                                    <StaticMenuStyle CssClass="citad-menu" />
                                    <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
                                    <StaticSelectedStyle CssClass="citad-menu-selected" />
                                    <StaticHoverStyle CssClass="citad-menu-hover" />
                           </asp:Menu>
                            </td> 
                        </tr>
                    </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        
                                <table id="eventSRC" cellpadding="0" cellspacing="2" border="0" width="770">
                                    <tr>
                                       <td valign="top" align="center">
                                                <fieldset style="height: 45px">
                                                    <legend><asp:Label ID="Label3" runat="server" Text="Nh&#243;m sử dụng" meta:resourcekey="Label3Resource1"></asp:Label></legend>
                                                    <asp:TextBox ID="txtGroupName" runat="server" Height="16px" CssClass="citad-txt" Width="190px" meta:resourcekey="txtGroupNameResource1"></asp:TextBox></fieldset>
                                        </td>
                                        <td valign="top" align="center">
                                            <fieldset style="height: 45px" >
                                                <legend><asp:Label ID="Label2" runat="server" Text="T&#236;nh trạng" meta:resourcekey="Label2Resource1"></asp:Label></legend>
                                                <table cellpadding="0" cellspacing="0" border="0" style="text-align:center;">
                                                    <tr>
                                                        <td style="width: 130px">
                                                            <asp:RadioButton ID="rdbDangSuDung" runat="server" Text="Đang sử dụng" GroupName="GrpTinhTrang" meta:resourcekey="rdbDangSuDungResource1" /></td>
                                                        <td style="width: 139px">
                                                            <asp:RadioButton ID="rdbKhongSuDung" runat="server" Text="Kh&#244;ng sử dụng" GroupName="GrpTinhTrang" meta:resourcekey="rdbKhongSuDungResource1" /></td>
                                                        <td style="width: 100px">
                                                            <asp:RadioButton ID="rdbTatCa" runat="server" Text="Tất cả" Width="64px" GroupName="GrpTinhTrang" meta:resourcekey="rdbTatCaResource1" /></td>
                                                    </tr>
                                                </table>
                                            </fieldset>
                                        </td>
                                    </tr>
                                </table>
                        <table width="100%">
                            <tr>
                                <td align="right">
                                    <asp:Label ID="lblTongSo" runat="server" Font-Bold="True" meta:resourcekey="lblTongSoResource1"
                                        Text="Tổng số:"></asp:Label>
                                    <asp:Label ID="lblCount" runat="server" Font-Bold="True"></asp:Label></td>
                            </tr>
                        </table>
                                <asp:GridView ID="dgvGroup" DataKeyNames="GROUP_ID" runat="server" CellPadding="2" AllowPaging="True" Width="770px" AutoGenerateColumns="False" BorderWidth="1px" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" CssClass="grid" OnPageIndexChanging="dgvGroup_PageIndexChanging" OnRowDataBound="dgvGroup_RowDataBound" meta:resourcekey="dgvGroupResource1" OnSelectedIndexChanged="dgvGroup_SelectedIndexChanged">
                                        <FooterStyle CssClass="grid-footer" />
                                        <RowStyle CssClass="grid-row" />
                                        <EditRowStyle BackColor="#999999" />
                                        <SelectedRowStyle CssClass="grid-selectedRow" />
                                        <PagerStyle CssClass="grid-pager" HorizontalAlign="Center" />
                                        <HeaderStyle CssClass="grid-header" />
                                        <AlternatingRowStyle CssClass="grid-alternating" />
                                            <Columns>
                                                <asp:TemplateField meta:resourcekey="TemplateFieldResource1">
                                                <HeaderTemplate>
                                                    <asp:CheckBox ID="chkCheckAll" runat="server" onclick="return CheckAll(this,'chkOne');" meta:resourcekey="chkCheckAllResource1"/>
                                                </HeaderTemplate>
                                                <ItemTemplate>                                        
                                                    <input id="chkOne" type="checkbox" runat="server" />
                                                </ItemTemplate>
                                                <HeaderStyle Width="20px" />
                                                <ItemStyle HorizontalAlign="Center" />  
                                            </asp:TemplateField>
                                                <asp:BoundField HeaderText="STT" meta:resourcekey="BoundFieldResource1" >
                                                    <HeaderStyle Width="30px" HorizontalAlign="Center" />
                                                    <ItemStyle HorizontalAlign="Center" />
                                                </asp:BoundField>
                                              <%--  
                                                <asp:BoundField DataField="GROUP_NAME" HeaderText="T&#234;n nh&#243;m" meta:resourcekey="BoundFieldResource2" >
                                                    <HeaderStyle Width="400px" HorizontalAlign="Center" />
                                                    <ItemStyle HorizontalAlign="Left" />
                                                </asp:BoundField>
                                                --%>
                                                
                                                <asp:TemplateField meta:resourcekey="TemplateFieldResource6">
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="lbtGROUP_NAME" runat="server" CommandName="Select" Text='<%# Bind("GROUP_NAME") %>'>
                                                        </asp:LinkButton>
                                                    </ItemTemplate>
                                                
                                                </asp:TemplateField>
                                                
                                                <asp:BoundField DataField="TINHTRANG"  HeaderText="T&#236;nh trạng" meta:resourcekey="BoundFieldResource3" >
                                                    <HeaderStyle Width="300px" HorizontalAlign="Center" />
                                                    <ItemStyle HorizontalAlign="Left" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="GROUP_ID"  Visible="False" meta:resourcekey="BoundFieldResource4" >
                                                    <ItemStyle HorizontalAlign="Left" />
                                                    <HeaderStyle HorizontalAlign="Center" />
                                                </asp:BoundField>
                                            </Columns>
                                            <EmptyDataTemplate>
                                                <asp:Label ID="lblMsg" runat="server" meta:resourcekey="lblMsgResource1" Text="Kh&#244;ng c&#243; bản ghi n&#224;o"></asp:Label>
                                            </EmptyDataTemplate>
                                        </asp:GridView></td>
                            
                    </td>
                </tr>
            </table>
            <asp:Panel ID="Panel1" runat="server" Style="display: none" CssClass="modalPopup" Width="400px" meta:resourcekey="Panel1Resource1">
                <p style="font-size:14px;"><asp:Label ID="lblTieuDeThongBao" runat="server" Text="Th&#244;ng b&#225;o" meta:resourcekey="lblTieuDeThongBaoResource1"></asp:Label></p>
                <p><asp:Label ID="lblMessage" runat="server" Text="Label" meta:resourcekey="lblMessageResource1"></asp:Label></p>
                <p style="text-align: center;">
                    <asp:Button ID="OkButton" runat="server" Text="OK" CssClass="citad-btn" Width="70px" meta:resourcekey="OkButtonResource1" />                        
                </p>
            </asp:Panel>    
           <asp:HiddenField ID="hidModalPopup" runat="server" />
           <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" 
                TargetControlID="hidModalPopup"
                PopupControlID="Panel1" 
                BackgroundCssClass="modalBackground" 
                OkControlID="OkButton" DynamicServicePath="" Enabled="True"
                ></cc1:ModalPopupExtender>
           <asp:HiddenField ID="hidConfirmDelete" runat="server" />
                <asp:Panel ID="Panel2" runat="server" CssClass="modalPopup" Style="display: none" Width="400px">
                    <p style="font-size: 14px; text-align:center;">
                        <asp:Label ID="lblConfirmDelete" runat="server"></asp:Label>&nbsp;</p>
                    <p style="text-align: center">
                        <asp:Button ID="btnOKDelete" runat="server" CssClass="citad-btn" Text="OK" OnClick="btnOKDelete_Click1" />
                        <asp:Button ID="btnCancelDelete" runat="server" CssClass="citad-btn" Text="Cancel"/>
                    </p>
                </asp:Panel>
                    <cc1:ModalPopupExtender ID="ModalPopupExtenderConfirm" runat="server" CancelControlID="btnCancelDelete" TargetControlID="hidConfirmDelete" PopupControlID="Panel2" DynamicServicePath="" Enabled="True">
                    </cc1:ModalPopupExtender>
                <uc1:MessageBox id="MessageBox1" runat="server">
                </uc1:MessageBox>
             </ContentTemplate>
        </asp:UpdatePanel>
</asp:Content>
