<%@ Page Language="C#" MasterPageFile="~/masterpages/eDashboard.master" AutoEventWireup="True" Inherits="site_AccessManagement_Groups_AssignDetail"
    Theme="eMain" Title="eSecuritel Group Assign" Culture="auto"
    UICulture="auto" Codebehind="AssignDetail.aspx.cs" %>

<%@ Register Src="~/Controls/ScriptingHelper.ascx" TagName="ScriptingHelper" TagPrefix="uc" %>
<%@ Register Src="~/Controls/AccessGridOperator.ascx" TagName="GridOperator" TagPrefix="uc" %>
<%@ Register Src="~/Controls/CustomSorter.ascx" TagName="CustomSorter"
    TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="eContent" runat="Server">

    <script src="../../../script/eSetFormControls.js" type="text/javascript"></script>

    <script src="../../../script/eGridHelper.js" type="text/javascript"></script>

    <uc:ScriptingHelper ID="ScriptingHelper1" runat="server" />
    <h1>
        <asp:Literal ID="m_litSubHeader" runat="server" Text="<%$ Resources: SecurityManagement, LabelAssignGroup %>" /><asp:Label
            ID="m_lblGroupType" runat="server"></asp:Label></h1>
    <!-------------------------------------------- User Search ---------------------------------------->
    <h2>
        <asp:Literal ID="m_litSearchUsersHeader" runat="server" Text="<%$ Resources: UsersManagement, LabelSearchUserCriteria %>"
            /></h2>
    <table border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td align = "right" style="width: 100px">
                <asp:Literal ID="m_litFirstName" runat="server" Text="<%$ Resources: UsersManagement, LabelUserFirstName %>" /></td>
            <td style="width: 250px">
                <asp:TextBox ID="m_txtFirstName" runat="server" Width="165px"></asp:TextBox></td>
            <td align = "right" style="width: 150px">
                <asp:Literal ID="m_litLastName" runat="server" Text="<%$ Resources: UsersManagement, LabelUserLastName %>" /></td>
            <td>
                <asp:TextBox ID="m_txtLastName" runat="server" Width="165px"></asp:TextBox></td>
        </tr>
        <tr>
            <td align = "right">
                <asp:Literal ID="m_litActive" runat="server" Text="<%$ Resources: UsersManagement, LabelUserActive %>" /></td>
            <td>
                <asp:DropDownList ID="m_ddlActive" runat="server">
                    <asp:ListItem Text="<%$ Resources: Default, BothListItem %>" Value="B" />
                    <asp:ListItem Text="<%$ Resources: Default, YesListItem %>" Value="Y" />
                    <asp:ListItem Text="<%$ Resources: Default, NoListItem %>" Value="N" />
                </asp:DropDownList></td>
            <td align = "right">
                <asp:Literal ID="m_litOrganizatinUnit" runat="server" Text="<%$ Resources: OrganizationManagement, OrganizationUnitLabel %>" /></td>
            <td>
                <asp:TextBox ID="m_txtOrgUnit" runat="server" Width="165px"></asp:TextBox></td>
        </tr>
    </table>
    <br />
    <!--------------------------------------Advanced User Search --------------------------->
    <div class="subpanelAddition">
        <div class="subpanelheader hr">
            <img src="~/images/Collapse_13x13.jpg" class="showstate" onclick="expandcontent(this, 'm_pnlAdditionalCriteria')"
                alt="contract" />
            <asp:Literal ID="m_litAdditionalSearchCriteriaHeader" runat="server" Text="<%$ Resources: Default, AdditionalSearchCriteriaLabel %>"
                /></div>
        <div id="m_pnlAdditionalCriteria" class="switchcontent">
            <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td align = "right" style="width: 100px">
                        <asp:Literal ID="m_litEmail" runat="server" Text="<%$ Resources: UsersManagement, LabelUserEmail %>" /></td>
                    <td style="width: 250px">
                        <asp:TextBox ID="m_txtEmail" runat="server" Width="165px"></asp:TextBox></td>
                    <td align = "right" style="width: 150px">
                        <asp:Literal ID="m_litLogin" runat="server" Text="<%$ Resources: UsersManagement, LabelUserLogin %>" /></td>
                    <td>
                        <asp:TextBox ID="m_txtLogin" runat="server" Width="165px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td align = "right">
                        <asp:Literal ID="m_litWorkPhone" runat="server" Text="<%$ Resources: UsersManagement, LabelWorkPhoneColon %>" /></td>
                    <td>
                        <asp:TextBox ID="m_txtPhoneNumber" runat="server" Width="80px" MaxLength="12"></asp:TextBox>
                        <span style="font-size: xx-small;">
                            <asp:Literal ID="m_litExamplePhoneNumber" runat="server" Text="<%$ Resources: UsersManagement, LabelExamplexxxxxxxxxx %>"
                                /></span></td>
                    <td align = "right">
                        <asp:Literal ID="m_litPhoneExtension" runat="server" Text="<%$ Resources: UsersManagement, LabelUserExtColon %>" /></td>
                    <td>
                        <asp:TextBox ID="m_txtPhoneExtension" runat="server" Width="45px" MaxLength="6"></asp:TextBox></td>
                </tr>
            </table>
        </div>
    </div>
    <div>
        <asp:Button ID="m_btnSearch" runat="server" Text="<%$ Resources: Default, ButtonSetFilter %>" CssClass="pagebutton"
            OnClick="m_btnSearch_Click" />
        <asp:Button ID="m_btnClear" CssClass="pagebutton" runat="server" Text="<%$ Resources: Default, ButtonClear %>" />
    </div>
    <br />
    <!-------------------------------------------- User Search Results ---------------------------------------->
    <asp:Panel ID="m_pnlStatus" runat="server" Visible="False">
        <hr />
        <asp:Label ID="m_lblStatus" runat="server" />
        <hr />
    </asp:Panel>
    <asp:Panel ID="m_pnlGridUsers" runat="server" Visible="False">
        <hr />
        <uc:GridOperator ID="m_grdOperatorUsers" runat="server" />
        <asp:GridView ID="m_grdUsers" runat="server" AutoGenerateColumns="False" AllowPaging="True"
            OnRowDataBound="grdUsers_RowDataBound" PageSize="1000">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <table id="tblUserGridHeader" runat="server">
                            <tr valign="top" runat="server">
                                <td runat="server">
                                    <div style="overflow: hidden; width: 7px; height: 25px;">
                                        &nbsp;</div>
                                </td>
                                <td runat="server">
                                    <div style="text-align: left; overflow: hidden; width: 90px; height: 25px;">
                                        <asp:Literal ID="m_litUserGridLoginColumnHeader" runat="server" Text="<%$ Resources: UsersManagement, HeaderTextUserLogin %>" />
                                        <br />
                                        <uc:CustomSorter ID="m_csLogin" runat="server" OnSortAscendingClicked="customSorter_SortClicked"
                                            OnSortDescendingClicked="customSorter_SortClicked" SortExpression="Login" />
                                    </div>
                                </td>
                                <td runat="server">
                                    <div style="text-align: left; overflow: hidden; width: 90px; height: 25px;">
                                        <asp:Literal ID="m_litUserGridLastNameColumnHeader" runat="server" Text="<%$ Resources: UsersManagement, HeaderTextUserLastName %>" />
                                        <br />
                                        <uc:CustomSorter ID="m_csLastname" runat="server" OnSortAscendingClicked="customSorter_SortClicked"
                                            OnSortDescendingClicked="customSorter_SortClicked" SortExpression="LastName" />
                                    </div>
                                </td>
                                <td runat="server">
                                    <div style="text-align: left; overflow: hidden; width: 90px; height: 25px;">
                                        <asp:Literal ID="m_litUserGridFirstNameColumnHeader" runat="server" Text="<%$ Resources: UsersManagement, HeaderTextUserFirstName %>" /></div>
                                </td>
                                <td runat="server">
                                    <div style="text-align: left; overflow: hidden; width: 180px; height: 25px;">
                                        <asp:Literal ID="m_litUserGridDepartmentsColumnHeader" runat="server" Text="<%$ Resources: UsersManagement, HeaderTextUserDepartments %>" />
                                    </div>
                                </td>
                                <td runat="server">
                                    <div style="text-align: left; overflow: hidden; width: 45px; height: 25px;">
                                        <asp:Literal ID="m_litUserGridActiveColumnHeader" runat="server" Text="<%$ Resources: UsersManagement, HeaderTextUserActive %>" />
                                        <br />
                                        <uc:CustomSorter ID="m_csActive" runat="server" OnSortAscendingClicked="customSorter_SortClicked"
                                            OnSortDescendingClicked="customSorter_SortClicked" SortExpression="Active" />
                                    </div>
                                </td>
                                <td runat="server">
                                    <div style="text-align: left; overflow: hidden; width: 95px; height: 25px;">
                                        <asp:Literal ID="m_litUserGridWorkPhoneColumnHeader" runat="server" Text="<%$ Resources: UsersManagement, HeaderTextUserWorkPhone %>" />
                                    </div>
                                </td>
                                <td runat="server">
                                    <div style="text-align: left; overflow: hidden; width: 35px; height: 25px;">
                                        <asp:Literal ID="m_litUserGridExtColumnHeader" runat="server" Text="<%$ Resources: UsersManagement, HeaderTextUserExt %>" />
                                    </div>
                                </td>
                                <td runat="server">
                                    <div style="text-align: left; overflow: hidden; width: 160px; height: 25px;">
                                        <asp:Literal ID="m_litUserGridEmailColumnHeader" runat="server" Text="<%$ Resources: UsersManagement, HeaderTextUserEmail %>" />
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table id="tblGridUserDetails" runat="server">
                            <tr runat="server">
                                <td align="center" style="background-color: #585d7d; color: #fff;" runat="server">
                                    <asp:Label ID="m_lblCompanyName" runat="server" Font-Bold="True" /></td>
                            </tr>
                            <tr runat="server">
                                <td runat="server">
                                    <asp:GridView ID="m_grdUsersDetails" OnRowCommand="grdUsersDetails_RowCommand" runat="server"
                                        AutoGenerateColumns="False" OnRowDataBound="grdUsersDetails_RowDataBound">
                                        <Columns>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <div style="overflow: hidden; width: 17px; height: 24px;">
                                                        <asp:CheckBox ID="m_chkSelectUser" runat="server" CssClass="AutoCheck" />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <div style="overflow: hidden; width: 90px; height: 25px;">
                                                        <asp:LinkButton ID="m_lbLogin" runat="server" Font-Underline="true" />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <div style="overflow: hidden; width: 90px; height: 25px;">
                                                        <asp:Label ID="m_lblLastName" runat="server" />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <div style="overflow: hidden; width: 90px; height: 25px;">
                                                        <asp:Label ID="m_lblFirstName" runat="server" />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <div style="overflow: hidden; width: 180px;">
                                                        <asp:Label ID="m_lblDepartments" runat="server" />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <div style="overflow: hidden; width: 45px; height: 25px; text-align: center;">
                                                        <asp:Label ID="m_lblActive" runat="server" />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <div style="overflow: hidden; width: 95px; height: 25px;">
                                                        <asp:Label ID="m_lblWorkPhone" runat="server" />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <div style="overflow: hidden; width: 35px; height: 25px;">
                                                        <asp:Label ID="m_lblExtension" runat="server" />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <div style="overflow: hidden; width: 160px; height: 25px;">
                                                        <asp:HyperLink ID="m_hypUserEmail" runat="server" CssClass="EmailBox" Font-Underline="true" />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                    </asp:GridView>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </asp:Panel>
    <asp:Label ID="m_lblNoUserResultsFound" Font-Bold="True" ForeColor="Red" runat="server"
        Visible="False" />
    <asp:ObjectDataSource ID="m_odsUser" runat="server" SelectMethod="Select" SelectCountMethod="SelectCount"
        TypeName="UserDataSource" EnablePaging="True">
        <SelectParameters>
            <asp:Parameter Name="userData" Type="Object" />
            <asp:SessionParameter Name="userSortExpression" SessionField="userSortExpression"
                Type="Object" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <div>
        <asp:Button ID="m_btnAssign" runat="server" Text="<%$ Resources: Default, ButtonConfirm %>" OnClick="m_btnAssign_Click"
            Visible="false" CssClass="pagebutton" />
        <asp:Button ID="m_btnCancel" runat="server" Text="<%$ Resources: Default, ButtonCancel %>" CausesValidation="False"
            OnClick="m_btnCancel_Click" CssClass="pagebutton" />
    </div>
</asp:Content>
