<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/WFAdmin/AdmMaster.Master" CodeBehind="Users.aspx.vb" Inherits="WebFoundations.WFPortal.UI.Users" %>
<%@ Register Src="../../WFControls/RoleSelect.ascx" TagName="RoleSelect" TagPrefix="uc2" %>
<%@ Register Src="../../WFControls/RoleGroupSelect.ascx" TagName="RoleGroupSelect" TagPrefix="uc3" %>
<%@ Register Src="../../WFControls/WFPagePicker.ascx" TagName="WFPagePicker" TagPrefix="uc1" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="wff" Namespace="WebFoundations.ServerControls" Assembly="WebFoundations.ServerControls" %>

<asp:Content ContentPlaceHolderID="TagHead" runat="server">
    <script type="text/javascript">
        var MySelectedItem = 0;
        function postBackDelete(hiddenFieldID) {
            var hiddenField = $get(hiddenFieldID);
            if (hiddenField) {
                hiddenField.value = 'DELETE' + MySelectedItem;
                MySelectedItem = 0;
                __doPostBack(hiddenFieldID, '');
            }
        }
        function postBackHiddenField(hiddenFieldID) {
            var hiddenField = $get(hiddenFieldID);
            if (hiddenField) {
                hiddenField.value = (new Date()).getTime();
                __doPostBack(hiddenFieldID, '');
            }
        }
    </script>
</asp:Content>

<asp:Content ContentPlaceHolderID="ActionContent" runat="server">
    <ul>
        <li>
            <asp:HyperLink ID="lnkadd" runat="server" CssClass="add" /></li>
        <li>
            <asp:HyperLink ID="lnkedit" runat="server" CssClass="edit" /></li>
        <li>
            <asp:HyperLink ID="lnkdelete" runat="server" CssClass="delete" /></li>
        <li>
            <asp:HyperLink ID="lnkrefresh" runat="server" CssClass="refresh" /></li>
        <li>
            <asp:LinkButton ID="lnkExport" runat="server" CssClass="export" /></li>
        <li>
            <asp:HyperLink ID="lnkClone" runat="server" CssClass="copy" /></li>
    </ul>
</asp:Content>

<asp:Content ContentPlaceHolderID="FilterContent" runat="server">
    <div class="fields">
        <asp:PlaceHolder ID="phportal" runat="server">
        <label>
            <asp:Label ID="lblportal" runat="server" />
            <uc1:WFPagePicker ID="portalpicker" runat="server" AddSelect="false" AdminMode="true" class="filterfield"
                AutoSelectLast="true" ShowArea="false" ShowPage="false" NoLabels="true" />
        </label></asp:PlaceHolder>
        <label>
            <asp:Label ID="lblname" runat="server" />
            <asp:TextBox ID="txtusername" runat="server" ValidationGroup="SEARCH" />
        </label>
        <label>
            <asp:Label ID="lblgroup" runat="server" />
            <div><uc2:RoleSelect ID="rolepicker" runat="server" /></div>
        </label>
        <label>
            <asp:Label ID="lblprofile" runat="server" />
            <div><uc3:RoleGroupSelect ID="rolegrouppicker" runat="server" /></div>
        </label>
        <label>
            <asp:Label ID="lblStatus" runat="server" />
            <asp:DropDownList ID="ddlStatus" runat="server" />
        </label>
    </div>
    <asp:Button ID="btnbuscar" runat="server" ValidationGroup="SEARCH" CssClass="search" />
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ObjectDataSource ID="UserODS" runat="server" SelectMethod="GetItems"
        TypeName="WebFoundations.WFPortal.Management.ObjectDataSources.User"
        EnablePaging="True" SortParameterName="column" SelectCountMethod="CountItems"
        MaximumRowsParameterName="MaximumRows" StartRowIndexParameterName="StartRowIndex">
        <SelectParameters>
            <asp:ControlParameter ControlID="ctl00$FilterContent$portalpicker" Name="PortalId" PropertyName="CurrentPortal" Type="Int32" />
            <asp:ControlParameter ControlID="ctl00$FilterContent$txtusername" Name="UserName" PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="ctl00$FilterContent$rolepicker" Name="UserRole" PropertyName="SelectedId" Type="Int32" />
            <asp:ControlParameter ControlID="ctl00$FilterContent$rolegrouppicker" Name="UserRoleGroup" PropertyName="SelectedId" Type="Int32" />
            <asp:ControlParameter ControlID="ctl00$FilterContent$ddlStatus" Name="UserStatus" PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <div class="posLoading">
        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="updateform">
            <ProgressTemplate>
                <div class="up-loading"></div>
            </ProgressTemplate>
        </asp:UpdateProgress>
    </div>
    <asp:UpdatePanel ID="updateform" runat="server">
        <ContentTemplate>
            <telerik:RadGrid ID="grdUser" runat="server" AutoGenerateColumns="false" AllowSorting="True" GridLines="None" AllowPaging="True" PageSize="15">
                <MasterTableView>
                    <Columns>
                        <telerik:GridBoundColumn DataField="Id" HeaderText="Id" UniqueName="Id" ItemStyle-HorizontalAlign="center" />
                        <telerik:GridBoundColumn DataField="Guid" HeaderText="Guid" UniqueName="Guid" ItemStyle-HorizontalAlign="center" />
                        <telerik:GridBoundColumn DataField="FullName" HeaderText="FullName" UniqueName="FullName" ItemStyle-HorizontalAlign="center" />
                        <telerik:GridBoundColumn DataField="Email" HeaderText="Email" UniqueName="Email" ItemStyle-HorizontalAlign="center" />
                        <telerik:GridBoundColumn DataField="Login" HeaderText="Login" UniqueName="Login" ItemStyle-HorizontalAlign="center" />
                        <telerik:GridBoundColumn DataField="WinLogon" HeaderText="WinLogon" UniqueName="WinLogon" ItemStyle-HorizontalAlign="center" />
                    </Columns>
                </MasterTableView>
                <ClientSettings AllowColumnsReorder="false" AllowDragToGroup="false"
                    AllowColumnHide="false"
                    Selecting-AllowRowSelect="true" Scrolling-AllowScroll="false"
                    Scrolling-UseStaticHeaders="true">
                </ClientSettings>
                <ExportSettings ExportOnlyData="True" FileName="Users" IgnorePaging="True" OpenInNewWindow="True" />
            </telerik:RadGrid><asp:HiddenField ID="PostBackHidden" runat="server"></asp:HiddenField>
            <asp:HiddenField ID="SelectedPortalId" runat="server"></asp:HiddenField>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="ctl00$FilterContent$btnbuscar" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="PostBackHidden" EventName="ValueChanged" />
        </Triggers>
    </asp:UpdatePanel>
    <wff:WindowManager ID="EditWindow" runat="server">
        <Windows>
            <telerik:RadWindow ID="EditDialog" runat="server" Height="760px" Width="900px" ReloadOnShow="true" Modal="true" />
        </Windows>
    </wff:WindowManager>
</asp:Content>

