<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Cecam.master" AutoEventWireup="true" CodeBehind="wfPermission.aspx.cs" Inherits="Cecam.Domain.WebApp.Shared.Identity.wfPermission" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphConteudo" runat="server">
    <div class="cabecalho">
        Permissão de Acesso
    </div>
    <asp:UpdatePanel ID="uppRegra" runat="server">
        <ContentTemplate>
            <dx:ASPxRoundPanel ID="rpnRegra" runat="server">
                <PanelCollection>
                    <dx:PanelContent>
                        <ul class="form1col">
                            <li>
                                <span class="titulo">*Tipo:</span>
                                <ccn:ComboBox runat="server" ID="ddlRegra" TextField="Text" ValueField="Key" AutoPostBack="true"
                                    OnDataSearch="ddlRegra_DataSearch" OnSelectedIndexChanged="ddlRegra_SelectedIndexChanged" Width="20%"
                                    IsRequired="true" ValidationGroup="Regra" />
                            </li>
                            <li>
                                <ccn:LinkedSearch runat="server" ID="lksUsuario" LabelCaption="*Usuário:"
                                    ValueFieldName="Login" KeyFieldName="Id" TextFieldName="Nome" PopupCaption="Usuários" Width="20%|17.8%|0%"
                                    ValidationGroup="Regra" IsRequired="true" OnDataSearch="lksUsuario_DataSearch" OnDataSelected="lksUsuario_DataSelected" 
                                    ColumnFieldName="Login|Nome|Sobrenome" ColumnCaption="Login|Nome|Sobrenome" ColumnWidth="20%|40%|40%"/>

                                <ccn:LinkedSearch runat="server" ID="lksGrupo" LabelCaption="*Grupo:" Visible="false"
                                    ValueFieldName="Nome" KeyFieldName="Id" TextFieldName="Nome" PopupCaption="Grupos" Width="20%|17.8%|0%"
                                    ValidationGroup="Regra" IsRequired="true" OnDataSearch="lksGrupo_DataSearch" OnDataSelected="lksGrupo_DataSelected"
                                    ColumnFieldName="Nome|Descricao" ColumnCaption="Nome|Descrição" ColumnWidth="30%|70%" />
                            </li>
                        </ul>
                    </dx:PanelContent>
                </PanelCollection>
            </dx:ASPxRoundPanel>
            <dx:ASPxRoundPanel ID="rpnGrid" runat="server">
                <PanelCollection>
                    <dx:PanelContent>
                        <ccn:TreeList ID="trlRegra"
                            runat="server"
                            KeyFieldName="Id"
                            ParentFieldName="IdPai"
                            DataSourceID="customObjectDataSource">
                            <SettingsSelection Enabled="true" AllowSelectAll="true" Recursive="true" />
                            <SettingsBehavior AutoExpandAllNodes="true" />
                            <Columns>
                                <ccn:TreeDataColumn FieldName="IsGrupo" Visible="false" />
                                <ccn:TreeDataColumn FieldName="Id" Visible="false" />
                                <ccn:TreeDataColumn FieldName="Nome" Caption="Nome" Width="50%" AllowEdit="false" />
                                <ccn:TreeDataColumn FieldName="Legenda" Caption="Legenda" Width="50%" AllowEdit="false" />
                            </Columns>
                        </ccn:TreeList>
                        <ccn:CustomObjectDataSource ID="customObjectDataSource" runat="server" OnDataSearch="customObjectDataSource_DataSearch" />
                    </dx:PanelContent>
                </PanelCollection>
            </dx:ASPxRoundPanel>
            <ul class="botoes">
                <li>
                    <ccn:Button ID="btnSalvar" runat="server" SkinID="Salvar" OnClick="btnSalvar_Click" ValidationGroup="Regra" />
                </li>
                <li>
                    <ccn:Button ID="btnCancelar" runat="server" SkinID="Cancelar" OnClick="btnCancelar_Click" />
                </li>
            </ul>
        </ContentTemplate>
    </asp:UpdatePanel>
    <ccn:LoadingProgress runat="server" ID="ldpRegra" AssociatedUpdatePanelID="uppRegra" Text="Aguarde.." />
</asp:Content>