<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Cecam.Master" AutoEventWireup="true" CodeBehind="wfArquivoUpload.aspx.cs"
    Inherits="Cecam.PortalTransparencia.Web.Pages.wfArquivoUpload" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphConteudo" runat="server">
    <div class="cabecalho">
        Anexar Arquivos
    </div>
    <asp:UpdatePanel ID="uppCadastroArquivo" runat="server">
        <ContentTemplate>
            <dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" ShowHeader="false">
                <PanelCollection>
                    <dx:PanelContent>
                        <ul class="form1col">
                            <li>
                                <span class="titulo">Tela:</span>
                                <ccn:ComboBox runat="server" ID="cbxTela" OnDataSearch="cbxTela_DataSearch" Width="50%" TextField="Text" ValueField="Key"
                                    OnValueChanged="cbxTela_ValueChanged" AutoPostBack="true" ValidationGroup="Arquivo" IsRequired="true">
                                </ccn:ComboBox>
                            </li>
                            <li style="margin-top: 15px;">
                                <ccn:TreeList runat="server" ID="tltTeste" KeyFieldName="Id" ParentFieldName="IdPai" DataSourceID="customDataSource"
                                    SkinID="Edicao" OnDataIniting="tltTeste_DataIniting" OnDataRowCreated="tltTeste_DataRowCreated" Styles-Cell-Wrap="True">
                                    <Columns>
                                        <ccn:TreeDataColumn FieldName="Id" Visible="false" />
                                        <ccn:TreeDataColumn FieldName="IdPai" Visible="false" />
                                        <ccn:TreeDataColumn FieldName="Index" Visible="false" />
                                        <ccn:TreeDataTextColumn FieldName="Nome" Caption="Nome" Width="90%" />
                                        <dx:TreeListTextColumn Width="5%">
                                            <DataCellTemplate>
                                                <ccn:RadioButton ID="rblAtual" runat="server" OnCheckedChanged="rblAtual_CheckedChanged"
                                                    AutoPostBack="true" Checked='<%#Bind("IsSelecionado")%>' />
                                            </DataCellTemplate>
                                        </dx:TreeListTextColumn>
                                    </Columns>
                                </ccn:TreeList>
                            </li>
                        </ul>
                    </dx:PanelContent>
                </PanelCollection>
            </dx:ASPxRoundPanel>
            <asp:UpdatePanel ID="uppGridArquivo" runat="server" ClientIDMode="Static">
                <ContentTemplate>
                    <dx:ASPxRoundPanel ID="ASPxRoundPanel3" runat="server" ShowHeader="false">
                        <PanelCollection>
                            <dx:PanelContent>
                                <ul class="form1col">
                                    <li>
                                        <span class="titulo">Arquivo:</span>
                                        <ccn:Button runat="server" ID="btnPesquisar" SkinID="Pesquisar" OnClick="btnPesquisar_Click" Style="margin-top: -3px;" />
                                        <ccn:QuickUpload runat="server" ID="uplArquivo" FileExtensions=".pdf|.jpg|.txt|.csv|.xls" OnUploadComplete="uplArquivo_UploadComplete"
                                            OnUploadCompleted="uplArquivo_UploadCompleted" />
                                        <ccn:TextBox runat="server" ID="txtArquivo" Width="52%" ReadOnly="true" SkinID="TextLabel" IsRequired="true"
                                            ValidationGroup="Upload" />
                                    </li>
                                    <li>
                                        <span class="titulo">Resumo:</span>
                                        <ccn:Memo runat="server" ID="txtResumo" Width="61%" Rows="3" />
                                        <br />
                                        <span style="padding-left: 195px;">Para informar um link no resumo, é necessário colocar o link entre colchetes.</span>
                                        <br />
                                        <span style="padding-left: 195px;">Exemplo: [http://www.portaltransparencia.gov.br]</span>
                                    </li>
                                </ul>
                                <ul class="botoes">
                                    <li>
                                        <ccn:Button ID="btnSalvar" SkinID="Salvar" runat="server" ValidationGroup="Upload" OnClick="btnSalvar_Click" />
                                    </li>
                                    <li>
                                        <ccn:Button ID="btnCancelar" SkinID="Cancelar" runat="server" OnClick="btnCancelar_Click" />
                                    </li>
                                </ul>
                                <ul class="form1col">
                                    <li>
                                        <ccn:GridView runat="server" ID="gvwArquivo" KeyFieldName="Id" OnDataSearch="gvwArquivo_DataSearch"
                                            OnDataCommand="gvwArquivo_DataCommand" Styles-Cell-Wrap="True">
                                            <Columns>
                                                <ccn:GridDataColumn FieldName="Nome" Caption="Nome" />
                                                <ccn:GridCommandCustomColumn ButtonId="Editar" Name="Editar" Caption="Editar" ButtonType="Image"
                                                    ImageUrl="~/UI/img/ico-edit.png" VisibleIndex="8" Width="3%" />
                                                <ccn:GridCommandCustomColumn ButtonId="Excluir" Name="Excluir" Caption="Excluir" ButtonType="Image"
                                                    ImageUrl="~/UI/img/ico-excluir.png" VisibleIndex="9" Width="3%" />
                                            </Columns>
                                        </ccn:GridView>
                                    </li>
                                </ul>
                            </dx:PanelContent>
                        </PanelCollection>
                    </dx:ASPxRoundPanel>
                </ContentTemplate>
            </asp:UpdatePanel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <ccn:CustomObjectDataSource ID="customDataSource" runat="server" OnDataSearch="customDataSource_DataSearch" />
    <ccn:LoadingProgress ID="LoadingProgress1" runat="server" AssociatedUpdatePanelID="uppCadastroArquivo" Text="Aguarde..." />
</asp:Content>
