<%@ Page Language="vb" MasterPageFile="~/CITAD.Master" AutoEventWireup="false" Codebehind="GroupDetail.aspx.vb"
    Inherits="CITAD.WEB.VB.GroupDetail" Culture="auto" meta:resourcekey="PageResource1"
    UICulture="auto" Title="Thông tin chi tiết nhóm sử dụng" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="../../Controls/MessageBox.ascx" TagName="MessageBox" TagPrefix="uc1" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script language="javascript" type="text/javascript">
        window.document.onkeyup=ShortcutKeys;
        function ShortcutKeys()
        {
                if(event.ctrlKey) //btnSave
                {
                    if(window.event.keyCode==83)    
                    {
                        document.getElementById('ctl00$ContentPlaceHolder1$btnSave').click();
                    }
                    
                       if(window.event.keyCode==8)    //  trở về danh sách Ctrl + BackSpace
                    {
                        document.getElementById('ctl00$ContentPlaceHolder1$BtnClose').click();
                    }
                }
                //alert(event.keyCode);
        }
        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">
        <ContentTemplate>
            <table width="770" cellpadding="0" cellspacing="2" border="0">
                <tr>
                    <td style="width: 100%;" valign="top" align="center">
                        <div>
                            <fieldset style="width: 500px;"> <!---->
                                <legend>
                                    <asp:Label ID="Label1" runat="server" Text="Thông tin của nh&#243;m" meta:resourcekey="Label1Resource1"></asp:Label></legend>
                                <table width="100%">
                                    <tr>
                                        <td colspan="2">
                                            &nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td style="width: 115px" align="right" valign="top">
                                            <asp:Label ID="lblTenNhom" runat="server" Text="T&#234;n nh&#243;m sử dụng" meta:resourcekey="lblTenNhomResource1"></asp:Label></td>
                                        <td style="width: 330px" valign="top">
                                            <asp:TextBox ID="txtGroupName" runat="server" CssClass="citad-txt" Width="330px"
                                                meta:resourcekey="txtGroupNameResource1" MaxLength="16"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td align="center" colspan="2">
                                            <asp:RequiredFieldValidator ID="rfvGroupName" runat="server" ControlToValidate="txtGroupName"
                                                ErrorMessage="Chưa nhập tên nhóm người sử dụng" ValidationGroup="NhomNguoiSuDung"
                                                Display="Dynamic" SetFocusOnError="True" meta:resourcekey="rfvGroupNameResource1"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 115px" align="right" valign="top">
                                            <asp:Label ID="lblNgayThanhLap" runat="server" Text="Ng&#224;y th&#224;nh lập" meta:resourcekey="lblNgayThanhLapResource1"></asp:Label></td>
                                        <td style="width: 330px" align="left" valign="top">
                                            <asp:TextBox ID="dtpDateCreated" runat="server" Width="100px" CssClass="citad-txt"
                                                meta:resourcekey="dtpDateCreatedResource1" MaxLength="10"></asp:TextBox>
                                            <asp:ImageButton ID="imgCalendar2" runat="server" ImageUrl="~/Images/Calendar.png"
                                                meta:resourcekey="imgCalendarResource1" /></td>
                                    </tr>
                                    <tr>
                                        <td style="width: 115px" align="right" valign="top">
                                            <asp:Label ID="lblTinhTrang" runat="server" Text="T&#236;nh trạng sử dụng" meta:resourcekey="lblTinhTrangResource1"></asp:Label></td>
                                        <td style="width: 330px" valign="top">
                                            <table width="100%">
                                                <tr>
                                                    <td style="width: 123px; height: 22px;">
                                                        <asp:RadioButton ID="rdbDangSuDung" runat="server" Text="Đang sử dụng" GroupName="grpTinhTrang"
                                                            Checked="True" meta:resourcekey="rdbDangSuDungResource1" AutoPostBack="True" OnCheckedChanged="rdbDangSuDung_CheckedChanged" /></td>
                                                    <td style="height: 22px; width: 116px;">
                                                        <asp:RadioButton ID="rdbKhongSuDung" runat="server" Text="Kh&#244;ng sử dụng" GroupName="grpTinhTrang"
                                                            meta:resourcekey="rdbKhongSuDungResource1" AutoPostBack="True" OnCheckedChanged="rdbKhongSuDung_CheckedChanged" /></td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td valign="top" style="width: 115px; height: 60px;" align="right">                           
                                            <asp:Label ID="Label10" runat="server" Text="M&#244; tả" meta:resourcekey="Label10Resource1"></asp:Label></td>
                                        <td style="width: 330px; height: 60px;" valign="top">
                                            <asp:TextBox ID="txtDescription" runat="server" Height="56px" Width="330px" CssClass="citad-txt"
                                                meta:resourcekey="txtDescriptionResource1" MaxLength="200"></asp:TextBox></td>
                                    </tr>
                                </table>
                                
                            </fieldset>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td style="width: 100%;" valign="top" align="center">
                        <div>
                            <fieldset style="width: 500px;"> <!---->
                                <legend>
                                    <asp:Label ID="Label2" runat="server" Text="Danh sách thành viên" meta:resourcekey="Label2Resource1"></asp:Label></legend>                                
                                <table width="500px" cellpadding="0" cellspacing="0" border="0">
                                    <tr>
                                        <td style="height: 232px">
                                            <fieldset style="width: 200px; height: 200px">
                                                <legend>
                                                    <asp:Label ID="Label4" runat="server" Text="Thành viên thuộc nhóm" meta:resourcekey="Label4Resource1"></asp:Label>
                                                </legend>
                                                <asp:GridView ID="dgvUser" runat="server" CellPadding="1" CssClass="grid" AllowPaging="True"
                                                    AutoGenerateColumns="False" DataKeyNames="USER_ID" meta:resourcekey="dgvGroupResource1"
                                                    PageSize="6" OnPageIndexChanging="dgvUser_PageIndexChanging1" OnRowDataBound="dgvUser_RowDataBound1">
                                                    <FooterStyle CssClass="grid-footer" />
                                                    <RowStyle CssClass="grid-row" />
                                                    <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="chkCheckAll1" runat="server" onclick="return CheckAll(this,'chkUsed1');"
                                                                    meta:resourcekey="chkCheckAllResource1" />
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                <input id="chkUsed1" runat="server" type="checkbox" />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField HeaderText="STT" meta:resourcekey="BoundFieldResource1">
                                                            <HeaderStyle Width="30px" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="USER_NAME" HeaderText="Tên người dùng" meta:resourcekey="BoundFieldResource2" />
                                                    </Columns>
                                                    <EmptyDataTemplate>
                                                        <asp:Label ID="lblMsg" runat="server" meta:resourcekey="lblMsgResource1" Text="Chưa có thành viên nào"></asp:Label>
                                                    </EmptyDataTemplate>
                                                </asp:GridView>
                                            </fieldset>
                                        </td>
                                        <td style="height: 232px">
                                            <div style="text-align: center;">
                                                <asp:ImageButton ID="btnSelect" runat="server" ImageUrl="~/Images/group_up.gif" OnClick="btnSelect_Click" /><br />
                                                <asp:ImageButton ID="btnDeselect" runat="server" ImageUrl="~/Images/group_down.gif"
                                                    OnClick="btnDeselect_Click" />
                                            </div>
                                        </td>
                                        <td style="width: 234px; height: 232px">
                                            <fieldset style="width: 200px; height: 200px">
                                                <legend>
                                                    <asp:Label ID="lblDeselectedGroup" runat="server" Text="Thành viên chưa thuộc nhóm"
                                                        meta:resourcekey="lblDeselectedGroupResource1"></asp:Label>
                                                </legend>
                                                <asp:GridView ID="dgvDeselectedUser" CellPadding="1" CssClass="grid" runat="server"
                                                    AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="USER_ID" PageSize="6"
                                                    OnPageIndexChanging="dgvDeselectedUser_PageIndexChanging" OnRowDataBound="dgvDeselectedUser_RowDataBound"
                                                    Width="200px">
                                                    <FooterStyle CssClass="grid-footer" />
                                                    <RowStyle CssClass="grid-row" />
                                                    <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="chkCheckAll2" runat="server" onclick="return CheckAll(this,'chkUsed2');"
                                                                    meta:resourcekey="chkCheckAllResource1" />
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                <input id="chkUsed2" runat="server" type="checkbox" />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField HeaderText="STT" meta:resourcekey="BoundFieldResource1">
                                                            <HeaderStyle Width="30px" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="USER_NAME" HeaderText="T&#234;n người d&#249;ng" meta:resourcekey="BoundFieldResource2" />
                                                    </Columns>
                                                    <EmptyDataTemplate>
                                                        <asp:Label ID="lblMsg2" runat="server" meta:resourcekey="lblMsgResource2" Text="Không có người chưa tham gia."></asp:Label>
                                                    </EmptyDataTemplate>
                                                </asp:GridView>
                                            </fieldset>
                                        </td>
                                    </tr>
                                </table>
                            </fieldset>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td valign="top" align="center">
                        <asp:Button ID="btnSave" runat="server" ValidationGroup="NhomNguoiSuDung" Text="Ghi"
                            Width="64px" meta:resourcekey="btnSaveResource1" />
                        <asp:Button ID="BtnClose" runat="server" Text="Đ&#243;ng" Width="64px" meta:resourcekey="btnCloseResource1"
                            OnClick="BtnClose_Click" /></td>
                </tr>
            </table>
            <asp:HiddenField ID="hidGroupID" runat="server" />
            <cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="dtpDateCreated"
                Enabled="True" Format="dd/MM/yyyy" PopupButtonID="imgCalendar2">
            </cc1:CalendarExtender>
            <cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="dtpDateCreated"
                AcceptNegative="Left" ErrorTooltipEnabled="True" MaskType="Date" Mask="99/99/9999"
                CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat=""
                CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder=""
                CultureTimePlaceholder="" Enabled="True">
            </cc1:MaskedEditExtender>
            <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" />
            <uc1:MessageBox ID="MessageBox1" runat="server"></uc1:MessageBox>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

