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

<asp:Content ID="Content1" ContentPlaceHolderID="cphConteudo" runat="server">
    <div class="cabecalho">
        Grupos de Usuário
    </div>

    <asp:UpdatePanel ID="uppUserGroup" runat="server">
        <ContentTemplate>
            <asp:MultiView runat="server" ID="mltGrupo" ActiveViewIndex="0">
                <asp:View runat="server" ID="vwConsulta">
                    <dx:ASPxRoundPanel ID="rpnConsulta" runat="server">
                        <PanelCollection>
                            <dx:PanelContent>
                                <ul class="botoes">
                                    <li>
                                        <ccn:Button ID="btnNovo" SkinID="Novo" BackColor="" runat="server"
                                            ValidationGroup="Grupo" OnClick="btnNovo_Click" />
                                    </li>
                                </ul>
                                <ccn:GridView ID="grvConsulta" runat="server" KeyFieldName="Id"
                                    OnDataSearch="grvConsulta_DataSearch"
                                    OnDataDeleting="grvConsulta_DataDeleting" OnDataSelecting="grvConsulta_DataSelecting">
                                    <Columns>
                                        <ccn:GridCommandSelectEditColumn />
                                        <ccn:GridCommandDeleteColumn />
                                        <ccn:GridDataColumn Caption="Nome" FieldName="Nome" Width="20%" />
                                        <ccn:GridDataColumn Caption="Email" FieldName="Email" Width="20%" />
                                        <ccn:GridDataColumn Caption="Descrição" FieldName="Descricao" Width="40%" />
                                        <ccn:GridDataColumn Caption="Administrador" FieldName="IsAdmin" Width="10%" />
                                        <ccn:GridDataColumn Caption="Ativo" FieldName="IsAtivo" Width="10%" />
                                    </Columns>
                                </ccn:GridView>
                            </dx:PanelContent>
                        </PanelCollection>
                    </dx:ASPxRoundPanel>
                </asp:View>
                <asp:View runat="server" ID="vwCadastro">
                    <dx:ASPxRoundPanel ID="rpnCadastro" runat="server">
                        <PanelCollection>
                            <dx:PanelContent>
                                <ul class="form1col">
                                    <li>
                                        <span class="titulo">*Nome:</span>
                                        <ccn:TextBox ID="txtNome" runat="server" Width="60%"
                                            MaxLength="200" IsRequired="true" ValidationGroup="Grupo" />
                                    </li>
                                    <li>
                                        <span class="titulo">Email:</span>
                                        <ccn:TextBox ID="txtEmail" runat="server" Width="60%" />
                                    </li>
                                    <li>
                                        <span class="titulo">Descrição</span>
                                        <ccn:Memo ID="mmoDescricao" runat="server" Width="60%" MaxLength="500" />
                                    </li>
                                    <li>
                                        <span class="titulo">Administrador:</span>
                                        <ccn:CheckBox ID="ckbAdmin" runat="server" />
                                    </li>
                                    <li>
                                        <span class="titulo">Ativo:</span>
                                        <ccn:CheckBox ID="ckbAtivo" runat="server" />
                                    </li>
                                </ul>
                            </dx:PanelContent>
                        </PanelCollection>
                    </dx:ASPxRoundPanel>
                    <dx:ASPxRoundPanel ID="rpnUsuarios" runat="server" SkinID="Grupo" HeaderText="Usuários">
                        <PanelCollection>
                            <dx:PanelContent>
                                <ul class="botoes">
                                    <li>
                                        <ccn:SearchSelection ID="sslUsers" runat="server" KeyFieldName="Id" ButtonSkinID="Adicionar"
                                            PopupCaption="Usuários" OnDataSearch="sslUsers_DataSearch" OnDataSelected="sslUsers_DataSelected"
                                            ColumnCaption="Login|Nome|Sobrenome|Email" ColumnFieldName="Login|Nome|Sobrenome|Email" ColumnWidth="25%|25%|25%|25%" />
                                    </li>
                                </ul>
                                <ccn:GridView ID="grvUsuario" runat="server" SkinID="Pesquisa" KeyFieldName="Id" OnDataSearch="grvUsuario_DataSearch" OnDataDeleting="grvUsuario_DataDeleting">
                                    <Columns>
                                        <ccn:GridCommandDeleteColumn />
                                        <ccn:GridDataColumn Caption="Login" FieldName="Usuario.Login" Width="25%" />
                                        <ccn:GridDataColumn Caption="Nome" FieldName="Usuario.Nome" Width="25%" />
                                        <ccn:GridDataColumn Caption="Sobrenome" FieldName="Usuario.Sobrenome" Width="25%" />
                                        <ccn:GridDataColumn Caption="Email" FieldName="Usuario.Email" Width="25%" />
                                    </Columns>
                                </ccn:GridView>
                            </dx:PanelContent>
                        </PanelCollection>
                    </dx:ASPxRoundPanel>
                    <ul class="botoes">
                        <li>
                            <ccn:Button ID="btnSalvar" SkinID="Salvar" runat="server" ValidationGroup="Grupo" OnClick="btnSalvar_Click" />
                        </li>
                        <li>
                            <ccn:Button ID="btnCancelar" SkinID="Cancelar" runat="server" OnClick="btnCancelar_Click" />
                        </li>
                    </ul>
                    <ul class="voltar">
                        <li>
                            <ccn:Button ID="btnVoltar" SkinID="Voltar" runat="server" OnClick="btnVoltar_Click">
                            </ccn:Button>
                        </li>
                    </ul>
                </asp:View>
            </asp:MultiView>
        </ContentTemplate>
    </asp:UpdatePanel>
    <ccn:LoadingProgress ID="ldpLoading" runat="server" AssociatedUpdatePanelID="uppUserGroup" Text="Aguarde..." />
</asp:Content>