<?php
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *                                   ATTENTION!
 * If you see this message in browser (Internet Explorer, Mozilla firefox, etc.)
 * this means that
 *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 */


    require_once 'components/utils/check_utils.php';
    CheckPHPVersion();



    require_once 'database_engine/mysql_engine.php';
    require_once 'components/page.php';
    require_once 'phpgen_settings.php';
    require_once 'authorization.php';

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

    
    
    ?><?php
    
    ?><?php
    
    class m_personalDetailView0Page extends DetailPage
    {
        protected function DoBeforeCreate()
        {
            $this->dataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_personal`');
            $field = new BlobField('Per_Foto');
            $this->dataset->AddField($field, false);
            $field = new StringField('Per_Dni');
            $this->dataset->AddField($field, true);
            $field = new StringField('Per_Nombres');
            $this->dataset->AddField($field, false);
            $field = new DateField('Per_FechaNac');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Per_Celular');
            $this->dataset->AddField($field, false);
            $field = new StringField('Per_Correo');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Per_Renaes');
            $this->dataset->AddField($field, false);
            $field = new StringField('Per_OfiActual');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Per_NivelRemu');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Per_CondLabo');
            $this->dataset->AddField($field, false);
            $this->dataset->AddLookupField('Per_Renaes', 'm_establecimiento', new IntegerField('Renaes'), new StringField('Cod_UE', 'Per_Renaes_Cod_UE', 'Per_Renaes_Cod_UE_m_establecimiento'), 'Per_Renaes_Cod_UE_m_establecimiento');
            $this->dataset->AddLookupField('Per_NivelRemu', 'm_remuner', new IntegerField('UE_ID', null, null, true), new StringField('UE_Desc', 'Per_NivelRemu_UE_Desc', 'Per_NivelRemu_UE_Desc_m_remuner'), 'Per_NivelRemu_UE_Desc_m_remuner');
            $this->dataset->AddLookupField('Per_CondLabo', 'm_condilab', new IntegerField('Cond_ID', null, null, true), new StringField('Cond_Desc', 'Per_CondLabo_Cond_Desc', 'Per_CondLabo_Cond_Desc_m_condilab'), 'Per_CondLabo_Cond_Desc_m_condilab');
        }
    
        protected function AddFieldColumns($grid)
        {
            //
            // View column for Per_Foto field
            //
            $column = new DownloadDataColumn('Per_Foto', 'Per Foto', $this->dataset, '<img alt="download" src="' . 'images/download.gif' . '"><br>download');
            
            /* <inline edit column> */
            //
            // Edit column for Per_Foto field
            //
            $editor = new ImageUploader('per_foto_edit');
            $editor->SetShowImage(false);
            $editColumn = new FileUploadingColumn('Per Foto', 'Per_Foto', $editor, $this->dataset, false, false, 'Per_Foto_handler_inline_edit');
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_Foto field
            //
            $editor = new ImageUploader('per_foto_edit');
            $editor->SetShowImage(false);
            $editColumn = new FileUploadingColumn('Per Foto', 'Per_Foto', $editor, $this->dataset, false, false, 'Per_Foto_handler_inline_insert');
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Per_Dni field
            //
            $column = new TextViewColumn('Per_Dni', 'Per Dni', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Per_Dni field
            //
            $editor = new TextEdit('per_dni_edit');
            $editor->SetSize(8);
            $editor->SetMaxLength(8);
            $editColumn = new CustomEditColumn('Per Dni', 'Per_Dni', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_Dni field
            //
            $editor = new TextEdit('per_dni_edit');
            $editor->SetSize(8);
            $editor->SetMaxLength(8);
            $editColumn = new CustomEditColumn('Per Dni', 'Per_Dni', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Per_Nombres field
            //
            $column = new TextViewColumn('Per_Nombres', 'Per Nombres', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Per_Nombres field
            //
            $editor = new TextEdit('per_nombres_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per Nombres', 'Per_Nombres', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_Nombres field
            //
            $editor = new TextEdit('per_nombres_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per Nombres', 'Per_Nombres', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Per_FechaNac field
            //
            $column = new DateTimeViewColumn('Per_FechaNac', 'Per FechaNac', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Per_FechaNac field
            //
            $editor = new DateTimeEdit('per_fechanac_edit', true, 'Y-m-d H:i:s', 0);
            $editColumn = new CustomEditColumn('Per FechaNac', 'Per_FechaNac', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_FechaNac field
            //
            $editor = new DateTimeEdit('per_fechanac_edit', true, 'Y-m-d H:i:s', 0);
            $editColumn = new CustomEditColumn('Per FechaNac', 'Per_FechaNac', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Per_Celular field
            //
            $column = new TextViewColumn('Per_Celular', 'Per Celular', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Per_Celular field
            //
            $editor = new TextEdit('per_celular_edit');
            $editColumn = new CustomEditColumn('Per Celular', 'Per_Celular', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_Celular field
            //
            $editor = new TextEdit('per_celular_edit');
            $editColumn = new CustomEditColumn('Per Celular', 'Per_Celular', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Per_Correo field
            //
            $column = new TextViewColumn('Per_Correo', 'Per Correo', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Per_Correo field
            //
            $editor = new TextEdit('per_correo_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per Correo', 'Per_Correo', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_Correo field
            //
            $editor = new TextEdit('per_correo_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per Correo', 'Per_Correo', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Cod_UE field
            //
            $column = new TextViewColumn('Per_Renaes_Cod_UE', 'Per Renaes', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Per_Renaes field
            //
            $editor = new ComboBox('per_renaes_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_establecimiento`');
            $field = new IntegerField('Renaes');
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cod_UE');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Nom_UE');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Ubigeo');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Dpto');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Prov');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Dist');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Diresa');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Red');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Mred');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Estab');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Categoria');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cod_UE', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per Renaes', 
                'Per_Renaes', 
                $editor, 
                $this->dataset, 'Renaes', 'Cod_UE', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_Renaes field
            //
            $editor = new ComboBox('per_renaes_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_establecimiento`');
            $field = new IntegerField('Renaes');
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cod_UE');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Nom_UE');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Ubigeo');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Dpto');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Prov');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Dist');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Diresa');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Red');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Mred');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Estab');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Categoria');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cod_UE', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per Renaes', 
                'Per_Renaes', 
                $editor, 
                $this->dataset, 'Renaes', 'Cod_UE', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Per_OfiActual field
            //
            $column = new TextViewColumn('Per_OfiActual', 'Per OfiActual', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Per_OfiActual field
            //
            $editor = new TextEdit('per_ofiactual_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per OfiActual', 'Per_OfiActual', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_OfiActual field
            //
            $editor = new TextEdit('per_ofiactual_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per OfiActual', 'Per_OfiActual', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for UE_Desc field
            //
            $column = new TextViewColumn('Per_NivelRemu_UE_Desc', 'Per NivelRemu', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Per_NivelRemu field
            //
            $editor = new ComboBox('per_nivelremu_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_remuner`');
            $field = new IntegerField('UE_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('UE_Desc');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('UE_Desc', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per NivelRemu', 
                'Per_NivelRemu', 
                $editor, 
                $this->dataset, 'UE_ID', 'UE_Desc', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_NivelRemu field
            //
            $editor = new ComboBox('per_nivelremu_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_remuner`');
            $field = new IntegerField('UE_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('UE_Desc');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('UE_Desc', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per NivelRemu', 
                'Per_NivelRemu', 
                $editor, 
                $this->dataset, 'UE_ID', 'UE_Desc', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Cond_Desc field
            //
            $column = new TextViewColumn('Per_CondLabo_Cond_Desc', 'Per CondLabo', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Per_CondLabo field
            //
            $editor = new ComboBox('per_condlabo_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_condilab`');
            $field = new IntegerField('Cond_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cond_Desc');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cond_Desc', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per CondLabo', 
                'Per_CondLabo', 
                $editor, 
                $this->dataset, 'Cond_ID', 'Cond_Desc', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_CondLabo field
            //
            $editor = new ComboBox('per_condlabo_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_condilab`');
            $field = new IntegerField('Cond_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cond_Desc');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cond_Desc', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per CondLabo', 
                'Per_CondLabo', 
                $editor, 
                $this->dataset, 'Cond_ID', 'Cond_Desc', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
        }
        
        function GetCustomClientScript()
        {
            return ;
        }
        
        function GetOnPageLoadedClientScript()
        {
            return ;
        }
    
        public function GetPageDirection()
        {
            return null;
        }
    
        protected function ApplyCommonColumnEditProperties($column)
        {
            $column->SetShowSetToNullCheckBox(true);
        }
    
        protected function CreateGrid()
        {
            $result = new Grid($this, $this->dataset, 'm_personalDetailViewGrid0');
            $result->SetAllowDeleteSelected(false);
            $result->SetUseFixedHeader(false);
            
            $result->SetShowLineNumbers(false);
            
            $result->SetHighlightRowAtHover(false);
            $result->SetWidth('');
            $this->AddFieldColumns($result);
            $handler = new DownloadHTTPHandler($this->dataset, 'Per_Foto', 'Per_Foto_handler', '', '');
            GetApplication()->RegisterHTTPHandler($handler);
            
            $handler = new ImageHTTPHandler($this->dataset, 'Per_Foto', 'Per_Foto_handler_inline_edit', new NullFilter());
            GetApplication()->RegisterHTTPHandler($handler);
            
            $handler = new ImageHTTPHandler($this->dataset, 'Per_Foto', 'Per_Foto_handler_inline_insert', new NullFilter());
            GetApplication()->RegisterHTTPHandler($handler);
            return $result;
        }
    }
    
    
    
    ?><?php
    
    ?><?php
    
    class m_personalDetailEdit0Page extends DetailPageEdit
    {
        protected function DoBeforeCreate()
        {
            $this->dataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_personal`');
            $field = new BlobField('Per_Foto');
            $this->dataset->AddField($field, false);
            $field = new StringField('Per_Dni');
            $this->dataset->AddField($field, true);
            $field = new StringField('Per_Nombres');
            $this->dataset->AddField($field, false);
            $field = new DateField('Per_FechaNac');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Per_Celular');
            $this->dataset->AddField($field, false);
            $field = new StringField('Per_Correo');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Per_Renaes');
            $this->dataset->AddField($field, false);
            $field = new StringField('Per_OfiActual');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Per_NivelRemu');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Per_CondLabo');
            $this->dataset->AddField($field, false);
            $this->dataset->AddLookupField('Per_Renaes', 'm_establecimiento', new IntegerField('Renaes'), new StringField('Cod_UE', 'Per_Renaes_Cod_UE', 'Per_Renaes_Cod_UE_m_establecimiento'), 'Per_Renaes_Cod_UE_m_establecimiento');
            $this->dataset->AddLookupField('Per_NivelRemu', 'm_remuner', new IntegerField('UE_ID', null, null, true), new StringField('UE_Desc', 'Per_NivelRemu_UE_Desc', 'Per_NivelRemu_UE_Desc_m_remuner'), 'Per_NivelRemu_UE_Desc_m_remuner');
            $this->dataset->AddLookupField('Per_CondLabo', 'm_condilab', new IntegerField('Cond_ID', null, null, true), new StringField('Cond_Desc', 'Per_CondLabo_Cond_Desc', 'Per_CondLabo_Cond_Desc_m_condilab'), 'Per_CondLabo_Cond_Desc_m_condilab');
        }
    
        protected function CreatePageNavigator()
        {
            $result = new CompositePageNavigator($this);
            
            $partitionNavigator = new PageNavigator('pnav', $this, $this->dataset);
            $partitionNavigator->SetRowsPerPage(50);
            $result->AddPageNavigator($partitionNavigator);
            
            return $result;
        }
    
        public function GetPageList()
        {
            return null;
        }
    
        protected function CreateRssGenerator()
        {
            return null;
        }
    
        protected function CreateGridSearchControl($grid)
        {
            $grid->UseFilter = true;
            $grid->SearchControl = new SimpleSearch('m_personalDetailEdit0ssearch', $this->dataset,
                array('Per_Dni', 'Per_Nombres', 'Per_FechaNac', 'Per_Celular', 'Per_Correo', 'Per_Renaes_Cod_UE', 'Per_OfiActual', 'Per_NivelRemu_UE_Desc', 'Per_CondLabo_Cond_Desc'),
                array($this->RenderText('Per Dni'), $this->RenderText('Per Nombres'), $this->RenderText('Per FechaNac'), $this->RenderText('Per Celular'), $this->RenderText('Per Correo'), $this->RenderText('Per Renaes'), $this->RenderText('Per OfiActual'), $this->RenderText('Per NivelRemu'), $this->RenderText('Per CondLabo')),
                array(
                    '=' => $this->GetLocalizerCaptions()->GetMessageString('equals'),
                    '<>' => $this->GetLocalizerCaptions()->GetMessageString('doesNotEquals'),
                    '<' => $this->GetLocalizerCaptions()->GetMessageString('isLessThan'),
                    '<=' => $this->GetLocalizerCaptions()->GetMessageString('isLessThanOrEqualsTo'),
                    '>' => $this->GetLocalizerCaptions()->GetMessageString('isGreaterThan'),
                    '>=' => $this->GetLocalizerCaptions()->GetMessageString('isGreaterThanOrEqualsTo'),
                    'ILIKE' => $this->GetLocalizerCaptions()->GetMessageString('Like'),
                    'STARTS' => $this->GetLocalizerCaptions()->GetMessageString('StartsWith'),
                    'ENDS' => $this->GetLocalizerCaptions()->GetMessageString('EndsWith'),
                    'CONTAINS' => $this->GetLocalizerCaptions()->GetMessageString('Contains')
                    ), $this->GetLocalizerCaptions(), $this, 'CONTAINS'
                );
        }
    
        protected function CreateGridAdvancedSearchControl($grid)
        {
            $this->AdvancedSearchControl = new AdvancedSearchControl('m_personalDetailEdit0asearch', $this->dataset, $this->GetLocalizerCaptions(), $this->GetColumnVariableContainer(), $this->CreateLinkBuilder());
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateBlobSearchInput('Per_Foto', $this->RenderText('Per Foto')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Per_Dni', $this->RenderText('Per Dni')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Per_Nombres', $this->RenderText('Per Nombres')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateDateTimeSearchInput('Per_FechaNac', $this->RenderText('Per FechaNac')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Per_Celular', $this->RenderText('Per Celular')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Per_Correo', $this->RenderText('Per Correo')));
            
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_establecimiento`');
            $field = new IntegerField('Renaes');
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cod_UE');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Nom_UE');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Ubigeo');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Dpto');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Prov');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Dist');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Diresa');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Red');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Mred');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Estab');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Categoria');
            $lookupDataset->AddField($field, false);
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateLookupSearchInput('Per_Renaes', $this->RenderText('Per Renaes'), $lookupDataset, 'Renaes', 'Cod_UE', false));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Per_OfiActual', $this->RenderText('Per OfiActual')));
            
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_remuner`');
            $field = new IntegerField('UE_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('UE_Desc');
            $lookupDataset->AddField($field, false);
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateLookupSearchInput('Per_NivelRemu', $this->RenderText('Per NivelRemu'), $lookupDataset, 'UE_ID', 'UE_Desc', false));
            
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_condilab`');
            $field = new IntegerField('Cond_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cond_Desc');
            $lookupDataset->AddField($field, false);
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateLookupSearchInput('Per_CondLabo', $this->RenderText('Per CondLabo'), $lookupDataset, 'Cond_ID', 'Cond_Desc', false));
        }
    
        public function GetPageDirection()
        {
            return null;
        }
    
        protected function AddOperationsColumns($grid)
        {
            $actionsBandName = 'actions';
            $grid->AddBandToBegin($actionsBandName, $this->GetLocalizerCaptions()->GetMessageString('Actions'), true);
            if ($this->GetSecurityInfo()->HasViewGrant())
            {
                $column = $grid->AddViewColumn(new RowOperationByLinkColumn($this->GetLocalizerCaptions()->GetMessageString('View'), OPERATION_VIEW, $this->dataset), $actionsBandName);
                $column->SetImagePath('images/view_action.png');
            }
            if ($this->GetSecurityInfo()->HasEditGrant())
            {
                $column = $grid->AddViewColumn(new RowOperationByLinkColumn($this->GetLocalizerCaptions()->GetMessageString('Edit'), OPERATION_EDIT, $this->dataset), $actionsBandName);
                $column->SetImagePath('images/edit_action.png');
                $column->OnShow->AddListener('ShowEditButtonHandler', $this);
            }
            if ($this->GetSecurityInfo()->HasDeleteGrant())
            {
                $column = $grid->AddViewColumn(new RowOperationByLinkColumn($this->GetLocalizerCaptions()->GetMessageString('Delete'), OPERATION_DELETE, $this->dataset), $actionsBandName);
                $column->SetImagePath('images/delete_action.png');
                $column->OnShow->AddListener('ShowDeleteButtonHandler', $this);
            $column->SetAdditionalAttribute("modal-delete", "true");
            $column->SetAdditionalAttribute("delete-handler-name", $this->GetModalGridDeleteHandler());
            }
        }
    
        protected function AddFieldColumns($grid)
        {
            //
            // View column for Per_Foto field
            //
            $column = new DownloadDataColumn('Per_Foto', 'Per Foto', $this->dataset, '<img alt="download" src="' . 'images/download.gif' . '"><br>download');
            
            /* <inline edit column> */
            //
            // Edit column for Per_Foto field
            //
            $editor = new ImageUploader('per_foto_edit');
            $editor->SetShowImage(false);
            $editColumn = new FileUploadingColumn('Per Foto', 'Per_Foto', $editor, $this->dataset, false, false, 'Per_Foto_handler_inline_edit');
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_Foto field
            //
            $editor = new ImageUploader('per_foto_edit');
            $editor->SetShowImage(false);
            $editColumn = new FileUploadingColumn('Per Foto', 'Per_Foto', $editor, $this->dataset, false, false, 'Per_Foto_handler_inline_insert');
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Per_Dni field
            //
            $column = new TextViewColumn('Per_Dni', 'Per Dni', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Per_Dni field
            //
            $editor = new TextEdit('per_dni_edit');
            $editor->SetSize(8);
            $editor->SetMaxLength(8);
            $editColumn = new CustomEditColumn('Per Dni', 'Per_Dni', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_Dni field
            //
            $editor = new TextEdit('per_dni_edit');
            $editor->SetSize(8);
            $editor->SetMaxLength(8);
            $editColumn = new CustomEditColumn('Per Dni', 'Per_Dni', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Per_Nombres field
            //
            $column = new TextViewColumn('Per_Nombres', 'Per Nombres', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Per_Nombres field
            //
            $editor = new TextEdit('per_nombres_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per Nombres', 'Per_Nombres', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_Nombres field
            //
            $editor = new TextEdit('per_nombres_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per Nombres', 'Per_Nombres', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Per_FechaNac field
            //
            $column = new DateTimeViewColumn('Per_FechaNac', 'Per FechaNac', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Per_FechaNac field
            //
            $editor = new DateTimeEdit('per_fechanac_edit', true, 'Y-m-d H:i:s', 0);
            $editColumn = new CustomEditColumn('Per FechaNac', 'Per_FechaNac', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_FechaNac field
            //
            $editor = new DateTimeEdit('per_fechanac_edit', true, 'Y-m-d H:i:s', 0);
            $editColumn = new CustomEditColumn('Per FechaNac', 'Per_FechaNac', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Per_Celular field
            //
            $column = new TextViewColumn('Per_Celular', 'Per Celular', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Per_Celular field
            //
            $editor = new TextEdit('per_celular_edit');
            $editColumn = new CustomEditColumn('Per Celular', 'Per_Celular', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_Celular field
            //
            $editor = new TextEdit('per_celular_edit');
            $editColumn = new CustomEditColumn('Per Celular', 'Per_Celular', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Per_Correo field
            //
            $column = new TextViewColumn('Per_Correo', 'Per Correo', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Per_Correo field
            //
            $editor = new TextEdit('per_correo_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per Correo', 'Per_Correo', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_Correo field
            //
            $editor = new TextEdit('per_correo_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per Correo', 'Per_Correo', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Cod_UE field
            //
            $column = new TextViewColumn('Per_Renaes_Cod_UE', 'Per Renaes', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Per_Renaes field
            //
            $editor = new ComboBox('per_renaes_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_establecimiento`');
            $field = new IntegerField('Renaes');
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cod_UE');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Nom_UE');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Ubigeo');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Dpto');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Prov');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Dist');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Diresa');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Red');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Mred');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Estab');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Categoria');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cod_UE', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per Renaes', 
                'Per_Renaes', 
                $editor, 
                $this->dataset, 'Renaes', 'Cod_UE', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_Renaes field
            //
            $editor = new ComboBox('per_renaes_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_establecimiento`');
            $field = new IntegerField('Renaes');
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cod_UE');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Nom_UE');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Ubigeo');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Dpto');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Prov');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Dist');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Diresa');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Red');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Mred');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Estab');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Categoria');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cod_UE', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per Renaes', 
                'Per_Renaes', 
                $editor, 
                $this->dataset, 'Renaes', 'Cod_UE', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Per_OfiActual field
            //
            $column = new TextViewColumn('Per_OfiActual', 'Per OfiActual', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Per_OfiActual field
            //
            $editor = new TextEdit('per_ofiactual_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per OfiActual', 'Per_OfiActual', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_OfiActual field
            //
            $editor = new TextEdit('per_ofiactual_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per OfiActual', 'Per_OfiActual', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for UE_Desc field
            //
            $column = new TextViewColumn('Per_NivelRemu_UE_Desc', 'Per NivelRemu', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Per_NivelRemu field
            //
            $editor = new ComboBox('per_nivelremu_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_remuner`');
            $field = new IntegerField('UE_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('UE_Desc');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('UE_Desc', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per NivelRemu', 
                'Per_NivelRemu', 
                $editor, 
                $this->dataset, 'UE_ID', 'UE_Desc', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_NivelRemu field
            //
            $editor = new ComboBox('per_nivelremu_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_remuner`');
            $field = new IntegerField('UE_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('UE_Desc');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('UE_Desc', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per NivelRemu', 
                'Per_NivelRemu', 
                $editor, 
                $this->dataset, 'UE_ID', 'UE_Desc', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Cond_Desc field
            //
            $column = new TextViewColumn('Per_CondLabo_Cond_Desc', 'Per CondLabo', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Per_CondLabo field
            //
            $editor = new ComboBox('per_condlabo_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_condilab`');
            $field = new IntegerField('Cond_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cond_Desc');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cond_Desc', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per CondLabo', 
                'Per_CondLabo', 
                $editor, 
                $this->dataset, 'Cond_ID', 'Cond_Desc', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Per_CondLabo field
            //
            $editor = new ComboBox('per_condlabo_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_condilab`');
            $field = new IntegerField('Cond_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cond_Desc');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cond_Desc', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per CondLabo', 
                'Per_CondLabo', 
                $editor, 
                $this->dataset, 'Cond_ID', 'Cond_Desc', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
        }
    
        protected function AddSingleRecordViewColumns($grid)
        {
            //
            // View column for Per_Foto field
            //
            $column = new DownloadDataColumn('Per_Foto', 'Per Foto', $this->dataset, '<img alt="download" src="' . 'images/download.gif' . '"><br>download');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Per_Dni field
            //
            $column = new TextViewColumn('Per_Dni', 'Per Dni', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Per_Nombres field
            //
            $column = new TextViewColumn('Per_Nombres', 'Per Nombres', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Per_FechaNac field
            //
            $column = new DateTimeViewColumn('Per_FechaNac', 'Per FechaNac', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Per_Celular field
            //
            $column = new TextViewColumn('Per_Celular', 'Per Celular', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Per_Correo field
            //
            $column = new TextViewColumn('Per_Correo', 'Per Correo', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cod_UE field
            //
            $column = new TextViewColumn('Per_Renaes_Cod_UE', 'Per Renaes', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Per_OfiActual field
            //
            $column = new TextViewColumn('Per_OfiActual', 'Per OfiActual', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for UE_Desc field
            //
            $column = new TextViewColumn('Per_NivelRemu_UE_Desc', 'Per NivelRemu', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cond_Desc field
            //
            $column = new TextViewColumn('Per_CondLabo_Cond_Desc', 'Per CondLabo', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
        }
    
        protected function AddEditColumns($grid)
        {
            //
            // Edit column for Per_Foto field
            //
            $editor = new ImageUploader('per_foto_edit');
            $editor->SetShowImage(false);
            $editColumn = new FileUploadingColumn('Per Foto', 'Per_Foto', $editor, $this->dataset, false, false, 'Per_Foto_handler_edit');
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Per_Dni field
            //
            $editor = new TextEdit('per_dni_edit');
            $editor->SetSize(8);
            $editor->SetMaxLength(8);
            $editColumn = new CustomEditColumn('Per Dni', 'Per_Dni', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Per_Nombres field
            //
            $editor = new TextEdit('per_nombres_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per Nombres', 'Per_Nombres', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Per_FechaNac field
            //
            $editor = new DateTimeEdit('per_fechanac_edit', true, 'Y-m-d H:i:s', 0);
            $editColumn = new CustomEditColumn('Per FechaNac', 'Per_FechaNac', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Per_Celular field
            //
            $editor = new TextEdit('per_celular_edit');
            $editColumn = new CustomEditColumn('Per Celular', 'Per_Celular', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Per_Correo field
            //
            $editor = new TextEdit('per_correo_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per Correo', 'Per_Correo', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Per_Renaes field
            //
            $editor = new ComboBox('per_renaes_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_establecimiento`');
            $field = new IntegerField('Renaes');
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cod_UE');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Nom_UE');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Ubigeo');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Dpto');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Prov');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Dist');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Diresa');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Red');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Mred');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Estab');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Categoria');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cod_UE', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per Renaes', 
                'Per_Renaes', 
                $editor, 
                $this->dataset, 'Renaes', 'Cod_UE', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Per_OfiActual field
            //
            $editor = new TextEdit('per_ofiactual_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per OfiActual', 'Per_OfiActual', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Per_NivelRemu field
            //
            $editor = new ComboBox('per_nivelremu_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_remuner`');
            $field = new IntegerField('UE_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('UE_Desc');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('UE_Desc', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per NivelRemu', 
                'Per_NivelRemu', 
                $editor, 
                $this->dataset, 'UE_ID', 'UE_Desc', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Per_CondLabo field
            //
            $editor = new ComboBox('per_condlabo_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_condilab`');
            $field = new IntegerField('Cond_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cond_Desc');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cond_Desc', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per CondLabo', 
                'Per_CondLabo', 
                $editor, 
                $this->dataset, 'Cond_ID', 'Cond_Desc', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
        }
    
        protected function AddInsertColumns($grid)
        {
            //
            // Edit column for Per_Foto field
            //
            $editor = new ImageUploader('per_foto_edit');
            $editor->SetShowImage(false);
            $editColumn = new FileUploadingColumn('Per Foto', 'Per_Foto', $editor, $this->dataset, false, false, 'Per_Foto_handler_insert');
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Per_Dni field
            //
            $editor = new TextEdit('per_dni_edit');
            $editor->SetSize(8);
            $editor->SetMaxLength(8);
            $editColumn = new CustomEditColumn('Per Dni', 'Per_Dni', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Per_Nombres field
            //
            $editor = new TextEdit('per_nombres_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per Nombres', 'Per_Nombres', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Per_FechaNac field
            //
            $editor = new DateTimeEdit('per_fechanac_edit', true, 'Y-m-d H:i:s', 0);
            $editColumn = new CustomEditColumn('Per FechaNac', 'Per_FechaNac', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Per_Celular field
            //
            $editor = new TextEdit('per_celular_edit');
            $editColumn = new CustomEditColumn('Per Celular', 'Per_Celular', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Per_Correo field
            //
            $editor = new TextEdit('per_correo_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per Correo', 'Per_Correo', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Per_Renaes field
            //
            $editor = new ComboBox('per_renaes_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_establecimiento`');
            $field = new IntegerField('Renaes');
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cod_UE');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Nom_UE');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Ubigeo');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Dpto');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Prov');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Dist');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Diresa');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Red');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Mred');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Estab');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Categoria');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cod_UE', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per Renaes', 
                'Per_Renaes', 
                $editor, 
                $this->dataset, 'Renaes', 'Cod_UE', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Per_OfiActual field
            //
            $editor = new TextEdit('per_ofiactual_edit');
            $editor->SetSize(50);
            $editor->SetMaxLength(50);
            $editColumn = new CustomEditColumn('Per OfiActual', 'Per_OfiActual', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Per_NivelRemu field
            //
            $editor = new ComboBox('per_nivelremu_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_remuner`');
            $field = new IntegerField('UE_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('UE_Desc');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('UE_Desc', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per NivelRemu', 
                'Per_NivelRemu', 
                $editor, 
                $this->dataset, 'UE_ID', 'UE_Desc', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Per_CondLabo field
            //
            $editor = new ComboBox('per_condlabo_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_condilab`');
            $field = new IntegerField('Cond_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cond_Desc');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cond_Desc', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Per CondLabo', 
                'Per_CondLabo', 
                $editor, 
                $this->dataset, 'Cond_ID', 'Cond_Desc', $lookupDataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            if ($this->GetSecurityInfo()->HasAddGrant())
            {
                $grid->SetShowAddButton(true);
                $grid->SetShowInlineAddButton(false);
            }
            else
            {
                $grid->SetShowInlineAddButton(false);
                $grid->SetShowAddButton(false);
            }
        }
    
        protected function AddPrintColumns($grid)
        {
            //
            // View column for Per_Foto field
            //
            $column = new DownloadDataColumn('Per_Foto', 'Per Foto', $this->dataset, '<img alt="download" src="' . 'images/download.gif' . '"><br>download');
            $grid->AddPrintColumn($column);
            
            //
            // View column for Per_Dni field
            //
            $column = new TextViewColumn('Per_Dni', 'Per Dni', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Per_Nombres field
            //
            $column = new TextViewColumn('Per_Nombres', 'Per Nombres', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Per_FechaNac field
            //
            $column = new DateTimeViewColumn('Per_FechaNac', 'Per FechaNac', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Per_Celular field
            //
            $column = new TextViewColumn('Per_Celular', 'Per Celular', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Per_Correo field
            //
            $column = new TextViewColumn('Per_Correo', 'Per Correo', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cod_UE field
            //
            $column = new TextViewColumn('Per_Renaes_Cod_UE', 'Per Renaes', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Per_OfiActual field
            //
            $column = new TextViewColumn('Per_OfiActual', 'Per OfiActual', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for UE_Desc field
            //
            $column = new TextViewColumn('Per_NivelRemu_UE_Desc', 'Per NivelRemu', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cond_Desc field
            //
            $column = new TextViewColumn('Per_CondLabo_Cond_Desc', 'Per CondLabo', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
        }
    
        protected function AddExportColumns($grid)
        {
            //
            // View column for Per_Foto field
            //
            $column = new DownloadDataColumn('Per_Foto', 'Per Foto', $this->dataset, '<img alt="download" src="' . 'images/download.gif' . '"><br>download');
            $grid->AddExportColumn($column);
            
            //
            // View column for Per_Dni field
            //
            $column = new TextViewColumn('Per_Dni', 'Per Dni', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Per_Nombres field
            //
            $column = new TextViewColumn('Per_Nombres', 'Per Nombres', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Per_FechaNac field
            //
            $column = new DateTimeViewColumn('Per_FechaNac', 'Per FechaNac', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Per_Celular field
            //
            $column = new TextViewColumn('Per_Celular', 'Per Celular', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Per_Correo field
            //
            $column = new TextViewColumn('Per_Correo', 'Per Correo', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cod_UE field
            //
            $column = new TextViewColumn('Per_Renaes_Cod_UE', 'Per Renaes', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Per_OfiActual field
            //
            $column = new TextViewColumn('Per_OfiActual', 'Per OfiActual', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for UE_Desc field
            //
            $column = new TextViewColumn('Per_NivelRemu_UE_Desc', 'Per NivelRemu', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cond_Desc field
            //
            $column = new TextViewColumn('Per_CondLabo_Cond_Desc', 'Per CondLabo', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
        }
    
        protected function ApplyCommonColumnEditProperties($column)
        {
            $column->SetShowSetToNullCheckBox(true);
    	$column->SetVariableContainer($this->GetColumnVariableContainer());
        }
    
        function GetCustomClientScript()
        {
            return ;
        }
        
        function GetOnPageLoadedClientScript()
        {
            return ;
        }
        public function ShowEditButtonHandler($show)
        {
            if ($this->GetRecordPermission() != null)
                $show = $this->GetRecordPermission()->HasEditGrant($this->GetDataset());
        }
        public function ShowDeleteButtonHandler($show)
        {
            if ($this->GetRecordPermission() != null)
                $show = $this->GetRecordPermission()->HasDeleteGrant($this->GetDataset());
        }
        
        public function GetModalGridDeleteHandler() { return 'm_personalDetailEdit0_modal_delete'; }
        protected function GetEnableModalGridDelete() { return true; }
    
        protected function CreateGrid()
        {
            $result = new Grid($this, $this->dataset, 'm_personalDetailEditGrid0');
            if ($this->GetSecurityInfo()->HasDeleteGrant())
                $result->SetAllowDeleteSelected(false);
            else
                $result->SetAllowDeleteSelected(false);
            ApplyCommonPageSettings($this, $result);
            $result->SetUseImagesForActions(true);
            $result->SetUseFixedHeader(false);
            
            $result->SetShowLineNumbers(false);
            
            $result->SetHighlightRowAtHover(false);
            $result->SetWidth('');
            $this->CreateGridSearchControl($result);
            $this->CreateGridAdvancedSearchControl($result);
    
            $this->AddFieldColumns($result);
            $this->AddSingleRecordViewColumns($result);
            $this->AddEditColumns($result);
            $this->AddInsertColumns($result);
            $this->AddPrintColumns($result);
            $this->AddExportColumns($result);
            $this->AddOperationsColumns($result);
            $this->SetShowPageList(true);
            $this->SetExportToExcelAvailable(true);
            $this->SetExportToWordAvailable(false);
            $this->SetExportToXmlAvailable(false);
            $this->SetExportToCsvAvailable(false);
            $this->SetExportToPdfAvailable(false);
            $this->SetPrinterFriendlyAvailable(false);
            $this->SetSimpleSearchAvailable(true);
            $this->SetAdvancedSearchAvailable(false);
            $this->SetVisualEffectsEnabled(true);
            $this->SetShowTopPageNavigator(true);
            $this->SetShowBottomPageNavigator(true);
    
            //
            // Http Handlers
            //
            $handler = new DownloadHTTPHandler($this->dataset, 'Per_Foto', 'Per_Foto_handler', '', '');
            GetApplication()->RegisterHTTPHandler($handler);
            
            $handler = new ImageHTTPHandler($this->dataset, 'Per_Foto', 'Per_Foto_handler_inline_edit', new NullFilter());
            GetApplication()->RegisterHTTPHandler($handler);
            
            $handler = new ImageHTTPHandler($this->dataset, 'Per_Foto', 'Per_Foto_handler_inline_insert', new NullFilter());
            GetApplication()->RegisterHTTPHandler($handler);$handler = new DownloadHTTPHandler($this->dataset, 'Per_Foto', 'Per_Foto_handler', '', '');
            GetApplication()->RegisterHTTPHandler($handler);
            $handler = new ImageHTTPHandler($this->dataset, 'Per_Foto', 'Per_Foto_handler_edit', new NullFilter());
            GetApplication()->RegisterHTTPHandler($handler);
            $handler = new ImageHTTPHandler($this->dataset, 'Per_Foto', 'Per_Foto_handler_insert', new NullFilter());
            GetApplication()->RegisterHTTPHandler($handler);
            $handler = new DownloadHTTPHandler($this->dataset, 'Per_Foto', 'Per_Foto_handler', '', '');
            GetApplication()->RegisterHTTPHandler($handler);
            return $result;
        }
        
        protected function OpenAdvancedSearchByDefault()
        {
            return false;
        }
    
        protected function DoGetGridHeader()
        {
            return '';
        }    
    }
    ?><?php
    
    ?><?php
    
    class m_establecimientoPage extends Page
    {
        protected function DoBeforeCreate()
        {
            $this->dataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_establecimiento`');
            $field = new IntegerField('Renaes');
            $this->dataset->AddField($field, true);
            $field = new StringField('Cod_UE');
            $this->dataset->AddField($field, false);
            $field = new StringField('Nom_UE');
            $this->dataset->AddField($field, false);
            $field = new StringField('Ubigeo');
            $this->dataset->AddField($field, false);
            $field = new StringField('Dpto');
            $this->dataset->AddField($field, false);
            $field = new StringField('Prov');
            $this->dataset->AddField($field, false);
            $field = new StringField('Dist');
            $this->dataset->AddField($field, false);
            $field = new StringField('Diresa');
            $this->dataset->AddField($field, false);
            $field = new StringField('Red');
            $this->dataset->AddField($field, false);
            $field = new StringField('Mred');
            $this->dataset->AddField($field, false);
            $field = new StringField('Estab');
            $this->dataset->AddField($field, false);
            $field = new StringField('Categoria');
            $this->dataset->AddField($field, false);
        }
    
        protected function CreatePageNavigator()
        {
            $result = new CompositePageNavigator($this);
            
            $partitionNavigator = new PageNavigator('pnav', $this, $this->dataset);
            $partitionNavigator->SetRowsPerPage(50);
            $result->AddPageNavigator($partitionNavigator);
            
            return $result;
        }
    
        public function GetPageList()
        {
            $currentPageCaption = $this->GetShortCaption();
            $result = new PageList();
            if (GetCurrentUserGrantForDataSource('m_personal')->HasViewGrant())
                $result->AddPage(new PageLink($this->RenderText('Personal'), 'm_personal.php', $this->RenderText('Personal'), $currentPageCaption == $this->RenderText('Personal')));
            if (GetCurrentUserGrantForDataSource('per_cap')->HasViewGrant())
                $result->AddPage(new PageLink($this->RenderText('Enlace'), 'per_cap.php', $this->RenderText('Enlace'), $currentPageCaption == $this->RenderText('Enlace')));
            if (GetCurrentUserGrantForDataSource('s7_capacitacion')->HasViewGrant())
                $result->AddPage(new PageLink($this->RenderText('Materia'), 's7_capacitacion.php', $this->RenderText('Materia'), $currentPageCaption == $this->RenderText('Materia')));
            
            if ( HasAdminPage() && GetApplication()->HasAdminGrantForCurrentUser() )
              $result->AddPage(new PageLink($this->RenderText('Admin page'), 'phpgen_admin.php', 'Admin page', false, true));
            return $result;
        }
    
        protected function CreateRssGenerator()
        {
            return null;
        }
    
        protected function CreateGridSearchControl($grid)
        {
            $grid->UseFilter = true;
            $grid->SearchControl = new SimpleSearch('m_establecimientossearch', $this->dataset,
                array('Renaes', 'Cod_UE', 'Nom_UE', 'Ubigeo', 'Dpto', 'Prov', 'Dist', 'Diresa', 'Red', 'Mred', 'Estab', 'Categoria'),
                array($this->RenderText('Renaes'), $this->RenderText('Cod UE'), $this->RenderText('Nom UE'), $this->RenderText('Ubigeo'), $this->RenderText('Dpto'), $this->RenderText('Prov'), $this->RenderText('Dist'), $this->RenderText('Diresa'), $this->RenderText('Red'), $this->RenderText('Mred'), $this->RenderText('Estab'), $this->RenderText('Categoria')),
                array(
                    '=' => $this->GetLocalizerCaptions()->GetMessageString('equals'),
                    '<>' => $this->GetLocalizerCaptions()->GetMessageString('doesNotEquals'),
                    '<' => $this->GetLocalizerCaptions()->GetMessageString('isLessThan'),
                    '<=' => $this->GetLocalizerCaptions()->GetMessageString('isLessThanOrEqualsTo'),
                    '>' => $this->GetLocalizerCaptions()->GetMessageString('isGreaterThan'),
                    '>=' => $this->GetLocalizerCaptions()->GetMessageString('isGreaterThanOrEqualsTo'),
                    'ILIKE' => $this->GetLocalizerCaptions()->GetMessageString('Like'),
                    'STARTS' => $this->GetLocalizerCaptions()->GetMessageString('StartsWith'),
                    'ENDS' => $this->GetLocalizerCaptions()->GetMessageString('EndsWith'),
                    'CONTAINS' => $this->GetLocalizerCaptions()->GetMessageString('Contains')
                    ), $this->GetLocalizerCaptions(), $this, 'CONTAINS'
                );
        }
    
        protected function CreateGridAdvancedSearchControl($grid)
        {
            $this->AdvancedSearchControl = new AdvancedSearchControl('m_establecimientoasearch', $this->dataset, $this->GetLocalizerCaptions(), $this->GetColumnVariableContainer(), $this->CreateLinkBuilder());
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Renaes', $this->RenderText('Renaes')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Cod_UE', $this->RenderText('Cod UE')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Nom_UE', $this->RenderText('Nom UE')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Ubigeo', $this->RenderText('Ubigeo')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Dpto', $this->RenderText('Dpto')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Prov', $this->RenderText('Prov')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Dist', $this->RenderText('Dist')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Diresa', $this->RenderText('Diresa')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Red', $this->RenderText('Red')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Mred', $this->RenderText('Mred')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Estab', $this->RenderText('Estab')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Categoria', $this->RenderText('Categoria')));
        }
    
        protected function AddOperationsColumns($grid)
        {
            $actionsBandName = 'actions';
            $grid->AddBandToBegin($actionsBandName, $this->GetLocalizerCaptions()->GetMessageString('Actions'), true);
            if ($this->GetSecurityInfo()->HasViewGrant())
            {
                $column = $grid->AddViewColumn(new RowOperationByLinkColumn($this->GetLocalizerCaptions()->GetMessageString('View'), OPERATION_VIEW, $this->dataset), $actionsBandName);
                $column->SetImagePath('images/view_action.png');
            }
            if ($this->GetSecurityInfo()->HasEditGrant())
            {
                $column = $grid->AddViewColumn(new RowOperationByLinkColumn($this->GetLocalizerCaptions()->GetMessageString('Edit'), OPERATION_EDIT, $this->dataset), $actionsBandName);
                $column->SetImagePath('images/edit_action.png');
                $column->OnShow->AddListener('ShowEditButtonHandler', $this);
            }
            if ($this->GetSecurityInfo()->HasDeleteGrant())
            {
                $column = $grid->AddViewColumn(new RowOperationByLinkColumn($this->GetLocalizerCaptions()->GetMessageString('Delete'), OPERATION_DELETE, $this->dataset), $actionsBandName);
                $column->SetImagePath('images/delete_action.png');
                $column->OnShow->AddListener('ShowDeleteButtonHandler', $this);
            $column->SetAdditionalAttribute("modal-delete", "true");
            $column->SetAdditionalAttribute("delete-handler-name", $this->GetModalGridDeleteHandler());
            }
        }
    
        protected function AddFieldColumns($grid)
        {
            //
            // View column for Renaes field
            //
            $column = new TextViewColumn('Renaes', 'Renaes', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Renaes field
            //
            $editor = new TextEdit('renaes_edit');
            $editColumn = new CustomEditColumn('Renaes', 'Renaes', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Renaes field
            //
            $editor = new TextEdit('renaes_edit');
            $editColumn = new CustomEditColumn('Renaes', 'Renaes', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Cod_UE field
            //
            $column = new TextViewColumn('Cod_UE', 'Cod UE', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cod_UE field
            //
            $editor = new TextEdit('cod_ue_edit');
            $editor->SetSize(4);
            $editor->SetMaxLength(4);
            $editColumn = new CustomEditColumn('Cod UE', 'Cod_UE', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Cod_UE field
            //
            $editor = new TextEdit('cod_ue_edit');
            $editor->SetSize(4);
            $editor->SetMaxLength(4);
            $editColumn = new CustomEditColumn('Cod UE', 'Cod_UE', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Nom_UE field
            //
            $column = new TextViewColumn('Nom_UE', 'Nom UE', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('Nom_UE_handler');
            
            /* <inline edit column> */
            //
            // Edit column for Nom_UE field
            //
            $editor = new TextEdit('nom_ue_edit');
            $editor->SetSize(100);
            $editor->SetMaxLength(100);
            $editColumn = new CustomEditColumn('Nom UE', 'Nom_UE', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Nom_UE field
            //
            $editor = new TextEdit('nom_ue_edit');
            $editor->SetSize(100);
            $editor->SetMaxLength(100);
            $editColumn = new CustomEditColumn('Nom UE', 'Nom_UE', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Ubigeo field
            //
            $column = new TextViewColumn('Ubigeo', 'Ubigeo', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Ubigeo field
            //
            $editor = new TextEdit('ubigeo_edit');
            $editor->SetSize(6);
            $editor->SetMaxLength(6);
            $editColumn = new CustomEditColumn('Ubigeo', 'Ubigeo', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Ubigeo field
            //
            $editor = new TextEdit('ubigeo_edit');
            $editor->SetSize(6);
            $editor->SetMaxLength(6);
            $editColumn = new CustomEditColumn('Ubigeo', 'Ubigeo', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Dpto field
            //
            $column = new TextViewColumn('Dpto', 'Dpto', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Dpto field
            //
            $editor = new TextEdit('dpto_edit');
            $editor->SetSize(10);
            $editor->SetMaxLength(10);
            $editColumn = new CustomEditColumn('Dpto', 'Dpto', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Dpto field
            //
            $editor = new TextEdit('dpto_edit');
            $editor->SetSize(10);
            $editor->SetMaxLength(10);
            $editColumn = new CustomEditColumn('Dpto', 'Dpto', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Prov field
            //
            $column = new TextViewColumn('Prov', 'Prov', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Prov field
            //
            $editor = new TextEdit('prov_edit');
            $editor->SetSize(12);
            $editor->SetMaxLength(12);
            $editColumn = new CustomEditColumn('Prov', 'Prov', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Prov field
            //
            $editor = new TextEdit('prov_edit');
            $editor->SetSize(12);
            $editor->SetMaxLength(12);
            $editColumn = new CustomEditColumn('Prov', 'Prov', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Dist field
            //
            $column = new TextViewColumn('Dist', 'Dist', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Dist field
            //
            $editor = new TextEdit('dist_edit');
            $editor->SetSize(30);
            $editor->SetMaxLength(30);
            $editColumn = new CustomEditColumn('Dist', 'Dist', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Dist field
            //
            $editor = new TextEdit('dist_edit');
            $editor->SetSize(30);
            $editor->SetMaxLength(30);
            $editColumn = new CustomEditColumn('Dist', 'Dist', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Diresa field
            //
            $column = new TextViewColumn('Diresa', 'Diresa', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Diresa field
            //
            $editor = new TextEdit('diresa_edit');
            $editor->SetSize(10);
            $editor->SetMaxLength(10);
            $editColumn = new CustomEditColumn('Diresa', 'Diresa', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Diresa field
            //
            $editor = new TextEdit('diresa_edit');
            $editor->SetSize(10);
            $editor->SetMaxLength(10);
            $editColumn = new CustomEditColumn('Diresa', 'Diresa', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Red field
            //
            $column = new TextViewColumn('Red', 'Red', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Red field
            //
            $editor = new TextEdit('red_edit');
            $editor->SetSize(35);
            $editor->SetMaxLength(35);
            $editColumn = new CustomEditColumn('Red', 'Red', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Red field
            //
            $editor = new TextEdit('red_edit');
            $editor->SetSize(35);
            $editor->SetMaxLength(35);
            $editColumn = new CustomEditColumn('Red', 'Red', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Mred field
            //
            $column = new TextViewColumn('Mred', 'Mred', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Mred field
            //
            $editor = new TextEdit('mred_edit');
            $editor->SetSize(35);
            $editor->SetMaxLength(35);
            $editColumn = new CustomEditColumn('Mred', 'Mred', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Mred field
            //
            $editor = new TextEdit('mred_edit');
            $editor->SetSize(35);
            $editor->SetMaxLength(35);
            $editColumn = new CustomEditColumn('Mred', 'Mred', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Estab field
            //
            $column = new TextViewColumn('Estab', 'Estab', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Estab field
            //
            $editor = new TextEdit('estab_edit');
            $editor->SetSize(35);
            $editor->SetMaxLength(35);
            $editColumn = new CustomEditColumn('Estab', 'Estab', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Estab field
            //
            $editor = new TextEdit('estab_edit');
            $editor->SetSize(35);
            $editor->SetMaxLength(35);
            $editColumn = new CustomEditColumn('Estab', 'Estab', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Categoria field
            //
            $column = new TextViewColumn('Categoria', 'Categoria', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Categoria field
            //
            $editor = new TextEdit('categoria_edit');
            $editor->SetSize(15);
            $editor->SetMaxLength(15);
            $editColumn = new CustomEditColumn('Categoria', 'Categoria', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Categoria field
            //
            $editor = new TextEdit('categoria_edit');
            $editor->SetSize(15);
            $editor->SetMaxLength(15);
            $editColumn = new CustomEditColumn('Categoria', 'Categoria', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            if (GetCurrentUserGrantForDataSource('m_establecimiento.m_personal')->HasViewGrant())
            {
              //
            // View column for m_personalDetailView0 detail
            //
            $column = new DetailColumn(array('Renaes'), 'detail0', 'm_personalDetailEdit0_handler', 'm_personalDetailView0_handler', $this->dataset, 'M Personal');
              $grid->AddViewColumn($column);
            }
        }
    
        protected function AddSingleRecordViewColumns($grid)
        {
            //
            // View column for Renaes field
            //
            $column = new TextViewColumn('Renaes', 'Renaes', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cod_UE field
            //
            $column = new TextViewColumn('Cod_UE', 'Cod UE', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Nom_UE field
            //
            $column = new TextViewColumn('Nom_UE', 'Nom UE', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('Nom_UE_handler');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Ubigeo field
            //
            $column = new TextViewColumn('Ubigeo', 'Ubigeo', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Dpto field
            //
            $column = new TextViewColumn('Dpto', 'Dpto', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Prov field
            //
            $column = new TextViewColumn('Prov', 'Prov', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Dist field
            //
            $column = new TextViewColumn('Dist', 'Dist', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Diresa field
            //
            $column = new TextViewColumn('Diresa', 'Diresa', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Red field
            //
            $column = new TextViewColumn('Red', 'Red', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Mred field
            //
            $column = new TextViewColumn('Mred', 'Mred', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Estab field
            //
            $column = new TextViewColumn('Estab', 'Estab', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Categoria field
            //
            $column = new TextViewColumn('Categoria', 'Categoria', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
        }
    
        protected function AddEditColumns($grid)
        {
            //
            // Edit column for Renaes field
            //
            $editor = new TextEdit('renaes_edit');
            $editColumn = new CustomEditColumn('Renaes', 'Renaes', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Cod_UE field
            //
            $editor = new TextEdit('cod_ue_edit');
            $editor->SetSize(4);
            $editor->SetMaxLength(4);
            $editColumn = new CustomEditColumn('Cod UE', 'Cod_UE', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Nom_UE field
            //
            $editor = new TextEdit('nom_ue_edit');
            $editor->SetSize(100);
            $editor->SetMaxLength(100);
            $editColumn = new CustomEditColumn('Nom UE', 'Nom_UE', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Ubigeo field
            //
            $editor = new TextEdit('ubigeo_edit');
            $editor->SetSize(6);
            $editor->SetMaxLength(6);
            $editColumn = new CustomEditColumn('Ubigeo', 'Ubigeo', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Dpto field
            //
            $editor = new TextEdit('dpto_edit');
            $editor->SetSize(10);
            $editor->SetMaxLength(10);
            $editColumn = new CustomEditColumn('Dpto', 'Dpto', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Prov field
            //
            $editor = new TextEdit('prov_edit');
            $editor->SetSize(12);
            $editor->SetMaxLength(12);
            $editColumn = new CustomEditColumn('Prov', 'Prov', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Dist field
            //
            $editor = new TextEdit('dist_edit');
            $editor->SetSize(30);
            $editor->SetMaxLength(30);
            $editColumn = new CustomEditColumn('Dist', 'Dist', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Diresa field
            //
            $editor = new TextEdit('diresa_edit');
            $editor->SetSize(10);
            $editor->SetMaxLength(10);
            $editColumn = new CustomEditColumn('Diresa', 'Diresa', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Red field
            //
            $editor = new TextEdit('red_edit');
            $editor->SetSize(35);
            $editor->SetMaxLength(35);
            $editColumn = new CustomEditColumn('Red', 'Red', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Mred field
            //
            $editor = new TextEdit('mred_edit');
            $editor->SetSize(35);
            $editor->SetMaxLength(35);
            $editColumn = new CustomEditColumn('Mred', 'Mred', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Estab field
            //
            $editor = new TextEdit('estab_edit');
            $editor->SetSize(35);
            $editor->SetMaxLength(35);
            $editColumn = new CustomEditColumn('Estab', 'Estab', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Categoria field
            //
            $editor = new TextEdit('categoria_edit');
            $editor->SetSize(15);
            $editor->SetMaxLength(15);
            $editColumn = new CustomEditColumn('Categoria', 'Categoria', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
        }
    
        protected function AddInsertColumns($grid)
        {
            //
            // Edit column for Renaes field
            //
            $editor = new TextEdit('renaes_edit');
            $editColumn = new CustomEditColumn('Renaes', 'Renaes', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Cod_UE field
            //
            $editor = new TextEdit('cod_ue_edit');
            $editor->SetSize(4);
            $editor->SetMaxLength(4);
            $editColumn = new CustomEditColumn('Cod UE', 'Cod_UE', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Nom_UE field
            //
            $editor = new TextEdit('nom_ue_edit');
            $editor->SetSize(100);
            $editor->SetMaxLength(100);
            $editColumn = new CustomEditColumn('Nom UE', 'Nom_UE', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Ubigeo field
            //
            $editor = new TextEdit('ubigeo_edit');
            $editor->SetSize(6);
            $editor->SetMaxLength(6);
            $editColumn = new CustomEditColumn('Ubigeo', 'Ubigeo', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Dpto field
            //
            $editor = new TextEdit('dpto_edit');
            $editor->SetSize(10);
            $editor->SetMaxLength(10);
            $editColumn = new CustomEditColumn('Dpto', 'Dpto', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Prov field
            //
            $editor = new TextEdit('prov_edit');
            $editor->SetSize(12);
            $editor->SetMaxLength(12);
            $editColumn = new CustomEditColumn('Prov', 'Prov', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Dist field
            //
            $editor = new TextEdit('dist_edit');
            $editor->SetSize(30);
            $editor->SetMaxLength(30);
            $editColumn = new CustomEditColumn('Dist', 'Dist', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Diresa field
            //
            $editor = new TextEdit('diresa_edit');
            $editor->SetSize(10);
            $editor->SetMaxLength(10);
            $editColumn = new CustomEditColumn('Diresa', 'Diresa', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Red field
            //
            $editor = new TextEdit('red_edit');
            $editor->SetSize(35);
            $editor->SetMaxLength(35);
            $editColumn = new CustomEditColumn('Red', 'Red', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Mred field
            //
            $editor = new TextEdit('mred_edit');
            $editor->SetSize(35);
            $editor->SetMaxLength(35);
            $editColumn = new CustomEditColumn('Mred', 'Mred', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Estab field
            //
            $editor = new TextEdit('estab_edit');
            $editor->SetSize(35);
            $editor->SetMaxLength(35);
            $editColumn = new CustomEditColumn('Estab', 'Estab', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Categoria field
            //
            $editor = new TextEdit('categoria_edit');
            $editor->SetSize(15);
            $editor->SetMaxLength(15);
            $editColumn = new CustomEditColumn('Categoria', 'Categoria', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            if ($this->GetSecurityInfo()->HasAddGrant())
            {
                $grid->SetShowAddButton(true);
                $grid->SetShowInlineAddButton(false);
            }
            else
            {
                $grid->SetShowInlineAddButton(false);
                $grid->SetShowAddButton(false);
            }
        }
    
        protected function AddPrintColumns($grid)
        {
            //
            // View column for Renaes field
            //
            $column = new TextViewColumn('Renaes', 'Renaes', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cod_UE field
            //
            $column = new TextViewColumn('Cod_UE', 'Cod UE', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Nom_UE field
            //
            $column = new TextViewColumn('Nom_UE', 'Nom UE', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Ubigeo field
            //
            $column = new TextViewColumn('Ubigeo', 'Ubigeo', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Dpto field
            //
            $column = new TextViewColumn('Dpto', 'Dpto', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Prov field
            //
            $column = new TextViewColumn('Prov', 'Prov', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Dist field
            //
            $column = new TextViewColumn('Dist', 'Dist', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Diresa field
            //
            $column = new TextViewColumn('Diresa', 'Diresa', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Red field
            //
            $column = new TextViewColumn('Red', 'Red', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Mred field
            //
            $column = new TextViewColumn('Mred', 'Mred', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Estab field
            //
            $column = new TextViewColumn('Estab', 'Estab', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Categoria field
            //
            $column = new TextViewColumn('Categoria', 'Categoria', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
        }
    
        protected function AddExportColumns($grid)
        {
            //
            // View column for Renaes field
            //
            $column = new TextViewColumn('Renaes', 'Renaes', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cod_UE field
            //
            $column = new TextViewColumn('Cod_UE', 'Cod UE', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Nom_UE field
            //
            $column = new TextViewColumn('Nom_UE', 'Nom UE', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Ubigeo field
            //
            $column = new TextViewColumn('Ubigeo', 'Ubigeo', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Dpto field
            //
            $column = new TextViewColumn('Dpto', 'Dpto', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Prov field
            //
            $column = new TextViewColumn('Prov', 'Prov', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Dist field
            //
            $column = new TextViewColumn('Dist', 'Dist', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Diresa field
            //
            $column = new TextViewColumn('Diresa', 'Diresa', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Red field
            //
            $column = new TextViewColumn('Red', 'Red', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Mred field
            //
            $column = new TextViewColumn('Mred', 'Mred', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Estab field
            //
            $column = new TextViewColumn('Estab', 'Estab', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Categoria field
            //
            $column = new TextViewColumn('Categoria', 'Categoria', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
        }
    
        public function GetPageDirection()
        {
            return null;
        }
    
        protected function ApplyCommonColumnEditProperties($column)
        {
            $column->SetShowSetToNullCheckBox(true);
    	$column->SetVariableContainer($this->GetColumnVariableContainer());
        }
    
        function CreateMasterDetailRecordGridForm_personalDetailEdit0Grid()
        {
            $result = new Grid($this, $this->dataset, 'MasterDetailRecordGridForm_personalDetailEdit0');
            $result->SetAllowDeleteSelected(false);
            $result->SetShowUpdateLink(false);
            $result->SetEnabledInlineEditing(false);
            $result->SetName('master_grid');
            //
            // View column for Renaes field
            //
            $column = new TextViewColumn('Renaes', 'Renaes', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Cod_UE field
            //
            $column = new TextViewColumn('Cod_UE', 'Cod UE', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Nom_UE field
            //
            $column = new TextViewColumn('Nom_UE', 'Nom UE', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('Nom_UE_handler');
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Ubigeo field
            //
            $column = new TextViewColumn('Ubigeo', 'Ubigeo', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Dpto field
            //
            $column = new TextViewColumn('Dpto', 'Dpto', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Prov field
            //
            $column = new TextViewColumn('Prov', 'Prov', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Dist field
            //
            $column = new TextViewColumn('Dist', 'Dist', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Diresa field
            //
            $column = new TextViewColumn('Diresa', 'Diresa', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Red field
            //
            $column = new TextViewColumn('Red', 'Red', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Mred field
            //
            $column = new TextViewColumn('Mred', 'Mred', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Estab field
            //
            $column = new TextViewColumn('Estab', 'Estab', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Categoria field
            //
            $column = new TextViewColumn('Categoria', 'Categoria', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            return $result;
        }
        
        function GetCustomClientScript()
        {
            return ;
        }
        
        function GetOnPageLoadedClientScript()
        {
            return ;
        }
        public function ShowEditButtonHandler($show)
        {
            if ($this->GetRecordPermission() != null)
                $show = $this->GetRecordPermission()->HasEditGrant($this->GetDataset());
        }
        public function ShowDeleteButtonHandler($show)
        {
            if ($this->GetRecordPermission() != null)
                $show = $this->GetRecordPermission()->HasDeleteGrant($this->GetDataset());
        }
        
        public function GetModalGridDeleteHandler() { return 'm_establecimiento_modal_delete'; }
        protected function GetEnableModalGridDelete() { return true; }
    
        protected function CreateGrid()
        {
            $result = new Grid($this, $this->dataset, 'm_establecimientoGrid');
            if ($this->GetSecurityInfo()->HasDeleteGrant())
               $result->SetAllowDeleteSelected(false);
            else
               $result->SetAllowDeleteSelected(false);   
            
            ApplyCommonPageSettings($this, $result);
            
            $result->SetUseImagesForActions(true);
            $result->SetUseFixedHeader(false);
            
            $result->SetShowLineNumbers(false);
            
            $result->SetHighlightRowAtHover(false);
            $result->SetWidth('');
            $this->CreateGridSearchControl($result);
            $this->CreateGridAdvancedSearchControl($result);
    
            $this->AddFieldColumns($result);
            $this->AddSingleRecordViewColumns($result);
            $this->AddEditColumns($result);
            $this->AddInsertColumns($result);
            $this->AddPrintColumns($result);
            $this->AddExportColumns($result);
            $this->AddOperationsColumns($result);
            $this->SetShowPageList(true);
            $this->SetExportToExcelAvailable(true);
            $this->SetExportToWordAvailable(false);
            $this->SetExportToXmlAvailable(false);
            $this->SetExportToCsvAvailable(false);
            $this->SetExportToPdfAvailable(false);
            $this->SetPrinterFriendlyAvailable(false);
            $this->SetSimpleSearchAvailable(true);
            $this->SetAdvancedSearchAvailable(false);
            $this->SetVisualEffectsEnabled(true);
            $this->SetShowTopPageNavigator(true);
            $this->SetShowBottomPageNavigator(true);
    
            //
            // Http Handlers
            //
            //
            // View column for Nom_UE field
            //
            $column = new TextViewColumn('Nom_UE', 'Nom UE', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Nom_UE field
            //
            $editor = new TextEdit('nom_ue_edit');
            $editor->SetSize(100);
            $editor->SetMaxLength(100);
            $editColumn = new CustomEditColumn('Nom UE', 'Nom_UE', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Nom_UE field
            //
            $editor = new TextEdit('nom_ue_edit');
            $editor->SetSize(100);
            $editor->SetMaxLength(100);
            $editColumn = new CustomEditColumn('Nom UE', 'Nom_UE', $editor, $this->dataset);
            $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
            $editor->GetValidatorCollection()->AddValidator($validator);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'Nom_UE_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            $handler = new PageHTTPHandler('m_personalDetailView0_handler', new m_personalDetailView0Page('M Personal', 'M Personal', array('Per_Renaes'), GetCurrentUserGrantForDataSource('m_establecimiento.m_personal'), 'UTF-8', 20, 'm_personalDetailEdit0_handler'));
            GetApplication()->RegisterHTTPHandler($handler);
            $pageEdit = new m_personalDetailEdit0Page($this, array('Per_Renaes'), array('Renaes'), $this->GetForeingKeyFields(), $this->CreateMasterDetailRecordGridForm_personalDetailEdit0Grid(), $this->dataset, GetCurrentUserGrantForDataSource('m_establecimiento.m_personal'), 'UTF-8');
            $pageEdit->SetShortCaption('M Personal');
            $pageEdit->SetHeader(GetPagesHeader());
            $pageEdit->SetFooter(GetPagesFooter());
            $pageEdit->SetCaption('M Personal');
            $pageEdit->SetHttpHandlerName('m_personalDetailEdit0_handler');
            $handler = new PageHTTPHandler('m_personalDetailEdit0_handler', $pageEdit);
            GetApplication()->RegisterHTTPHandler($handler);//
            // View column for Nom_UE field
            //
            $column = new TextViewColumn('Nom_UE', 'Nom UE', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'Nom_UE_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            return $result;
        }
        
        protected function OpenAdvancedSearchByDefault()
        {
            return false;
        }
    
        protected function DoGetGridHeader()
        {
            return '';
        }
    }

    SetUpUserAuthorization(GetApplication());

    try
    {
        $Page = new m_establecimientoPage("m_establecimiento.php", "m_establecimiento", GetCurrentUserGrantForDataSource("m_establecimiento"), 'UTF-8');
        $Page->SetShortCaption('M Establecimiento');
        $Page->SetHeader(GetPagesHeader());
        $Page->SetFooter(GetPagesFooter());
        $Page->SetCaption('M Establecimiento');
        $Page->SetRecordPermission(GetCurrentUserRecordPermissionsForDataSource("m_establecimiento"));

        GetApplication()->SetMainPage($Page);
        GetApplication()->Run();
    }
    catch(Exception $e)
    {
        ShowErrorPage($e->getMessage());
    }

?>
