<?php
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *                                   ATTENTION!
 * If you see this message in your browser (Internet Explorer, Mozilla Firefox, Google Chrome, etc.)
 * this means that PHP is not properly installed on your web server. Please refer to the PHP manual
 * for more details: http://php.net/manual/install.php 
 *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 */

    include_once dirname(__FILE__) . '/components/startup.php';
    include_once dirname(__FILE__) . '/components/application.php';
    include_once dirname(__FILE__) . '/' . 'authorization.php';


    include_once dirname(__FILE__) . '/' . 'database_engine/mysql_engine.php';
    include_once dirname(__FILE__) . '/' . 'components/page/page_includes.php';

    function GetConnectionOptions()
    {
        $result = GetGlobalConnectionOptions();
        $result['client_encoding'] = 'utf8';
        GetApplication()->GetUserAuthentication()->applyIdentityToConnectionOptions($result);
        return $result;
    }

    
    
    
    // OnBeforePageExecute event handler
    
    
    
    class profissionais01Page extends Page
    {
        protected function DoBeforeCreate()
        {
            $this->dataset = new TableDataset(
                MySqlIConnectionFactory::getInstance(),
                GetConnectionOptions(),
                '`profissionais`');
            $this->dataset->addFields(
                array(
                    new IntegerField('codigo', true, true, true),
                    new StringField('nome'),
                    new StringField('nacionalidade'),
                    new DateField('nascimento'),
                    new IntegerField('tipo_identificacao'),
                    new IntegerField('numero_identificacao'),
                    new StringField('especialidade'),
                    new StringField('rg'),
                    new DateField('data_rg'),
                    new StringField('orgao_rg'),
                    new StringField('cpf'),
                    new StringField('endereco'),
                    new StringField('numero'),
                    new StringField('complemento'),
                    new StringField('bairro'),
                    new StringField('cidade'),
                    new StringField('uf'),
                    new StringField('cep'),
                    new StringField('email'),
                    new StringField('banco'),
                    new StringField('agencia'),
                    new StringField('tipo_conta'),
                    new StringField('conta'),
                    new StringField('telefone'),
                    new StringField('celular'),
                    new StringField('filiacao_pai'),
                    new StringField('filiacao_mae'),
                    new StringField('cartao_sus'),
                    new StringField('foto'),
                    new StringField('thumb'),
                    new IntegerField('id_user'),
                    new StringField('local_atuacao'),
                    new IntegerField('ativo'),
                    new StringField('curriculum'),
                    new StringField('comprovante_residencia'),
                    new StringField('identidade'),
                    new StringField('crm'),
                    new StringField('contrato', false, false, false, true)
                )
            );
            $this->dataset->AddLookupField('tipo_identificacao', 'tipo_identificacao', new IntegerField('codigo'), new StringField('identificacao', false, false, false, false, 'tipo_identificacao_identificacao', 'tipo_identificacao_identificacao_tipo_identificacao'), 'tipo_identificacao_identificacao_tipo_identificacao');
            $this->dataset->AddLookupField('uf', 'uf', new StringField('uf'), new StringField('descricao', false, false, false, false, 'uf_descricao', 'uf_descricao_uf'), 'uf_descricao_uf');
        }
    
        protected function DoPrepare() {
    
        }
    
        protected function CreatePageNavigator()
        {
            $result = new CompositePageNavigator($this);
            
            $partitionNavigator = new PageNavigator('pnav', $this, $this->dataset);
            $partitionNavigator->SetRowsPerPage(20);
            $result->AddPageNavigator($partitionNavigator);
            
            return $result;
        }
    
        protected function CreateRssGenerator()
        {
            return null;
        }
    
        protected function setupCharts()
        {
    
        }
    
        protected function getFiltersColumns()
        {
            return array(
                new FilterColumn($this->dataset, 'foto', 'foto', 'Foto'),
                new FilterColumn($this->dataset, 'thumb', 'thumb', 'Foto'),
                new FilterColumn($this->dataset, 'codigo', 'codigo', 'Código'),
                new FilterColumn($this->dataset, 'nome', 'nome', 'Nome do Profissional'),
                new FilterColumn($this->dataset, 'nacionalidade', 'nacionalidade', 'Nacionalidade'),
                new FilterColumn($this->dataset, 'nascimento', 'nascimento', 'Data de Nascimento'),
                new FilterColumn($this->dataset, 'tipo_identificacao', 'tipo_identificacao_identificacao', 'Tipo Identificação'),
                new FilterColumn($this->dataset, 'numero_identificacao', 'numero_identificacao', 'Numero Identificação'),
                new FilterColumn($this->dataset, 'especialidade', 'especialidade', 'Especialidade'),
                new FilterColumn($this->dataset, 'rg', 'rg', 'Rg'),
                new FilterColumn($this->dataset, 'data_rg', 'data_rg', 'Data de Expedição do RG'),
                new FilterColumn($this->dataset, 'orgao_rg', 'orgao_rg', 'Órgão Expedição RG'),
                new FilterColumn($this->dataset, 'cpf', 'cpf', 'CPF'),
                new FilterColumn($this->dataset, 'endereco', 'endereco', 'Endereço'),
                new FilterColumn($this->dataset, 'numero', 'numero', 'Número'),
                new FilterColumn($this->dataset, 'complemento', 'complemento', 'Complemento'),
                new FilterColumn($this->dataset, 'bairro', 'bairro', 'Bairro'),
                new FilterColumn($this->dataset, 'cidade', 'cidade', 'Cidade'),
                new FilterColumn($this->dataset, 'uf', 'uf_descricao', 'UF'),
                new FilterColumn($this->dataset, 'cep', 'cep', 'CEP'),
                new FilterColumn($this->dataset, 'email', 'email', 'E-mail'),
                new FilterColumn($this->dataset, 'banco', 'banco', 'Banco'),
                new FilterColumn($this->dataset, 'agencia', 'agencia', 'Agência'),
                new FilterColumn($this->dataset, 'tipo_conta', 'tipo_conta', 'Tipo Conta'),
                new FilterColumn($this->dataset, 'conta', 'conta', 'Conta'),
                new FilterColumn($this->dataset, 'telefone', 'telefone', 'Telefone'),
                new FilterColumn($this->dataset, 'celular', 'celular', 'Celular'),
                new FilterColumn($this->dataset, 'filiacao_pai', 'filiacao_pai', 'Filiação - Nome do Pai'),
                new FilterColumn($this->dataset, 'filiacao_mae', 'filiacao_mae', 'Filiação - Nome da Mãe'),
                new FilterColumn($this->dataset, 'cartao_sus', 'cartao_sus', 'Número do Cartão SUS'),
                new FilterColumn($this->dataset, 'id_user', 'id_user', 'Id User'),
                new FilterColumn($this->dataset, 'local_atuacao', 'local_atuacao', 'Local de Atuação'),
                new FilterColumn($this->dataset, 'contrato', 'contrato', 'Contrato'),
                new FilterColumn($this->dataset, 'ativo', 'ativo', 'Ativo'),
                new FilterColumn($this->dataset, 'curriculum', 'curriculum', 'Anexar Curriculum Vitae'),
                new FilterColumn($this->dataset, 'comprovante_residencia', 'comprovante_residencia', 'Anexar Comprovante de Residência'),
                new FilterColumn($this->dataset, 'identidade', 'identidade', 'Anexar RG'),
                new FilterColumn($this->dataset, 'crm', 'crm', 'Anexar CRM')
            );
        }
    
        protected function setupQuickFilter(QuickFilter $quickFilter, FixedKeysArray $columns)
        {
            $quickFilter
                ->addColumn($columns['foto'])
                ->addColumn($columns['codigo'])
                ->addColumn($columns['nome'])
                ->addColumn($columns['nacionalidade'])
                ->addColumn($columns['nascimento'])
                ->addColumn($columns['tipo_identificacao'])
                ->addColumn($columns['numero_identificacao'])
                ->addColumn($columns['especialidade'])
                ->addColumn($columns['rg'])
                ->addColumn($columns['data_rg'])
                ->addColumn($columns['orgao_rg'])
                ->addColumn($columns['cpf'])
                ->addColumn($columns['endereco'])
                ->addColumn($columns['numero'])
                ->addColumn($columns['complemento'])
                ->addColumn($columns['bairro'])
                ->addColumn($columns['cidade'])
                ->addColumn($columns['uf'])
                ->addColumn($columns['cep'])
                ->addColumn($columns['email'])
                ->addColumn($columns['banco'])
                ->addColumn($columns['agencia'])
                ->addColumn($columns['tipo_conta'])
                ->addColumn($columns['conta'])
                ->addColumn($columns['telefone'])
                ->addColumn($columns['celular'])
                ->addColumn($columns['filiacao_pai'])
                ->addColumn($columns['filiacao_mae'])
                ->addColumn($columns['cartao_sus'])
                ->addColumn($columns['local_atuacao'])
                ->addColumn($columns['curriculum'])
                ->addColumn($columns['comprovante_residencia'])
                ->addColumn($columns['identidade'])
                ->addColumn($columns['crm']);
        }
    
        protected function setupColumnFilter(ColumnFilter $columnFilter)
        {
    
        }
    
        protected function setupFilterBuilder(FilterBuilder $filterBuilder, FixedKeysArray $columns)
        {
            $main_editor = new TextEdit('foto');
            
            $filterBuilder->addColumn(
                $columns['foto'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('codigo_edit');
            
            $filterBuilder->addColumn(
                $columns['codigo'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('nome_edit');
            
            $filterBuilder->addColumn(
                $columns['nome'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('nacionalidade_edit');
            
            $filterBuilder->addColumn(
                $columns['nacionalidade'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new DateTimeEdit('nascimento_edit', false, 'd/m/Y');
            
            $filterBuilder->addColumn(
                $columns['nascimento'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::DATE_EQUALS => $main_editor,
                    FilterConditionOperator::DATE_DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::TODAY => null,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new DynamicCombobox('tipo_identificacao_edit', $this->CreateLinkBuilder());
            $main_editor->setAllowClear(true);
            $main_editor->setMinimumInputLength(0);
            $main_editor->SetAllowNullValue(false);
            $main_editor->SetHandlerName('filter_builder_tipo_identificacao_identificacao_search');
            
            $multi_value_select_editor = new RemoteMultiValueSelect('tipo_identificacao', $this->CreateLinkBuilder());
            $multi_value_select_editor->SetHandlerName('filter_builder_tipo_identificacao_identificacao_search');
            
            $filterBuilder->addColumn(
                $columns['tipo_identificacao'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::IN => $multi_value_select_editor,
                    FilterConditionOperator::NOT_IN => $multi_value_select_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('numero_identificacao_edit');
            
            $filterBuilder->addColumn(
                $columns['numero_identificacao'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('especialidade_edit');
            
            $filterBuilder->addColumn(
                $columns['especialidade'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('rg_edit');
            $main_editor->SetMaxLength(50);
            
            $filterBuilder->addColumn(
                $columns['rg'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new DateTimeEdit('data_rg_edit', false, 'd/m/Y');
            
            $filterBuilder->addColumn(
                $columns['data_rg'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::DATE_EQUALS => $main_editor,
                    FilterConditionOperator::DATE_DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::TODAY => null,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('orgao_rg_edit');
            $main_editor->SetMaxLength(50);
            
            $filterBuilder->addColumn(
                $columns['orgao_rg'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new MaskedEdit('cpf_edit', '999.999.999-99');
            
            $text_editor = new TextEdit('cpf');
            
            $filterBuilder->addColumn(
                $columns['cpf'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $text_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $text_editor,
                    FilterConditionOperator::BEGINS_WITH => $text_editor,
                    FilterConditionOperator::ENDS_WITH => $text_editor,
                    FilterConditionOperator::IS_LIKE => $text_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $text_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('endereco_edit');
            
            $filterBuilder->addColumn(
                $columns['endereco'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('numero_edit');
            $main_editor->SetMaxLength(25);
            
            $filterBuilder->addColumn(
                $columns['numero'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('complemento_edit');
            
            $filterBuilder->addColumn(
                $columns['complemento'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('bairro_edit');
            
            $filterBuilder->addColumn(
                $columns['bairro'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('cidade_edit');
            $main_editor->SetPlaceholder('Cidade');
            
            $filterBuilder->addColumn(
                $columns['cidade'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new DynamicCombobox('uf_edit', $this->CreateLinkBuilder());
            $main_editor->setMaxWidth('2');
            $main_editor->setAllowClear(true);
            $main_editor->setMinimumInputLength(0);
            $main_editor->SetAllowNullValue(false);
            $main_editor->SetHandlerName('filter_builder_uf_descricao_search');
            
            $multi_value_select_editor = new RemoteMultiValueSelect('uf', $this->CreateLinkBuilder());
            $multi_value_select_editor->SetHandlerName('filter_builder_uf_descricao_search');
            
            $text_editor = new TextEdit('uf');
            
            $filterBuilder->addColumn(
                $columns['uf'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $text_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $text_editor,
                    FilterConditionOperator::BEGINS_WITH => $text_editor,
                    FilterConditionOperator::ENDS_WITH => $text_editor,
                    FilterConditionOperator::IS_LIKE => $text_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $text_editor,
                    FilterConditionOperator::IN => $multi_value_select_editor,
                    FilterConditionOperator::NOT_IN => $multi_value_select_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new MaskedEdit('cep_edit', '99.999-999');
            
            $text_editor = new TextEdit('cep');
            
            $filterBuilder->addColumn(
                $columns['cep'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $text_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $text_editor,
                    FilterConditionOperator::BEGINS_WITH => $text_editor,
                    FilterConditionOperator::ENDS_WITH => $text_editor,
                    FilterConditionOperator::IS_LIKE => $text_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $text_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('email_edit');
            
            $filterBuilder->addColumn(
                $columns['email'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('banco_edit');
            
            $filterBuilder->addColumn(
                $columns['banco'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('agencia_edit');
            $main_editor->SetMaxLength(50);
            
            $filterBuilder->addColumn(
                $columns['agencia'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new ComboBox('tipo_conta_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $main_editor->addChoice('Poupança', 'Poupança');
            $main_editor->addChoice('Corrente', 'Corrente');
            $main_editor->SetAllowNullValue(false);
            
            $multi_value_select_editor = new MultiValueSelect('tipo_conta');
            $multi_value_select_editor->setChoices($main_editor->getChoices());
            
            $text_editor = new TextEdit('tipo_conta');
            
            $filterBuilder->addColumn(
                $columns['tipo_conta'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $text_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $text_editor,
                    FilterConditionOperator::BEGINS_WITH => $text_editor,
                    FilterConditionOperator::ENDS_WITH => $text_editor,
                    FilterConditionOperator::IS_LIKE => $text_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $text_editor,
                    FilterConditionOperator::IN => $multi_value_select_editor,
                    FilterConditionOperator::NOT_IN => $multi_value_select_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('conta_edit');
            $main_editor->SetMaxLength(50);
            
            $filterBuilder->addColumn(
                $columns['conta'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new MaskedEdit('telefone_edit', '(99) 99999-9999');
            
            $text_editor = new TextEdit('telefone');
            
            $filterBuilder->addColumn(
                $columns['telefone'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $text_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $text_editor,
                    FilterConditionOperator::BEGINS_WITH => $text_editor,
                    FilterConditionOperator::ENDS_WITH => $text_editor,
                    FilterConditionOperator::IS_LIKE => $text_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $text_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new MaskedEdit('celular_edit', '(99) 99999-9999');
            
            $text_editor = new TextEdit('celular');
            
            $filterBuilder->addColumn(
                $columns['celular'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $text_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $text_editor,
                    FilterConditionOperator::BEGINS_WITH => $text_editor,
                    FilterConditionOperator::ENDS_WITH => $text_editor,
                    FilterConditionOperator::IS_LIKE => $text_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $text_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('filiacao_pai_edit');
            
            $filterBuilder->addColumn(
                $columns['filiacao_pai'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('filiacao_mae_edit');
            
            $filterBuilder->addColumn(
                $columns['filiacao_mae'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('cartao_sus_edit');
            $main_editor->SetMaxLength(50);
            
            $filterBuilder->addColumn(
                $columns['cartao_sus'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('local_atuacao');
            
            $filterBuilder->addColumn(
                $columns['local_atuacao'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('curriculum');
            
            $filterBuilder->addColumn(
                $columns['curriculum'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('comprovante_residencia');
            
            $filterBuilder->addColumn(
                $columns['comprovante_residencia'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('identidade');
            
            $filterBuilder->addColumn(
                $columns['identidade'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
            
            $main_editor = new TextEdit('crm');
            
            $filterBuilder->addColumn(
                $columns['crm'],
                array(
                    FilterConditionOperator::EQUALS => $main_editor,
                    FilterConditionOperator::DOES_NOT_EQUAL => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN => $main_editor,
                    FilterConditionOperator::IS_GREATER_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN => $main_editor,
                    FilterConditionOperator::IS_LESS_THAN_OR_EQUAL_TO => $main_editor,
                    FilterConditionOperator::IS_BETWEEN => $main_editor,
                    FilterConditionOperator::IS_NOT_BETWEEN => $main_editor,
                    FilterConditionOperator::CONTAINS => $main_editor,
                    FilterConditionOperator::DOES_NOT_CONTAIN => $main_editor,
                    FilterConditionOperator::BEGINS_WITH => $main_editor,
                    FilterConditionOperator::ENDS_WITH => $main_editor,
                    FilterConditionOperator::IS_LIKE => $main_editor,
                    FilterConditionOperator::IS_NOT_LIKE => $main_editor,
                    FilterConditionOperator::IS_BLANK => null,
                    FilterConditionOperator::IS_NOT_BLANK => null
                )
            );
        }
    
        protected function AddOperationsColumns(Grid $grid)
        {
            $actions = $grid->getActions();
            $actions->setCaption($this->GetLocalizerCaptions()->GetMessageString('Actions'));
            $actions->setPosition(ActionList::POSITION_LEFT);
            
            if ($this->GetSecurityInfo()->HasViewGrant())
            {
                $operation = new LinkOperation($this->GetLocalizerCaptions()->GetMessageString('View'), OPERATION_VIEW, $this->dataset, $grid);
                $operation->setUseImage(true);
                $actions->addOperation($operation);
            }
            
            if ($this->GetSecurityInfo()->HasEditGrant())
            {
                $operation = new LinkOperation($this->GetLocalizerCaptions()->GetMessageString('Edit'), OPERATION_EDIT, $this->dataset, $grid);
                $operation->setUseImage(true);
                $actions->addOperation($operation);
                $operation->OnShow->AddListener('ShowEditButtonHandler', $this);
            }
            
            if ($this->GetSecurityInfo()->HasDeleteGrant())
            {
                $operation = new LinkOperation($this->GetLocalizerCaptions()->GetMessageString('Delete'), OPERATION_DELETE, $this->dataset, $grid);
                $operation->setUseImage(true);
                $actions->addOperation($operation);
                $operation->OnShow->AddListener('ShowDeleteButtonHandler', $this);
                $operation->SetAdditionalAttribute('data-modal-operation', 'delete');
                $operation->SetAdditionalAttribute('data-delete-handler-name', $this->GetModalGridDeleteHandler());
            }
            
            if ($this->GetSecurityInfo()->HasAddGrant())
            {
                $operation = new LinkOperation($this->GetLocalizerCaptions()->GetMessageString('Copy'), OPERATION_COPY, $this->dataset, $grid);
                $operation->setUseImage(true);
                $actions->addOperation($operation);
            }
        }
    
        protected function AddFieldColumns(Grid $grid, $withDetails = true)
        {
            //
            // View column for crm field
            //
            $column = new DownloadExternalDataColumn('crm', 'crm', 'Anexar CRM', $this->dataset, '');
            $column->SetOrderable(true);
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription('');
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
        }
    
        protected function AddSingleRecordViewColumns(Grid $grid)
        {
            //
            // View column for thumb field
            //
            $column = new ExternalImageViewColumn('thumb', 'thumb', 'Foto', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for codigo field
            //
            $column = new NumberViewColumn('codigo', 'codigo', 'Código', $this->dataset);
            $column->SetOrderable(true);
            $column->setNumberAfterDecimal(0);
            $column->setThousandsSeparator(',');
            $column->setDecimalSeparator('');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for nome field
            //
            $column = new TextViewColumn('nome', 'nome', 'Nome do Profissional', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_nome_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for nacionalidade field
            //
            $column = new TextViewColumn('nacionalidade', 'nacionalidade', 'Nacionalidade', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_nacionalidade_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for nascimento field
            //
            $column = new DateTimeViewColumn('nascimento', 'nascimento', 'Data de Nascimento', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDateTimeFormat('d/m/Y');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for identificacao field
            //
            $column = new TextViewColumn('tipo_identificacao', 'tipo_identificacao_identificacao', 'Tipo Identificação', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for numero_identificacao field
            //
            $column = new StringTransformViewColumn('numero_identificacao', 'numero_identificacao', 'Numero Identificação', $this->dataset);
            $column->SetOrderable(true);
            $column->setStringTransformFunction('');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for especialidade field
            //
            $column = new TextViewColumn('especialidade', 'especialidade', 'Especialidade', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_especialidade_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for rg field
            //
            $column = new TextViewColumn('rg', 'rg', 'Rg', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for data_rg field
            //
            $column = new DateTimeViewColumn('data_rg', 'data_rg', 'Data de Expedição do RG', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDateTimeFormat('d/m/Y');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for orgao_rg field
            //
            $column = new TextViewColumn('orgao_rg', 'orgao_rg', 'Órgão Expedição RG', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for cpf field
            //
            $column = new TextViewColumn('cpf', 'cpf', 'CPF', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for endereco field
            //
            $column = new TextViewColumn('endereco', 'endereco', 'Endereço', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_endereco_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for numero field
            //
            $column = new TextViewColumn('numero', 'numero', 'Número', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for complemento field
            //
            $column = new TextViewColumn('complemento', 'complemento', 'Complemento', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_complemento_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for bairro field
            //
            $column = new TextViewColumn('bairro', 'bairro', 'Bairro', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_bairro_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for cidade field
            //
            $column = new TextViewColumn('cidade', 'cidade', 'Cidade', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_cidade_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for descricao field
            //
            $column = new TextViewColumn('uf', 'uf_descricao', 'UF', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_uf_descricao_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for cep field
            //
            $column = new TextViewColumn('cep', 'cep', 'CEP', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for email field
            //
            $column = new TextViewColumn('email', 'email', 'E-mail', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_email_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for banco field
            //
            $column = new TextViewColumn('banco', 'banco', 'Banco', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_banco_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for agencia field
            //
            $column = new TextViewColumn('agencia', 'agencia', 'Agência', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for tipo_conta field
            //
            $column = new TextViewColumn('tipo_conta', 'tipo_conta', 'Tipo Conta', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for conta field
            //
            $column = new TextViewColumn('conta', 'conta', 'Conta', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for telefone field
            //
            $column = new TextViewColumn('telefone', 'telefone', 'Telefone', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_telefone_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for celular field
            //
            $column = new TextViewColumn('celular', 'celular', 'Celular', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_celular_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for filiacao_pai field
            //
            $column = new TextViewColumn('filiacao_pai', 'filiacao_pai', 'Filiação - Nome do Pai', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_filiacao_pai_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for filiacao_mae field
            //
            $column = new TextViewColumn('filiacao_mae', 'filiacao_mae', 'Filiação - Nome da Mãe', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_filiacao_mae_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for cartao_sus field
            //
            $column = new TextViewColumn('cartao_sus', 'cartao_sus', 'Número do Cartão SUS', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for id_user field
            //
            $column = new NumberViewColumn('id_user', 'id_user', 'Id User', $this->dataset);
            $column->SetOrderable(true);
            $column->setNumberAfterDecimal(2);
            $column->setThousandsSeparator(',');
            $column->setDecimalSeparator('.');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for local_atuacao field
            //
            $column = new TextViewColumn('local_atuacao', 'local_atuacao', 'Local de Atuação', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_local_atuacao_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for contrato field
            //
            $column = new TextViewColumn('contrato', 'contrato', 'Contrato', $this->dataset);
            $column->SetOrderable(false);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for curriculum field
            //
            $column = new DownloadExternalDataColumn('curriculum', 'curriculum', 'Anexar Curriculum Vitae', $this->dataset, '');
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for comprovante_residencia field
            //
            $column = new DownloadExternalDataColumn('comprovante_residencia', 'comprovante_residencia', 'Anexar Comprovante de Residência', $this->dataset, '');
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for identidade field
            //
            $column = new TextViewColumn('identidade', 'identidade', 'Anexar RG', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_identidade_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for crm field
            //
            $column = new DownloadExternalDataColumn('crm', 'crm', 'Anexar CRM', $this->dataset, '');
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
        }
    
        protected function AddEditColumns(Grid $grid)
        {
            //
            // Edit column for foto field
            //
            $editor = new ImageUploader('foto_edit');
            $editor->SetShowImage(true);
            $editor->setAcceptableFileTypes('image/*');
            $editColumn = new UploadFileToFolderColumn('Foto', 'foto', $editor, $this->dataset, false, false, 'images', '%random%.%original_file_extension%', $this->OnFileUpload, false);
            $editColumn->SetReplaceUploadedFileIfExist(true);
            $editColumn->setMaxUploadFileSize(51196928);
            $editColumn->SetGenerationImageThumbnails(
                'thumb',
                'thumb',
                Delegate::CreateFromMethod($this, 'foto_Thumbnail_GenerateFileName_edit'),
                new ImageFitByHeightResizeFilter(100),
                false
            );
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for nome field
            //
            $editor = new TextEdit('nome_edit');
            $editColumn = new CustomEditColumn('Nome do Profissional', 'nome', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for nacionalidade field
            //
            $editor = new TextEdit('nacionalidade_edit');
            $editColumn = new CustomEditColumn('Nacionalidade', 'nacionalidade', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for nascimento field
            //
            $editor = new DateTimeEdit('nascimento_edit', false, 'd/m/Y');
            $editColumn = new CustomEditColumn('Data de Nascimento', 'nascimento', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for tipo_identificacao field
            //
            $editor = new DynamicCombobox('tipo_identificacao_edit', $this->CreateLinkBuilder());
            $editor->setAllowClear(true);
            $editor->setMinimumInputLength(0);
            $lookupDataset = new TableDataset(
                MySqlIConnectionFactory::getInstance(),
                GetConnectionOptions(),
                '`tipo_identificacao`');
            $lookupDataset->addFields(
                array(
                    new IntegerField('codigo', true, true, true),
                    new StringField('identificacao')
                )
            );
            $lookupDataset->setOrderByField('identificacao', 'ASC');
            $editColumn = new DynamicLookupEditColumn('Tipo Identificação', 'tipo_identificacao', 'tipo_identificacao_identificacao', 'edit_tipo_identificacao_identificacao_search', $editor, $this->dataset, $lookupDataset, 'codigo', 'identificacao', '');
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for numero_identificacao field
            //
            $editor = new TextEdit('numero_identificacao_edit');
            $editColumn = new CustomEditColumn('Numero Identificação', 'numero_identificacao', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for especialidade field
            //
            $editor = new TextEdit('especialidade_edit');
            $editColumn = new CustomEditColumn('Especialidade', 'especialidade', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for rg field
            //
            $editor = new TextEdit('rg_edit');
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Rg', 'rg', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for data_rg field
            //
            $editor = new DateTimeEdit('data_rg_edit', false, 'd/m/Y');
            $editColumn = new CustomEditColumn('Data de Expedição do RG', 'data_rg', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for orgao_rg field
            //
            $editor = new TextEdit('orgao_rg_edit');
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Órgão Expedição RG', 'orgao_rg', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for cpf field
            //
            $editor = new MaskedEdit('cpf_edit', '999.999.999-99');
            $editColumn = new CustomEditColumn('CPF', 'cpf', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for endereco field
            //
            $editor = new TextEdit('endereco_edit');
            $editColumn = new CustomEditColumn('Endereço', 'endereco', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for numero field
            //
            $editor = new TextEdit('numero_edit');
            $editor->SetMaxLength(25);
            $editColumn = new CustomEditColumn('Número', 'numero', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for complemento field
            //
            $editor = new TextEdit('complemento_edit');
            $editColumn = new CustomEditColumn('Complemento', 'complemento', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for bairro field
            //
            $editor = new TextEdit('bairro_edit');
            $editColumn = new CustomEditColumn('Bairro', 'bairro', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for cidade field
            //
            $editor = new TextEdit('cidade_edit');
            $editor->SetPlaceholder('Cidade');
            $editColumn = new CustomEditColumn('Cidade', 'cidade', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for uf field
            //
            $editor = new DynamicCombobox('uf_edit', $this->CreateLinkBuilder());
            $editor->setMaxWidth('2');
            $editor->setAllowClear(true);
            $editor->setMinimumInputLength(0);
            $lookupDataset = new TableDataset(
                MySqlIConnectionFactory::getInstance(),
                GetConnectionOptions(),
                '`uf`');
            $lookupDataset->addFields(
                array(
                    new IntegerField('codigo', true, true, true),
                    new StringField('uf', true),
                    new StringField('descricao', true)
                )
            );
            $lookupDataset->setOrderByField('descricao', 'ASC');
            $editColumn = new DynamicLookupEditColumn('UF', 'uf', 'uf_descricao', 'edit_uf_descricao_search', $editor, $this->dataset, $lookupDataset, 'uf', 'descricao', '');
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for cep field
            //
            $editor = new MaskedEdit('cep_edit', '99.999-999');
            $editColumn = new CustomEditColumn('CEP', 'cep', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for email field
            //
            $editor = new TextEdit('email_edit');
            $editColumn = new CustomEditColumn('E-mail', 'email', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $validator = new EMailValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('EmailValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for banco field
            //
            $editor = new TextEdit('banco_edit');
            $editColumn = new CustomEditColumn('Banco', 'banco', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for agencia field
            //
            $editor = new TextEdit('agencia_edit');
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Agência', 'agencia', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for tipo_conta field
            //
            $editor = new ComboBox('tipo_conta_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $editor->addChoice('Poupança', 'Poupança');
            $editor->addChoice('Corrente', 'Corrente');
            $editColumn = new CustomEditColumn('Tipo Conta', 'tipo_conta', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for conta field
            //
            $editor = new TextEdit('conta_edit');
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Conta', 'conta', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for telefone field
            //
            $editor = new MaskedEdit('telefone_edit', '(99) 99999-9999');
            $editColumn = new CustomEditColumn('Telefone', 'telefone', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for celular field
            //
            $editor = new MaskedEdit('celular_edit', '(99) 99999-9999');
            $editColumn = new CustomEditColumn('Celular', 'celular', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for filiacao_pai field
            //
            $editor = new TextEdit('filiacao_pai_edit');
            $editColumn = new CustomEditColumn('Filiação - Nome do Pai', 'filiacao_pai', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for filiacao_mae field
            //
            $editor = new TextEdit('filiacao_mae_edit');
            $editColumn = new CustomEditColumn('Filiação - Nome da Mãe', 'filiacao_mae', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for cartao_sus field
            //
            $editor = new TextEdit('cartao_sus_edit');
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Número do Cartão SUS', 'cartao_sus', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for id_user field
            //
            $editor = new TextEdit('id_user_edit');
            $editColumn = new CustomEditColumn('Id User', 'id_user', $editor, $this->dataset);
            $editColumn->setVisible(false);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for local_atuacao field
            //
            $editor = new TextAreaEdit('local_atuacao_edit', 50, 8);
            $editColumn = new CustomEditColumn('Local de Atuação', 'local_atuacao', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for curriculum field
            //
            $editor = new ImageUploader('curriculum_edit');
            $editor->SetShowImage(false);
            $editColumn = new UploadFileToFolderColumn('Anexar Curriculum Vitae', 'curriculum', $editor, $this->dataset, false, false, 'curriculum', '%random%.%original_file_extension%', $this->OnFileUpload, false);
            $editColumn->SetReplaceUploadedFileIfExist(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for comprovante_residencia field
            //
            $editor = new ImageUploader('comprovante_residencia_edit');
            $editor->SetShowImage(false);
            $editColumn = new UploadFileToFolderColumn('Anexar Comprovante de Residência', 'comprovante_residencia', $editor, $this->dataset, false, false, '', '%random%.%original_file_extension%', $this->OnFileUpload, false);
            $editColumn->SetReplaceUploadedFileIfExist(false);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for identidade field
            //
            $editor = new ImageUploader('identidade_edit');
            $editor->SetShowImage(false);
            $editColumn = new UploadFileToFolderColumn('Anexar RG', 'identidade', $editor, $this->dataset, false, false, '', '%random%.%original_file_extension%', $this->OnFileUpload, false);
            $editColumn->SetReplaceUploadedFileIfExist(false);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for crm field
            //
            $editor = new ImageUploader('crm_edit');
            $editor->SetShowImage(false);
            $editColumn = new UploadFileToFolderColumn('Anexar CRM', 'crm', $editor, $this->dataset, false, false, '', '%random%.%original_file_extension%', $this->OnFileUpload, false);
            $editColumn->SetReplaceUploadedFileIfExist(false);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
        }
    
        protected function AddMultiEditColumns(Grid $grid)
        {
            //
            // Edit column for foto field
            //
            $editor = new ImageUploader('foto_edit');
            $editor->SetShowImage(true);
            $editor->setAcceptableFileTypes('image/*');
            $editColumn = new UploadFileToFolderColumn('Foto', 'foto', $editor, $this->dataset, false, false, 'images', '%random%.%original_file_extension%', $this->OnFileUpload, false);
            $editColumn->SetReplaceUploadedFileIfExist(true);
            $editColumn->setMaxUploadFileSize(51196928);
            $editColumn->SetGenerationImageThumbnails(
                'thumb',
                'thumb',
                Delegate::CreateFromMethod($this, 'foto_Thumbnail_GenerateFileName_multi_edit'),
                new ImageFitByHeightResizeFilter(100),
                false
            );
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for nome field
            //
            $editor = new TextEdit('nome_edit');
            $editColumn = new CustomEditColumn('Nome do Profissional', 'nome', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for nacionalidade field
            //
            $editor = new TextEdit('nacionalidade_edit');
            $editColumn = new CustomEditColumn('Nacionalidade', 'nacionalidade', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for nascimento field
            //
            $editor = new DateTimeEdit('nascimento_edit', false, 'd/m/Y');
            $editColumn = new CustomEditColumn('Data de Nascimento', 'nascimento', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for tipo_identificacao field
            //
            $editor = new DynamicCombobox('tipo_identificacao_edit', $this->CreateLinkBuilder());
            $editor->setAllowClear(true);
            $editor->setMinimumInputLength(0);
            $lookupDataset = new TableDataset(
                MySqlIConnectionFactory::getInstance(),
                GetConnectionOptions(),
                '`tipo_identificacao`');
            $lookupDataset->addFields(
                array(
                    new IntegerField('codigo', true, true, true),
                    new StringField('identificacao')
                )
            );
            $lookupDataset->setOrderByField('identificacao', 'ASC');
            $editColumn = new DynamicLookupEditColumn('Tipo Identificação', 'tipo_identificacao', 'tipo_identificacao_identificacao', 'multi_edit_tipo_identificacao_identificacao_search', $editor, $this->dataset, $lookupDataset, 'codigo', 'identificacao', '');
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for numero_identificacao field
            //
            $editor = new TextEdit('numero_identificacao_edit');
            $editColumn = new CustomEditColumn('Numero Identificação', 'numero_identificacao', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for especialidade field
            //
            $editor = new TextEdit('especialidade_edit');
            $editColumn = new CustomEditColumn('Especialidade', 'especialidade', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for rg field
            //
            $editor = new TextEdit('rg_edit');
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Rg', 'rg', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for data_rg field
            //
            $editor = new DateTimeEdit('data_rg_edit', false, 'd/m/Y');
            $editColumn = new CustomEditColumn('Data de Expedição do RG', 'data_rg', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for orgao_rg field
            //
            $editor = new TextEdit('orgao_rg_edit');
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Órgão Expedição RG', 'orgao_rg', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for cpf field
            //
            $editor = new MaskedEdit('cpf_edit', '999.999.999-99');
            $editColumn = new CustomEditColumn('CPF', 'cpf', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for endereco field
            //
            $editor = new TextEdit('endereco_edit');
            $editColumn = new CustomEditColumn('Endereço', 'endereco', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for numero field
            //
            $editor = new TextEdit('numero_edit');
            $editor->SetMaxLength(25);
            $editColumn = new CustomEditColumn('Número', 'numero', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for complemento field
            //
            $editor = new TextEdit('complemento_edit');
            $editColumn = new CustomEditColumn('Complemento', 'complemento', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for bairro field
            //
            $editor = new TextEdit('bairro_edit');
            $editColumn = new CustomEditColumn('Bairro', 'bairro', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for cidade field
            //
            $editor = new TextEdit('cidade_edit');
            $editor->SetPlaceholder('Cidade');
            $editColumn = new CustomEditColumn('Cidade', 'cidade', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for uf field
            //
            $editor = new DynamicCombobox('uf_edit', $this->CreateLinkBuilder());
            $editor->setMaxWidth('2');
            $editor->setAllowClear(true);
            $editor->setMinimumInputLength(0);
            $lookupDataset = new TableDataset(
                MySqlIConnectionFactory::getInstance(),
                GetConnectionOptions(),
                '`uf`');
            $lookupDataset->addFields(
                array(
                    new IntegerField('codigo', true, true, true),
                    new StringField('uf', true),
                    new StringField('descricao', true)
                )
            );
            $lookupDataset->setOrderByField('descricao', 'ASC');
            $editColumn = new DynamicLookupEditColumn('UF', 'uf', 'uf_descricao', 'multi_edit_uf_descricao_search', $editor, $this->dataset, $lookupDataset, 'uf', 'descricao', '');
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for cep field
            //
            $editor = new MaskedEdit('cep_edit', '99.999-999');
            $editColumn = new CustomEditColumn('CEP', 'cep', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for email field
            //
            $editor = new TextEdit('email_edit');
            $editColumn = new CustomEditColumn('E-mail', 'email', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $validator = new EMailValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('EmailValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for banco field
            //
            $editor = new TextEdit('banco_edit');
            $editColumn = new CustomEditColumn('Banco', 'banco', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for agencia field
            //
            $editor = new TextEdit('agencia_edit');
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Agência', 'agencia', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for tipo_conta field
            //
            $editor = new ComboBox('tipo_conta_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $editor->addChoice('Poupança', 'Poupança');
            $editor->addChoice('Corrente', 'Corrente');
            $editColumn = new CustomEditColumn('Tipo Conta', 'tipo_conta', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for conta field
            //
            $editor = new TextEdit('conta_edit');
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Conta', 'conta', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for telefone field
            //
            $editor = new MaskedEdit('telefone_edit', '(99) 99999-9999');
            $editColumn = new CustomEditColumn('Telefone', 'telefone', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for celular field
            //
            $editor = new MaskedEdit('celular_edit', '(99) 99999-9999');
            $editColumn = new CustomEditColumn('Celular', 'celular', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for filiacao_pai field
            //
            $editor = new TextEdit('filiacao_pai_edit');
            $editColumn = new CustomEditColumn('Filiação - Nome do Pai', 'filiacao_pai', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for filiacao_mae field
            //
            $editor = new TextEdit('filiacao_mae_edit');
            $editColumn = new CustomEditColumn('Filiação - Nome da Mãe', 'filiacao_mae', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for cartao_sus field
            //
            $editor = new TextEdit('cartao_sus_edit');
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Número do Cartão SUS', 'cartao_sus', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for id_user field
            //
            $editor = new TextEdit('id_user_edit');
            $editColumn = new CustomEditColumn('Id User', 'id_user', $editor, $this->dataset);
            $editColumn->setVisible(false);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for local_atuacao field
            //
            $editor = new TextAreaEdit('local_atuacao_edit', 50, 8);
            $editColumn = new CustomEditColumn('Local de Atuação', 'local_atuacao', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for curriculum field
            //
            $editor = new ImageUploader('curriculum_edit');
            $editor->SetShowImage(false);
            $editColumn = new UploadFileToFolderColumn('Anexar Curriculum Vitae', 'curriculum', $editor, $this->dataset, false, false, 'curriculum', '%random%.%original_file_extension%', $this->OnFileUpload, false);
            $editColumn->SetReplaceUploadedFileIfExist(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for comprovante_residencia field
            //
            $editor = new ImageUploader('comprovante_residencia_edit');
            $editor->SetShowImage(false);
            $editColumn = new UploadFileToFolderColumn('Anexar Comprovante de Residência', 'comprovante_residencia', $editor, $this->dataset, false, false, '', '%random%.%original_file_extension%', $this->OnFileUpload, false);
            $editColumn->SetReplaceUploadedFileIfExist(false);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for identidade field
            //
            $editor = new ImageUploader('identidade_edit');
            $editor->SetShowImage(false);
            $editColumn = new UploadFileToFolderColumn('Anexar RG', 'identidade', $editor, $this->dataset, false, false, '', '%random%.%original_file_extension%', $this->OnFileUpload, false);
            $editColumn->SetReplaceUploadedFileIfExist(false);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
            
            //
            // Edit column for crm field
            //
            $editor = new ImageUploader('crm_edit');
            $editor->SetShowImage(false);
            $editColumn = new UploadFileToFolderColumn('Anexar CRM', 'crm', $editor, $this->dataset, false, false, '', '%random%.%original_file_extension%', $this->OnFileUpload, false);
            $editColumn->SetReplaceUploadedFileIfExist(false);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddMultiEditColumn($editColumn);
        }
    
        protected function AddInsertColumns(Grid $grid)
        {
            //
            // Edit column for foto field
            //
            $editor = new ImageUploader('foto_edit');
            $editor->SetShowImage(true);
            $editor->setAcceptableFileTypes('image/*');
            $editColumn = new UploadFileToFolderColumn('Foto', 'foto', $editor, $this->dataset, false, false, 'images', '%random%.%original_file_extension%', $this->OnFileUpload, false);
            $editColumn->SetReplaceUploadedFileIfExist(true);
            $editColumn->setMaxUploadFileSize(51196928);
            $editColumn->SetGenerationImageThumbnails(
                'thumb',
                'thumb',
                Delegate::CreateFromMethod($this, 'foto_Thumbnail_GenerateFileName_insert'),
                new ImageFitByHeightResizeFilter(100),
                false
            );
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for nome field
            //
            $editor = new TextEdit('nome_edit');
            $editColumn = new CustomEditColumn('Nome do Profissional', 'nome', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for nacionalidade field
            //
            $editor = new TextEdit('nacionalidade_edit');
            $editColumn = new CustomEditColumn('Nacionalidade', 'nacionalidade', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for nascimento field
            //
            $editor = new DateTimeEdit('nascimento_edit', false, 'd/m/Y');
            $editColumn = new CustomEditColumn('Data de Nascimento', 'nascimento', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for tipo_identificacao field
            //
            $editor = new DynamicCombobox('tipo_identificacao_edit', $this->CreateLinkBuilder());
            $editor->setAllowClear(true);
            $editor->setMinimumInputLength(0);
            $lookupDataset = new TableDataset(
                MySqlIConnectionFactory::getInstance(),
                GetConnectionOptions(),
                '`tipo_identificacao`');
            $lookupDataset->addFields(
                array(
                    new IntegerField('codigo', true, true, true),
                    new StringField('identificacao')
                )
            );
            $lookupDataset->setOrderByField('identificacao', 'ASC');
            $editColumn = new DynamicLookupEditColumn('Tipo Identificação', 'tipo_identificacao', 'tipo_identificacao_identificacao', 'insert_tipo_identificacao_identificacao_search', $editor, $this->dataset, $lookupDataset, 'codigo', 'identificacao', '');
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for numero_identificacao field
            //
            $editor = new TextEdit('numero_identificacao_edit');
            $editColumn = new CustomEditColumn('Numero Identificação', 'numero_identificacao', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for especialidade field
            //
            $editor = new TextEdit('especialidade_edit');
            $editColumn = new CustomEditColumn('Especialidade', 'especialidade', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for rg field
            //
            $editor = new TextEdit('rg_edit');
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Rg', 'rg', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for data_rg field
            //
            $editor = new DateTimeEdit('data_rg_edit', false, 'd/m/Y');
            $editColumn = new CustomEditColumn('Data de Expedição do RG', 'data_rg', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for orgao_rg field
            //
            $editor = new TextEdit('orgao_rg_edit');
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Órgão Expedição RG', 'orgao_rg', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for cpf field
            //
            $editor = new MaskedEdit('cpf_edit', '999.999.999-99');
            $editColumn = new CustomEditColumn('CPF', 'cpf', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for endereco field
            //
            $editor = new TextEdit('endereco_edit');
            $editColumn = new CustomEditColumn('Endereço', 'endereco', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for numero field
            //
            $editor = new TextEdit('numero_edit');
            $editor->SetMaxLength(25);
            $editColumn = new CustomEditColumn('Número', 'numero', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for complemento field
            //
            $editor = new TextEdit('complemento_edit');
            $editColumn = new CustomEditColumn('Complemento', 'complemento', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for bairro field
            //
            $editor = new TextEdit('bairro_edit');
            $editColumn = new CustomEditColumn('Bairro', 'bairro', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for cidade field
            //
            $editor = new TextEdit('cidade_edit');
            $editor->SetPlaceholder('Cidade');
            $editColumn = new CustomEditColumn('Cidade', 'cidade', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for uf field
            //
            $editor = new DynamicCombobox('uf_edit', $this->CreateLinkBuilder());
            $editor->setMaxWidth('2');
            $editor->setAllowClear(true);
            $editor->setMinimumInputLength(0);
            $lookupDataset = new TableDataset(
                MySqlIConnectionFactory::getInstance(),
                GetConnectionOptions(),
                '`uf`');
            $lookupDataset->addFields(
                array(
                    new IntegerField('codigo', true, true, true),
                    new StringField('uf', true),
                    new StringField('descricao', true)
                )
            );
            $lookupDataset->setOrderByField('descricao', 'ASC');
            $editColumn = new DynamicLookupEditColumn('UF', 'uf', 'uf_descricao', 'insert_uf_descricao_search', $editor, $this->dataset, $lookupDataset, 'uf', 'descricao', '');
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for cep field
            //
            $editor = new MaskedEdit('cep_edit', '99.999-999');
            $editColumn = new CustomEditColumn('CEP', 'cep', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for email field
            //
            $editor = new TextEdit('email_edit');
            $editColumn = new CustomEditColumn('E-mail', 'email', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $validator = new EMailValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('EmailValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for banco field
            //
            $editor = new TextEdit('banco_edit');
            $editColumn = new CustomEditColumn('Banco', 'banco', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for agencia field
            //
            $editor = new TextEdit('agencia_edit');
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Agência', 'agencia', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for tipo_conta field
            //
            $editor = new ComboBox('tipo_conta_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $editor->addChoice('Poupança', 'Poupança');
            $editor->addChoice('Corrente', 'Corrente');
            $editColumn = new CustomEditColumn('Tipo Conta', 'tipo_conta', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for conta field
            //
            $editor = new TextEdit('conta_edit');
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Conta', 'conta', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for telefone field
            //
            $editor = new MaskedEdit('telefone_edit', '(99) 99999-9999');
            $editColumn = new CustomEditColumn('Telefone', 'telefone', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for celular field
            //
            $editor = new MaskedEdit('celular_edit', '(99) 99999-9999');
            $editColumn = new CustomEditColumn('Celular', 'celular', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for filiacao_pai field
            //
            $editor = new TextEdit('filiacao_pai_edit');
            $editColumn = new CustomEditColumn('Filiação - Nome do Pai', 'filiacao_pai', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for filiacao_mae field
            //
            $editor = new TextEdit('filiacao_mae_edit');
            $editColumn = new CustomEditColumn('Filiação - Nome da Mãe', 'filiacao_mae', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for cartao_sus field
            //
            $editor = new TextEdit('cartao_sus_edit');
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Número do Cartão SUS', 'cartao_sus', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for id_user field
            //
            $editor = new TextEdit('id_user_edit');
            $editColumn = new CustomEditColumn('Id User', 'id_user', $editor, $this->dataset);
            $editColumn->setVisible(false);
            $editColumn->SetAllowSetToNull(true);
            $editColumn->SetInsertDefaultValue('%CODIGO%');
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for local_atuacao field
            //
            $editor = new TextAreaEdit('local_atuacao_edit', 50, 8);
            $editColumn = new CustomEditColumn('Local de Atuação', 'local_atuacao', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for curriculum field
            //
            $editor = new ImageUploader('curriculum_edit');
            $editor->SetShowImage(false);
            $editColumn = new UploadFileToFolderColumn('Anexar Curriculum Vitae', 'curriculum', $editor, $this->dataset, false, false, 'curriculum', '%random%.%original_file_extension%', $this->OnFileUpload, false);
            $editColumn->SetReplaceUploadedFileIfExist(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for comprovante_residencia field
            //
            $editor = new ImageUploader('comprovante_residencia_edit');
            $editor->SetShowImage(false);
            $editColumn = new UploadFileToFolderColumn('Anexar Comprovante de Residência', 'comprovante_residencia', $editor, $this->dataset, false, false, '', '%random%.%original_file_extension%', $this->OnFileUpload, false);
            $editColumn->SetReplaceUploadedFileIfExist(false);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for identidade field
            //
            $editor = new ImageUploader('identidade_edit');
            $editor->SetShowImage(false);
            $editColumn = new UploadFileToFolderColumn('Anexar RG', 'identidade', $editor, $this->dataset, false, false, '', '%random%.%original_file_extension%', $this->OnFileUpload, false);
            $editColumn->SetReplaceUploadedFileIfExist(false);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for crm field
            //
            $editor = new ImageUploader('crm_edit');
            $editor->SetShowImage(false);
            $editColumn = new UploadFileToFolderColumn('Anexar CRM', 'crm', $editor, $this->dataset, false, false, '', '%random%.%original_file_extension%', $this->OnFileUpload, false);
            $editColumn->SetReplaceUploadedFileIfExist(false);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $editColumn->GetCaption()));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            $grid->SetShowAddButton(true && $this->GetSecurityInfo()->HasAddGrant());
        }
    
        private function AddMultiUploadColumn(Grid $grid)
        {
    
        }
    
        protected function AddPrintColumns(Grid $grid)
        {
            //
            // View column for foto field
            //
            $column = new ExternalImageViewColumn('foto', 'foto', 'Foto', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for codigo field
            //
            $column = new NumberViewColumn('codigo', 'codigo', 'Código', $this->dataset);
            $column->SetOrderable(true);
            $column->setNumberAfterDecimal(0);
            $column->setThousandsSeparator(',');
            $column->setDecimalSeparator('');
            $grid->AddPrintColumn($column);
            
            //
            // View column for nome field
            //
            $column = new TextViewColumn('nome', 'nome', 'Nome do Profissional', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_nome_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for nacionalidade field
            //
            $column = new TextViewColumn('nacionalidade', 'nacionalidade', 'Nacionalidade', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_nacionalidade_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for nascimento field
            //
            $column = new DateTimeViewColumn('nascimento', 'nascimento', 'Data de Nascimento', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDateTimeFormat('d/m/Y');
            $grid->AddPrintColumn($column);
            
            //
            // View column for identificacao field
            //
            $column = new TextViewColumn('tipo_identificacao', 'tipo_identificacao_identificacao', 'Tipo Identificação', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for numero_identificacao field
            //
            $column = new StringTransformViewColumn('numero_identificacao', 'numero_identificacao', 'Numero Identificação', $this->dataset);
            $column->SetOrderable(true);
            $column->setStringTransformFunction('');
            $grid->AddPrintColumn($column);
            
            //
            // View column for especialidade field
            //
            $column = new TextViewColumn('especialidade', 'especialidade', 'Especialidade', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_especialidade_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for rg field
            //
            $column = new TextViewColumn('rg', 'rg', 'Rg', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for data_rg field
            //
            $column = new DateTimeViewColumn('data_rg', 'data_rg', 'Data de Expedição do RG', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDateTimeFormat('d/m/Y');
            $grid->AddPrintColumn($column);
            
            //
            // View column for orgao_rg field
            //
            $column = new TextViewColumn('orgao_rg', 'orgao_rg', 'Órgão Expedição RG', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for cpf field
            //
            $column = new TextViewColumn('cpf', 'cpf', 'CPF', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for endereco field
            //
            $column = new TextViewColumn('endereco', 'endereco', 'Endereço', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_endereco_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for numero field
            //
            $column = new TextViewColumn('numero', 'numero', 'Número', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for complemento field
            //
            $column = new TextViewColumn('complemento', 'complemento', 'Complemento', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_complemento_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for bairro field
            //
            $column = new TextViewColumn('bairro', 'bairro', 'Bairro', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_bairro_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for cidade field
            //
            $column = new TextViewColumn('cidade', 'cidade', 'Cidade', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_cidade_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for descricao field
            //
            $column = new TextViewColumn('uf', 'uf_descricao', 'UF', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_uf_descricao_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for cep field
            //
            $column = new TextViewColumn('cep', 'cep', 'CEP', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for email field
            //
            $column = new TextViewColumn('email', 'email', 'E-mail', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_email_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for banco field
            //
            $column = new TextViewColumn('banco', 'banco', 'Banco', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_banco_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for agencia field
            //
            $column = new TextViewColumn('agencia', 'agencia', 'Agência', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for tipo_conta field
            //
            $column = new TextViewColumn('tipo_conta', 'tipo_conta', 'Tipo Conta', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for conta field
            //
            $column = new TextViewColumn('conta', 'conta', 'Conta', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for telefone field
            //
            $column = new TextViewColumn('telefone', 'telefone', 'Telefone', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_telefone_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for celular field
            //
            $column = new TextViewColumn('celular', 'celular', 'Celular', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_celular_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for filiacao_pai field
            //
            $column = new TextViewColumn('filiacao_pai', 'filiacao_pai', 'Filiação - Nome do Pai', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_filiacao_pai_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for filiacao_mae field
            //
            $column = new TextViewColumn('filiacao_mae', 'filiacao_mae', 'Filiação - Nome da Mãe', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_filiacao_mae_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for cartao_sus field
            //
            $column = new TextViewColumn('cartao_sus', 'cartao_sus', 'Número do Cartão SUS', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for local_atuacao field
            //
            $column = new TextViewColumn('local_atuacao', 'local_atuacao', 'Local de Atuação', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_local_atuacao_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for contrato field
            //
            $column = new TextViewColumn('contrato', 'contrato', 'Contrato', $this->dataset);
            $column->SetOrderable(false);
            $grid->AddPrintColumn($column);
            
            //
            // View column for curriculum field
            //
            $column = new DownloadExternalDataColumn('curriculum', 'curriculum', 'Anexar Curriculum Vitae', $this->dataset, '');
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for comprovante_residencia field
            //
            $column = new DownloadExternalDataColumn('comprovante_residencia', 'comprovante_residencia', 'Anexar Comprovante de Residência', $this->dataset, '');
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for identidade field
            //
            $column = new TextViewColumn('identidade', 'identidade', 'Anexar RG', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_identidade_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for crm field
            //
            $column = new DownloadExternalDataColumn('crm', 'crm', 'Anexar CRM', $this->dataset, '');
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
        }
    
        protected function AddExportColumns(Grid $grid)
        {
            //
            // View column for foto field
            //
            $column = new ExternalImageViewColumn('foto', 'foto', 'Foto', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for codigo field
            //
            $column = new NumberViewColumn('codigo', 'codigo', 'Código', $this->dataset);
            $column->SetOrderable(true);
            $column->setNumberAfterDecimal(0);
            $column->setThousandsSeparator(',');
            $column->setDecimalSeparator('');
            $grid->AddExportColumn($column);
            
            //
            // View column for nome field
            //
            $column = new TextViewColumn('nome', 'nome', 'Nome do Profissional', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_nome_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for nacionalidade field
            //
            $column = new TextViewColumn('nacionalidade', 'nacionalidade', 'Nacionalidade', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_nacionalidade_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for nascimento field
            //
            $column = new DateTimeViewColumn('nascimento', 'nascimento', 'Data de Nascimento', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDateTimeFormat('d/m/Y');
            $grid->AddExportColumn($column);
            
            //
            // View column for identificacao field
            //
            $column = new TextViewColumn('tipo_identificacao', 'tipo_identificacao_identificacao', 'Tipo Identificação', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for numero_identificacao field
            //
            $column = new StringTransformViewColumn('numero_identificacao', 'numero_identificacao', 'Numero Identificação', $this->dataset);
            $column->SetOrderable(true);
            $column->setStringTransformFunction('');
            $grid->AddExportColumn($column);
            
            //
            // View column for especialidade field
            //
            $column = new TextViewColumn('especialidade', 'especialidade', 'Especialidade', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_especialidade_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for rg field
            //
            $column = new TextViewColumn('rg', 'rg', 'Rg', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for data_rg field
            //
            $column = new DateTimeViewColumn('data_rg', 'data_rg', 'Data de Expedição do RG', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDateTimeFormat('d/m/Y');
            $grid->AddExportColumn($column);
            
            //
            // View column for orgao_rg field
            //
            $column = new TextViewColumn('orgao_rg', 'orgao_rg', 'Órgão Expedição RG', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for cpf field
            //
            $column = new TextViewColumn('cpf', 'cpf', 'CPF', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for endereco field
            //
            $column = new TextViewColumn('endereco', 'endereco', 'Endereço', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_endereco_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for numero field
            //
            $column = new TextViewColumn('numero', 'numero', 'Número', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for complemento field
            //
            $column = new TextViewColumn('complemento', 'complemento', 'Complemento', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_complemento_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for bairro field
            //
            $column = new TextViewColumn('bairro', 'bairro', 'Bairro', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_bairro_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for cidade field
            //
            $column = new TextViewColumn('cidade', 'cidade', 'Cidade', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_cidade_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for descricao field
            //
            $column = new TextViewColumn('uf', 'uf_descricao', 'UF', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_uf_descricao_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for cep field
            //
            $column = new TextViewColumn('cep', 'cep', 'CEP', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for email field
            //
            $column = new TextViewColumn('email', 'email', 'E-mail', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_email_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for banco field
            //
            $column = new TextViewColumn('banco', 'banco', 'Banco', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_banco_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for agencia field
            //
            $column = new TextViewColumn('agencia', 'agencia', 'Agência', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for tipo_conta field
            //
            $column = new TextViewColumn('tipo_conta', 'tipo_conta', 'Tipo Conta', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for conta field
            //
            $column = new TextViewColumn('conta', 'conta', 'Conta', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for telefone field
            //
            $column = new TextViewColumn('telefone', 'telefone', 'Telefone', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_telefone_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for celular field
            //
            $column = new TextViewColumn('celular', 'celular', 'Celular', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_celular_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for filiacao_pai field
            //
            $column = new TextViewColumn('filiacao_pai', 'filiacao_pai', 'Filiação - Nome do Pai', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_filiacao_pai_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for filiacao_mae field
            //
            $column = new TextViewColumn('filiacao_mae', 'filiacao_mae', 'Filiação - Nome da Mãe', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_filiacao_mae_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for cartao_sus field
            //
            $column = new TextViewColumn('cartao_sus', 'cartao_sus', 'Número do Cartão SUS', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for local_atuacao field
            //
            $column = new TextViewColumn('local_atuacao', 'local_atuacao', 'Local de Atuação', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_local_atuacao_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for contrato field
            //
            $column = new TextViewColumn('contrato', 'contrato', 'Contrato', $this->dataset);
            $column->SetOrderable(false);
            $grid->AddExportColumn($column);
            
            //
            // View column for curriculum field
            //
            $column = new DownloadExternalDataColumn('curriculum', 'curriculum', 'Anexar Curriculum Vitae', $this->dataset, '');
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for comprovante_residencia field
            //
            $column = new DownloadExternalDataColumn('comprovante_residencia', 'comprovante_residencia', 'Anexar Comprovante de Residência', $this->dataset, '');
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for identidade field
            //
            $column = new TextViewColumn('identidade', 'identidade', 'Anexar RG', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_identidade_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for crm field
            //
            $column = new DownloadExternalDataColumn('crm', 'crm', 'Anexar CRM', $this->dataset, '');
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
        }
    
        private function AddCompareColumns(Grid $grid)
        {
            //
            // View column for foto field
            //
            $column = new ExternalImageViewColumn('foto', 'foto', 'Foto', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddCompareColumn($column);
            
            //
            // View column for nome field
            //
            $column = new TextViewColumn('nome', 'nome', 'Nome do Profissional', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_nome_handler_compare');
            $grid->AddCompareColumn($column);
            
            //
            // View column for nacionalidade field
            //
            $column = new TextViewColumn('nacionalidade', 'nacionalidade', 'Nacionalidade', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_nacionalidade_handler_compare');
            $grid->AddCompareColumn($column);
            
            //
            // View column for nascimento field
            //
            $column = new DateTimeViewColumn('nascimento', 'nascimento', 'Data de Nascimento', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDateTimeFormat('d/m/Y');
            $grid->AddCompareColumn($column);
            
            //
            // View column for identificacao field
            //
            $column = new TextViewColumn('tipo_identificacao', 'tipo_identificacao_identificacao', 'Tipo Identificação', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddCompareColumn($column);
            
            //
            // View column for numero_identificacao field
            //
            $column = new StringTransformViewColumn('numero_identificacao', 'numero_identificacao', 'Numero Identificação', $this->dataset);
            $column->SetOrderable(true);
            $column->setStringTransformFunction('');
            $grid->AddCompareColumn($column);
            
            //
            // View column for especialidade field
            //
            $column = new TextViewColumn('especialidade', 'especialidade', 'Especialidade', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_especialidade_handler_compare');
            $grid->AddCompareColumn($column);
            
            //
            // View column for rg field
            //
            $column = new TextViewColumn('rg', 'rg', 'Rg', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddCompareColumn($column);
            
            //
            // View column for data_rg field
            //
            $column = new DateTimeViewColumn('data_rg', 'data_rg', 'Data de Expedição do RG', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDateTimeFormat('d/m/Y');
            $grid->AddCompareColumn($column);
            
            //
            // View column for orgao_rg field
            //
            $column = new TextViewColumn('orgao_rg', 'orgao_rg', 'Órgão Expedição RG', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddCompareColumn($column);
            
            //
            // View column for cpf field
            //
            $column = new TextViewColumn('cpf', 'cpf', 'CPF', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddCompareColumn($column);
            
            //
            // View column for endereco field
            //
            $column = new TextViewColumn('endereco', 'endereco', 'Endereço', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_endereco_handler_compare');
            $grid->AddCompareColumn($column);
            
            //
            // View column for numero field
            //
            $column = new TextViewColumn('numero', 'numero', 'Número', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddCompareColumn($column);
            
            //
            // View column for complemento field
            //
            $column = new TextViewColumn('complemento', 'complemento', 'Complemento', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_complemento_handler_compare');
            $grid->AddCompareColumn($column);
            
            //
            // View column for bairro field
            //
            $column = new TextViewColumn('bairro', 'bairro', 'Bairro', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_bairro_handler_compare');
            $grid->AddCompareColumn($column);
            
            //
            // View column for cidade field
            //
            $column = new TextViewColumn('cidade', 'cidade', 'Cidade', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_cidade_handler_compare');
            $grid->AddCompareColumn($column);
            
            //
            // View column for descricao field
            //
            $column = new TextViewColumn('uf', 'uf_descricao', 'UF', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_uf_descricao_handler_compare');
            $grid->AddCompareColumn($column);
            
            //
            // View column for cep field
            //
            $column = new TextViewColumn('cep', 'cep', 'CEP', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddCompareColumn($column);
            
            //
            // View column for email field
            //
            $column = new TextViewColumn('email', 'email', 'E-mail', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_email_handler_compare');
            $grid->AddCompareColumn($column);
            
            //
            // View column for banco field
            //
            $column = new TextViewColumn('banco', 'banco', 'Banco', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_banco_handler_compare');
            $grid->AddCompareColumn($column);
            
            //
            // View column for agencia field
            //
            $column = new TextViewColumn('agencia', 'agencia', 'Agência', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddCompareColumn($column);
            
            //
            // View column for tipo_conta field
            //
            $column = new TextViewColumn('tipo_conta', 'tipo_conta', 'Tipo Conta', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddCompareColumn($column);
            
            //
            // View column for conta field
            //
            $column = new TextViewColumn('conta', 'conta', 'Conta', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddCompareColumn($column);
            
            //
            // View column for telefone field
            //
            $column = new TextViewColumn('telefone', 'telefone', 'Telefone', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_telefone_handler_compare');
            $grid->AddCompareColumn($column);
            
            //
            // View column for celular field
            //
            $column = new TextViewColumn('celular', 'celular', 'Celular', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_celular_handler_compare');
            $grid->AddCompareColumn($column);
            
            //
            // View column for filiacao_pai field
            //
            $column = new TextViewColumn('filiacao_pai', 'filiacao_pai', 'Filiação - Nome do Pai', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_filiacao_pai_handler_compare');
            $grid->AddCompareColumn($column);
            
            //
            // View column for filiacao_mae field
            //
            $column = new TextViewColumn('filiacao_mae', 'filiacao_mae', 'Filiação - Nome da Mãe', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_filiacao_mae_handler_compare');
            $grid->AddCompareColumn($column);
            
            //
            // View column for cartao_sus field
            //
            $column = new TextViewColumn('cartao_sus', 'cartao_sus', 'Número do Cartão SUS', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddCompareColumn($column);
            
            //
            // View column for local_atuacao field
            //
            $column = new TextViewColumn('local_atuacao', 'local_atuacao', 'Local de Atuação', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_local_atuacao_handler_compare');
            $grid->AddCompareColumn($column);
            
            //
            // View column for contrato field
            //
            $column = new TextViewColumn('contrato', 'contrato', 'Contrato', $this->dataset);
            $column->SetOrderable(false);
            $grid->AddCompareColumn($column);
            
            //
            // View column for curriculum field
            //
            $column = new DownloadExternalDataColumn('curriculum', 'curriculum', 'Anexar Curriculum Vitae', $this->dataset, '');
            $column->SetOrderable(true);
            $grid->AddCompareColumn($column);
            
            //
            // View column for comprovante_residencia field
            //
            $column = new DownloadExternalDataColumn('comprovante_residencia', 'comprovante_residencia', 'Anexar Comprovante de Residência', $this->dataset, '');
            $column->SetOrderable(true);
            $grid->AddCompareColumn($column);
            
            //
            // View column for identidade field
            //
            $column = new TextViewColumn('identidade', 'identidade', 'Anexar RG', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('profissionais01Grid_identidade_handler_compare');
            $grid->AddCompareColumn($column);
            
            //
            // View column for crm field
            //
            $column = new DownloadExternalDataColumn('crm', 'crm', 'Anexar CRM', $this->dataset, '');
            $column->SetOrderable(true);
            $grid->AddCompareColumn($column);
        }
    
        private function AddCompareHeaderColumns(Grid $grid)
        {
    
        }
    
        public function GetPageDirection()
        {
            return null;
        }
    
        public function isFilterConditionRequired()
        {
            return false;
        }
    
        protected function ApplyCommonColumnEditProperties(CustomEditColumn $column)
        {
            $column->SetDisplaySetToNullCheckBox(false);
            $column->SetDisplaySetToDefaultCheckBox(false);
    		$column->SetVariableContainer($this->GetColumnVariableContainer());
        }
    
        public function foto_Thumbnail_GenerateFileName_insert(&$filepath, &$handled, $original_file_name, $original_file_extension, $file_size)
        {
        $targetFolder = FormatDatasetFieldsTemplate($this->GetDataset(), 'thumb');
        FileUtils::ForceDirectories($targetFolder);
        
        $filename = FileUtils::AppendFileExtension(rand(), $original_file_extension);
        $filepath = Path::Combine($targetFolder, $filename);
        
        while (file_exists($filepath))
        {
            $filename = FileUtils::AppendFileExtension(rand(), $original_file_extension);
            $filepath = Path::Combine($targetFolder, $filename);
        }
        
        $handled = true;
        }
        
        function GetCustomClientScript()
        {
            return ;
        }
        
        function GetOnPageLoadedClientScript()
        {
            return ;
        }
        public function foto_Thumbnail_GenerateFileName_edit(&$filepath, &$handled, $original_file_name, $original_file_extension, $file_size)
        {
        $targetFolder = FormatDatasetFieldsTemplate($this->GetDataset(), 'thumb');
        FileUtils::ForceDirectories($targetFolder);
        
        $filename = FileUtils::AppendFileExtension(rand(), $original_file_extension);
        $filepath = Path::Combine($targetFolder, $filename);
        
        while (file_exists($filepath))
        {
            $filename = FileUtils::AppendFileExtension(rand(), $original_file_extension);
            $filepath = Path::Combine($targetFolder, $filename);
        }
        
        $handled = true;
        }
        public function foto_Thumbnail_GenerateFileName_multi_edit(&$filepath, &$handled, $original_file_name, $original_file_extension, $file_size)
        {
        $targetFolder = FormatDatasetFieldsTemplate($this->GetDataset(), 'thumb');
        FileUtils::ForceDirectories($targetFolder);
        
        $filename = FileUtils::AppendFileExtension(rand(), $original_file_extension);
        $filepath = Path::Combine($targetFolder, $filename);
        
        while (file_exists($filepath))
        {
            $filename = FileUtils::AppendFileExtension(rand(), $original_file_extension);
            $filepath = Path::Combine($targetFolder, $filename);
        }
        
        $handled = true;
        }
        
        protected function GetEnableModalGridDelete() { return true; }
    
        protected function CreateGrid()
        {
            $result = new Grid($this, $this->dataset);
            if ($this->GetSecurityInfo()->HasDeleteGrant())
               $result->SetAllowDeleteSelected(true);
            else
               $result->SetAllowDeleteSelected(false);   
            
            ApplyCommonPageSettings($this, $result);
            
            $result->SetUseImagesForActions(true);
            $defaultSortedColumns = array();
            $defaultSortedColumns[] = new SortColumn('nome', 'ASC');
            $result->setDefaultOrdering($defaultSortedColumns);
            $result->SetUseFixedHeader(false);
            $result->SetShowLineNumbers(false);
            $result->SetShowKeyColumnsImagesInHeader(false);
            $result->SetViewMode(ViewMode::TABLE);
            $result->setEnableRuntimeCustomization(true);
            $result->setAllowAddMultipleRecords(false);
            $result->setAllowCompare(true);
            $this->AddCompareHeaderColumns($result);
            $this->AddCompareColumns($result);
            $result->setMultiEditAllowed($this->GetSecurityInfo()->HasEditGrant() && true);
            $result->setTableBordered(false);
            $result->setTableCondensed(false);
            
            $result->SetHighlightRowAtHover(false);
            $result->SetWidth('');
            $this->AddOperationsColumns($result);
            $this->AddFieldColumns($result);
            $this->AddSingleRecordViewColumns($result);
            $this->AddEditColumns($result);
            $this->AddMultiEditColumns($result);
            $this->AddInsertColumns($result);
            $this->AddPrintColumns($result);
            $this->AddExportColumns($result);
            $this->AddMultiUploadColumn($result);
    
    
            $this->SetShowPageList(false);
            $this->SetShowTopPageNavigator(true);
            $this->SetShowBottomPageNavigator(true);
            $this->setPrintListAvailable(true);
            $this->setPrintListRecordAvailable(false);
            $this->setPrintOneRecordAvailable(true);
            $this->setAllowPrintSelectedRecords(true);
            $this->setExportListAvailable(array('pdf', 'excel', 'word', 'xml', 'csv'));
            $this->setExportSelectedRecordsAvailable(array('pdf', 'excel', 'word', 'xml', 'csv'));
            $this->setExportListRecordAvailable(array());
            $this->setExportOneRecordAvailable(array('pdf', 'excel', 'word', 'xml', 'csv'));
            $this->SetHidePageListByDefault(true);
    
            return $result;
        }
     
        protected function setClientSideEvents(Grid $grid) {
    
        }
    
        protected function doRegisterHandlers() {
            //
            // View column for nome field
            //
            $column = new TextViewColumn('nome', 'nome', 'Nome do Profissional', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_nome_handler_print', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for nacionalidade field
            //
            $column = new TextViewColumn('nacionalidade', 'nacionalidade', 'Nacionalidade', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_nacionalidade_handler_print', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for especialidade field
            //
            $column = new TextViewColumn('especialidade', 'especialidade', 'Especialidade', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_especialidade_handler_print', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for endereco field
            //
            $column = new TextViewColumn('endereco', 'endereco', 'Endereço', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_endereco_handler_print', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for complemento field
            //
            $column = new TextViewColumn('complemento', 'complemento', 'Complemento', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_complemento_handler_print', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for bairro field
            //
            $column = new TextViewColumn('bairro', 'bairro', 'Bairro', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_bairro_handler_print', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for cidade field
            //
            $column = new TextViewColumn('cidade', 'cidade', 'Cidade', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_cidade_handler_print', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for descricao field
            //
            $column = new TextViewColumn('uf', 'uf_descricao', 'UF', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_uf_descricao_handler_print', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for email field
            //
            $column = new TextViewColumn('email', 'email', 'E-mail', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_email_handler_print', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for banco field
            //
            $column = new TextViewColumn('banco', 'banco', 'Banco', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_banco_handler_print', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for telefone field
            //
            $column = new TextViewColumn('telefone', 'telefone', 'Telefone', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_telefone_handler_print', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for celular field
            //
            $column = new TextViewColumn('celular', 'celular', 'Celular', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_celular_handler_print', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for filiacao_pai field
            //
            $column = new TextViewColumn('filiacao_pai', 'filiacao_pai', 'Filiação - Nome do Pai', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_filiacao_pai_handler_print', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for filiacao_mae field
            //
            $column = new TextViewColumn('filiacao_mae', 'filiacao_mae', 'Filiação - Nome da Mãe', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_filiacao_mae_handler_print', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for local_atuacao field
            //
            $column = new TextViewColumn('local_atuacao', 'local_atuacao', 'Local de Atuação', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_local_atuacao_handler_print', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for identidade field
            //
            $column = new TextViewColumn('identidade', 'identidade', 'Anexar RG', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_identidade_handler_print', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for nome field
            //
            $column = new TextViewColumn('nome', 'nome', 'Nome do Profissional', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_nome_handler_compare', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for nacionalidade field
            //
            $column = new TextViewColumn('nacionalidade', 'nacionalidade', 'Nacionalidade', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_nacionalidade_handler_compare', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for especialidade field
            //
            $column = new TextViewColumn('especialidade', 'especialidade', 'Especialidade', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_especialidade_handler_compare', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for endereco field
            //
            $column = new TextViewColumn('endereco', 'endereco', 'Endereço', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_endereco_handler_compare', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for complemento field
            //
            $column = new TextViewColumn('complemento', 'complemento', 'Complemento', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_complemento_handler_compare', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for bairro field
            //
            $column = new TextViewColumn('bairro', 'bairro', 'Bairro', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_bairro_handler_compare', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for cidade field
            //
            $column = new TextViewColumn('cidade', 'cidade', 'Cidade', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_cidade_handler_compare', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for descricao field
            //
            $column = new TextViewColumn('uf', 'uf_descricao', 'UF', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_uf_descricao_handler_compare', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for email field
            //
            $column = new TextViewColumn('email', 'email', 'E-mail', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_email_handler_compare', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for banco field
            //
            $column = new TextViewColumn('banco', 'banco', 'Banco', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_banco_handler_compare', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for telefone field
            //
            $column = new TextViewColumn('telefone', 'telefone', 'Telefone', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_telefone_handler_compare', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for celular field
            //
            $column = new TextViewColumn('celular', 'celular', 'Celular', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_celular_handler_compare', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for filiacao_pai field
            //
            $column = new TextViewColumn('filiacao_pai', 'filiacao_pai', 'Filiação - Nome do Pai', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_filiacao_pai_handler_compare', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for filiacao_mae field
            //
            $column = new TextViewColumn('filiacao_mae', 'filiacao_mae', 'Filiação - Nome da Mãe', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_filiacao_mae_handler_compare', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for local_atuacao field
            //
            $column = new TextViewColumn('local_atuacao', 'local_atuacao', 'Local de Atuação', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_local_atuacao_handler_compare', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for identidade field
            //
            $column = new TextViewColumn('identidade', 'identidade', 'Anexar RG', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_identidade_handler_compare', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            $lookupDataset = new TableDataset(
                MySqlIConnectionFactory::getInstance(),
                GetConnectionOptions(),
                '`tipo_identificacao`');
            $lookupDataset->addFields(
                array(
                    new IntegerField('codigo', true, true, true),
                    new StringField('identificacao')
                )
            );
            $lookupDataset->setOrderByField('identificacao', 'ASC');
            $handler = new DynamicSearchHandler($lookupDataset, $this, 'insert_tipo_identificacao_identificacao_search', 'codigo', 'identificacao', null, 20);
            GetApplication()->RegisterHTTPHandler($handler);
            
            $lookupDataset = new TableDataset(
                MySqlIConnectionFactory::getInstance(),
                GetConnectionOptions(),
                '`uf`');
            $lookupDataset->addFields(
                array(
                    new IntegerField('codigo', true, true, true),
                    new StringField('uf', true),
                    new StringField('descricao', true)
                )
            );
            $lookupDataset->setOrderByField('descricao', 'ASC');
            $handler = new DynamicSearchHandler($lookupDataset, $this, 'insert_uf_descricao_search', 'uf', 'descricao', null, 20);
            GetApplication()->RegisterHTTPHandler($handler);
            
            $lookupDataset = new TableDataset(
                MySqlIConnectionFactory::getInstance(),
                GetConnectionOptions(),
                '`tipo_identificacao`');
            $lookupDataset->addFields(
                array(
                    new IntegerField('codigo', true, true, true),
                    new StringField('identificacao')
                )
            );
            $lookupDataset->setOrderByField('identificacao', 'ASC');
            $handler = new DynamicSearchHandler($lookupDataset, $this, 'filter_builder_tipo_identificacao_identificacao_search', 'codigo', 'identificacao', null, 20);
            GetApplication()->RegisterHTTPHandler($handler);
            
            $lookupDataset = new TableDataset(
                MySqlIConnectionFactory::getInstance(),
                GetConnectionOptions(),
                '`uf`');
            $lookupDataset->addFields(
                array(
                    new IntegerField('codigo', true, true, true),
                    new StringField('uf', true),
                    new StringField('descricao', true)
                )
            );
            $lookupDataset->setOrderByField('descricao', 'ASC');
            $handler = new DynamicSearchHandler($lookupDataset, $this, 'filter_builder_uf_descricao_search', 'uf', 'descricao', null, 20);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for nome field
            //
            $column = new TextViewColumn('nome', 'nome', 'Nome do Profissional', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_nome_handler_view', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for nacionalidade field
            //
            $column = new TextViewColumn('nacionalidade', 'nacionalidade', 'Nacionalidade', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_nacionalidade_handler_view', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for especialidade field
            //
            $column = new TextViewColumn('especialidade', 'especialidade', 'Especialidade', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_especialidade_handler_view', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for endereco field
            //
            $column = new TextViewColumn('endereco', 'endereco', 'Endereço', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_endereco_handler_view', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for complemento field
            //
            $column = new TextViewColumn('complemento', 'complemento', 'Complemento', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_complemento_handler_view', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for bairro field
            //
            $column = new TextViewColumn('bairro', 'bairro', 'Bairro', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_bairro_handler_view', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for cidade field
            //
            $column = new TextViewColumn('cidade', 'cidade', 'Cidade', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_cidade_handler_view', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for descricao field
            //
            $column = new TextViewColumn('uf', 'uf_descricao', 'UF', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_uf_descricao_handler_view', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for email field
            //
            $column = new TextViewColumn('email', 'email', 'E-mail', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_email_handler_view', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for banco field
            //
            $column = new TextViewColumn('banco', 'banco', 'Banco', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_banco_handler_view', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for telefone field
            //
            $column = new TextViewColumn('telefone', 'telefone', 'Telefone', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_telefone_handler_view', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for celular field
            //
            $column = new TextViewColumn('celular', 'celular', 'Celular', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_celular_handler_view', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for filiacao_pai field
            //
            $column = new TextViewColumn('filiacao_pai', 'filiacao_pai', 'Filiação - Nome do Pai', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_filiacao_pai_handler_view', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for filiacao_mae field
            //
            $column = new TextViewColumn('filiacao_mae', 'filiacao_mae', 'Filiação - Nome da Mãe', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_filiacao_mae_handler_view', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for local_atuacao field
            //
            $column = new TextViewColumn('local_atuacao', 'local_atuacao', 'Local de Atuação', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_local_atuacao_handler_view', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            //
            // View column for identidade field
            //
            $column = new TextViewColumn('identidade', 'identidade', 'Anexar RG', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'profissionais01Grid_identidade_handler_view', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            
            $lookupDataset = new TableDataset(
                MySqlIConnectionFactory::getInstance(),
                GetConnectionOptions(),
                '`tipo_identificacao`');
            $lookupDataset->addFields(
                array(
                    new IntegerField('codigo', true, true, true),
                    new StringField('identificacao')
                )
            );
            $lookupDataset->setOrderByField('identificacao', 'ASC');
            $handler = new DynamicSearchHandler($lookupDataset, $this, 'edit_tipo_identificacao_identificacao_search', 'codigo', 'identificacao', null, 20);
            GetApplication()->RegisterHTTPHandler($handler);
            
            $lookupDataset = new TableDataset(
                MySqlIConnectionFactory::getInstance(),
                GetConnectionOptions(),
                '`uf`');
            $lookupDataset->addFields(
                array(
                    new IntegerField('codigo', true, true, true),
                    new StringField('uf', true),
                    new StringField('descricao', true)
                )
            );
            $lookupDataset->setOrderByField('descricao', 'ASC');
            $handler = new DynamicSearchHandler($lookupDataset, $this, 'edit_uf_descricao_search', 'uf', 'descricao', null, 20);
            GetApplication()->RegisterHTTPHandler($handler);
            
            $lookupDataset = new TableDataset(
                MySqlIConnectionFactory::getInstance(),
                GetConnectionOptions(),
                '`tipo_identificacao`');
            $lookupDataset->addFields(
                array(
                    new IntegerField('codigo', true, true, true),
                    new StringField('identificacao')
                )
            );
            $lookupDataset->setOrderByField('identificacao', 'ASC');
            $handler = new DynamicSearchHandler($lookupDataset, $this, 'multi_edit_tipo_identificacao_identificacao_search', 'codigo', 'identificacao', null, 20);
            GetApplication()->RegisterHTTPHandler($handler);
            
            $lookupDataset = new TableDataset(
                MySqlIConnectionFactory::getInstance(),
                GetConnectionOptions(),
                '`uf`');
            $lookupDataset->addFields(
                array(
                    new IntegerField('codigo', true, true, true),
                    new StringField('uf', true),
                    new StringField('descricao', true)
                )
            );
            $lookupDataset->setOrderByField('descricao', 'ASC');
            $handler = new DynamicSearchHandler($lookupDataset, $this, 'multi_edit_uf_descricao_search', 'uf', 'descricao', null, 20);
            GetApplication()->RegisterHTTPHandler($handler);
        }
       
        protected function doCustomRenderColumn($fieldName, $fieldData, $rowData, &$customText, &$handled)
        { 
    
        }
    
        protected function doCustomRenderPrintColumn($fieldName, $fieldData, $rowData, &$customText, &$handled)
        { 
    
        }
    
        protected function doCustomRenderExportColumn($exportType, $fieldName, $fieldData, $rowData, &$customText, &$handled)
        { 
    
        }
    
        protected function doCustomDrawRow($rowData, &$cellFontColor, &$cellFontSize, &$cellBgColor, &$cellItalicAttr, &$cellBoldAttr)
        {
    
        }
    
        protected function doExtendedCustomDrawRow($rowData, &$rowCellStyles, &$rowStyles, &$rowClasses, &$cellClasses)
        {
    
        }
    
        protected function doCustomRenderTotal($totalValue, $aggregate, $columnName, &$customText, &$handled)
        {
    
        }
    
        protected function doCustomDefaultValues(&$values, &$handled) 
        {
    
        }
    
        protected function doCustomCompareColumn($columnName, $valueA, $valueB, &$result)
        {
    
        }
    
        protected function doBeforeInsertRecord($page, &$rowData, $tableName, &$cancel, &$message, &$messageDisplayTime)
        {
    
        }
    
        protected function doBeforeUpdateRecord($page, $oldRowData, &$rowData, $tableName, &$cancel, &$message, &$messageDisplayTime)
        {
    
        }
    
        protected function doBeforeDeleteRecord($page, &$rowData, $tableName, &$cancel, &$message, &$messageDisplayTime)
        {
    
        }
    
        protected function doAfterInsertRecord($page, $rowData, $tableName, &$success, &$message, &$messageDisplayTime)
        {
            if ($success) {
            
              $userId = $this->GetConnection()->GetLastInsertId();  
              
              
              $sql = "UPDATE profissionais SET id_user = codigo where codigo = $userId;";
            
              $this->GetConnection()->ExecSQL($sql);
                
            
            //  $username = $rowData['email'];
              
              $email = $rowData['email'];
              
            //  $opassword = sha1($rowData['email']);
              
            
            
            
              
              $rowData['id_user'] = $rowData['codigo'];
            
              $sql = "INSERT INTO users (user_id, user_name, user_password, user_email) VALUES ('$userId', '$username', '$opassword', '$email');";
            
              $this->GetConnection()->ExecSQL($sql);
              
            $menssagem = 'Seja bem-vindo(a) a B&G Serviços Médicos.<br>
            É um prazer têlo(a) como nosso associado!<br>
            <br>
            Seu cadastro está em fase de aprovação o que pode durar até 72 horas úteis.<br>
            <br>
            Quando o processo de aprovação for concluído você receberá um e-mail com seu usuarío e senha de acesso ao sistema.<br>
            <br>
            Dúvidas favor entrar em contato pelo telefone: (11) 4166 - 6000<br>
            Ou E-mail: contato@begservicosmedicos.com.br';  
            
            sendMailMessage($email, 'Seja bem-vindo(a) a B&G Serviços Médicos!', $menssagem);
              
            $success = true;
            
            $message = 'Cadastro Recebido com Sucesso! <br> Seu cadastro está em fase de aprovação. Assim que for aprovado te enviaremos um e-mail. Obrigado!';  
            
            }
        }
    
        protected function doAfterUpdateRecord($page, $oldRowData, $rowData, $tableName, &$success, &$message, &$messageDisplayTime)
        {
    
        }
    
        protected function doAfterDeleteRecord($page, $rowData, $tableName, &$success, &$message, &$messageDisplayTime)
        {
    
        }
    
        protected function doCustomHTMLHeader($page, &$customHtmlHeaderText)
        { 
    
        }
    
        protected function doGetCustomTemplate($type, $part, $mode, &$result, &$params)
        {
    
        }
    
        protected function doGetCustomExportOptions(Page $page, $exportType, $rowData, &$options)
        {
    
        }
    
        protected function doFileUpload($fieldName, $rowData, &$result, &$accept, $originalFileName, $originalFileExtension, $fileSize, $tempFileName)
        {
    
        }
    
        protected function doPrepareChart(Chart $chart)
        {
    
        }
    
        protected function doPrepareColumnFilter(ColumnFilter $columnFilter)
        {
    
        }
    
        protected function doPrepareFilterBuilder(FilterBuilder $filterBuilder, FixedKeysArray $columns)
        {
    
        }
    
        protected function doGetSelectionFilters(FixedKeysArray $columns, &$result)
        {
    
        }
    
        protected function doGetCustomFormLayout($mode, FixedKeysArray $columns, FormLayout $layout)
        {
    
        }
    
        protected function doGetCustomColumnGroup(FixedKeysArray $columns, ViewColumnGroup $columnGroup)
        {
    
        }
    
        protected function doPageLoaded()
        {
    
        }
    
        protected function doCalculateFields($rowData, $fieldName, &$value)
        {
    
        }
    
        protected function doGetCustomPagePermissions(Page $page, PermissionSet &$permissions, &$handled)
        {
    
        }
    
        protected function doGetCustomRecordPermissions(Page $page, &$usingCondition, $rowData, &$allowEdit, &$allowDelete, &$mergeWithDefault, &$handled)
        {
    
        }
    
    }

    SetUpUserAuthorization();

    try
    {
        $Page = new profissionais01Page("profissionais01", "cadastrar.php", GetCurrentUserPermissionSetForDataSource("profissionais01"), 'UTF-8');
        $Page->SetTitle('Pedido de Associação');
        $Page->SetMenuLabel('Pedido de Associação');
        $Page->SetHeader(GetPagesHeader());
        $Page->SetFooter(GetPagesFooter());
        $Page->SetRecordPermission(GetCurrentUserRecordPermissionsForDataSource("profissionais01"));
        GetApplication()->SetMainPage($Page);
        GetApplication()->Run();
    }
    catch(Exception $e)
    {
        ShowErrorPage($e);
    }
	
