<?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 per_capDetailView0Page extends DetailPage
    {
        protected function DoBeforeCreate()
        {
            $this->dataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`per_cap`');
            $field = new IntegerField('PC_ID', null, null, true);
            $this->dataset->AddField($field, true);
            $field = new StringField('PC_PerDNI');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('PC_CapID');
            $this->dataset->AddField($field, false);
            $this->dataset->AddLookupField('PC_PerDNI', 'm_personal', new StringField('Per_Dni'), new StringField('Per_Nombres', 'PC_PerDNI_Per_Nombres', 'PC_PerDNI_Per_Nombres_m_personal'), 'PC_PerDNI_Per_Nombres_m_personal');
            $this->dataset->AddLookupField('PC_CapID', 's7_capacitacion', new IntegerField('Cap_ID', null, null, true), new StringField('Cap_Materia', 'PC_CapID_Cap_Materia', 'PC_CapID_Cap_Materia_s7_capacitacion'), 'PC_CapID_Cap_Materia_s7_capacitacion');
        }
    
        protected function AddFieldColumns($grid)
        {
            //
            // View column for PC_ID field
            //
            $column = new TextViewColumn('PC_ID', 'PC ID', $this->dataset);
            $column->SetOrderable(false);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Per_Nombres field
            //
            $column = new TextViewColumn('PC_PerDNI_Per_Nombres', 'PC PerDNI', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for PC_PerDNI field
            //
            $editor = new ComboBox('pc_perdni_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_personal`');
            $field = new BlobField('Per_Foto');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_Dni');
            $lookupDataset->AddField($field, true);
            $field = new StringField('Per_Nombres');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Per_FechaNac');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_Celular');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_Correo');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_Renaes');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_OfiActual');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_NivelRemu');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_CondLabo');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Per_Nombres', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'PC PerDNI', 
                'PC_PerDNI', 
                $editor, 
                $this->dataset, 'Per_Dni', 'Per_Nombres', $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 PC_PerDNI field
            //
            $editor = new ComboBox('pc_perdni_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_personal`');
            $field = new BlobField('Per_Foto');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_Dni');
            $lookupDataset->AddField($field, true);
            $field = new StringField('Per_Nombres');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Per_FechaNac');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_Celular');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_Correo');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_Renaes');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_OfiActual');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_NivelRemu');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_CondLabo');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Per_Nombres', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'PC PerDNI', 
                'PC_PerDNI', 
                $editor, 
                $this->dataset, 'Per_Dni', 'Per_Nombres', $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 Cap_Materia field
            //
            $column = new TextViewColumn('PC_CapID_Cap_Materia', 'PC CapID', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for PC_CapID field
            //
            $editor = new ComboBox('pc_capid_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`s7_capacitacion`');
            $field = new IntegerField('Cap_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cap_Materia');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Cap_Desde');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Cap_Hasta');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Cap_Proveedor');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Creditos');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Horas');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Nota');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_NumFolio');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_TipDoc');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Tipo');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Costo');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Cap_Detalle');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cap_Materia', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'PC CapID', 
                'PC_CapID', 
                $editor, 
                $this->dataset, 'Cap_ID', 'Cap_Materia', $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 PC_CapID field
            //
            $editor = new ComboBox('pc_capid_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`s7_capacitacion`');
            $field = new IntegerField('Cap_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cap_Materia');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Cap_Desde');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Cap_Hasta');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Cap_Proveedor');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Creditos');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Horas');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Nota');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_NumFolio');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_TipDoc');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Tipo');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Costo');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Cap_Detalle');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cap_Materia', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'PC CapID', 
                'PC_CapID', 
                $editor, 
                $this->dataset, 'Cap_ID', 'Cap_Materia', $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(false);
        }
    
        protected function CreateGrid()
        {
            $result = new Grid($this, $this->dataset, 'per_capDetailViewGrid0');
            $result->SetAllowDeleteSelected(false);
            $result->SetUseFixedHeader(false);
            
            $result->SetShowLineNumbers(false);
            
            $result->SetHighlightRowAtHover(false);
            $result->SetWidth('');
            $this->AddFieldColumns($result);
    
            return $result;
        }
    }
    
    
    
    ?><?php
    
    ?><?php
    
    class per_capDetailEdit0Page extends DetailPageEdit
    {
        protected function DoBeforeCreate()
        {
            $this->dataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`per_cap`');
            $field = new IntegerField('PC_ID', null, null, true);
            $this->dataset->AddField($field, true);
            $field = new StringField('PC_PerDNI');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('PC_CapID');
            $this->dataset->AddField($field, false);
            $this->dataset->AddLookupField('PC_PerDNI', 'm_personal', new StringField('Per_Dni'), new StringField('Per_Nombres', 'PC_PerDNI_Per_Nombres', 'PC_PerDNI_Per_Nombres_m_personal'), 'PC_PerDNI_Per_Nombres_m_personal');
            $this->dataset->AddLookupField('PC_CapID', 's7_capacitacion', new IntegerField('Cap_ID', null, null, true), new StringField('Cap_Materia', 'PC_CapID_Cap_Materia', 'PC_CapID_Cap_Materia_s7_capacitacion'), 'PC_CapID_Cap_Materia_s7_capacitacion');
        }
    
        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('per_capDetailEdit0ssearch', $this->dataset,
                array('PC_ID', 'PC_PerDNI_Per_Nombres', 'PC_CapID_Cap_Materia'),
                array($this->RenderText('PC ID'), $this->RenderText('PC PerDNI'), $this->RenderText('PC CapID')),
                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('per_capDetailEdit0asearch', $this->dataset, $this->GetLocalizerCaptions(), $this->GetColumnVariableContainer(), $this->CreateLinkBuilder());
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('PC_ID', $this->RenderText('PC ID')));
            
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_personal`');
            $field = new BlobField('Per_Foto');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_Dni');
            $lookupDataset->AddField($field, true);
            $field = new StringField('Per_Nombres');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Per_FechaNac');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_Celular');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_Correo');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_Renaes');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_OfiActual');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_NivelRemu');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_CondLabo');
            $lookupDataset->AddField($field, false);
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateLookupSearchInput('PC_PerDNI', $this->RenderText('PC PerDNI'), $lookupDataset, 'Per_Dni', 'Per_Nombres', false));
            
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`s7_capacitacion`');
            $field = new IntegerField('Cap_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cap_Materia');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Cap_Desde');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Cap_Hasta');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Cap_Proveedor');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Creditos');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Horas');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Nota');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_NumFolio');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_TipDoc');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Tipo');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Costo');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Cap_Detalle');
            $lookupDataset->AddField($field, false);
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateLookupSearchInput('PC_CapID', $this->RenderText('PC CapID'), $lookupDataset, 'Cap_ID', 'Cap_Materia', 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 PC_ID field
            //
            $column = new TextViewColumn('PC_ID', 'PC ID', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Per_Nombres field
            //
            $column = new TextViewColumn('PC_PerDNI_Per_Nombres', 'PC PerDNI', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for PC_PerDNI field
            //
            $editor = new ComboBox('pc_perdni_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_personal`');
            $field = new BlobField('Per_Foto');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_Dni');
            $lookupDataset->AddField($field, true);
            $field = new StringField('Per_Nombres');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Per_FechaNac');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_Celular');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_Correo');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_Renaes');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_OfiActual');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_NivelRemu');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_CondLabo');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Per_Nombres', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'PC PerDNI', 
                'PC_PerDNI', 
                $editor, 
                $this->dataset, 'Per_Dni', 'Per_Nombres', $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 PC_PerDNI field
            //
            $editor = new ComboBox('pc_perdni_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_personal`');
            $field = new BlobField('Per_Foto');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_Dni');
            $lookupDataset->AddField($field, true);
            $field = new StringField('Per_Nombres');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Per_FechaNac');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_Celular');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_Correo');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_Renaes');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_OfiActual');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_NivelRemu');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_CondLabo');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Per_Nombres', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'PC PerDNI', 
                'PC_PerDNI', 
                $editor, 
                $this->dataset, 'Per_Dni', 'Per_Nombres', $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 Cap_Materia field
            //
            $column = new TextViewColumn('PC_CapID_Cap_Materia', 'PC CapID', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for PC_CapID field
            //
            $editor = new ComboBox('pc_capid_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`s7_capacitacion`');
            $field = new IntegerField('Cap_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cap_Materia');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Cap_Desde');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Cap_Hasta');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Cap_Proveedor');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Creditos');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Horas');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Nota');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_NumFolio');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_TipDoc');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Tipo');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Costo');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Cap_Detalle');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cap_Materia', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'PC CapID', 
                'PC_CapID', 
                $editor, 
                $this->dataset, 'Cap_ID', 'Cap_Materia', $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 PC_CapID field
            //
            $editor = new ComboBox('pc_capid_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`s7_capacitacion`');
            $field = new IntegerField('Cap_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cap_Materia');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Cap_Desde');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Cap_Hasta');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Cap_Proveedor');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Creditos');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Horas');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Nota');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_NumFolio');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_TipDoc');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Tipo');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Costo');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Cap_Detalle');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cap_Materia', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'PC CapID', 
                'PC_CapID', 
                $editor, 
                $this->dataset, 'Cap_ID', 'Cap_Materia', $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 PC_ID field
            //
            $column = new TextViewColumn('PC_ID', 'PC ID', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Per_Nombres field
            //
            $column = new TextViewColumn('PC_PerDNI_Per_Nombres', 'PC PerDNI', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Materia field
            //
            $column = new TextViewColumn('PC_CapID_Cap_Materia', 'PC CapID', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
        }
    
        protected function AddEditColumns($grid)
        {
            //
            // Edit column for PC_PerDNI field
            //
            $editor = new ComboBox('pc_perdni_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_personal`');
            $field = new BlobField('Per_Foto');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_Dni');
            $lookupDataset->AddField($field, true);
            $field = new StringField('Per_Nombres');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Per_FechaNac');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_Celular');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_Correo');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_Renaes');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_OfiActual');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_NivelRemu');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_CondLabo');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Per_Nombres', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'PC PerDNI', 
                'PC_PerDNI', 
                $editor, 
                $this->dataset, 'Per_Dni', 'Per_Nombres', $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 PC_CapID field
            //
            $editor = new ComboBox('pc_capid_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`s7_capacitacion`');
            $field = new IntegerField('Cap_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cap_Materia');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Cap_Desde');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Cap_Hasta');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Cap_Proveedor');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Creditos');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Horas');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Nota');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_NumFolio');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_TipDoc');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Tipo');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Costo');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Cap_Detalle');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cap_Materia', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'PC CapID', 
                'PC_CapID', 
                $editor, 
                $this->dataset, 'Cap_ID', 'Cap_Materia', $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 PC_PerDNI field
            //
            $editor = new ComboBox('pc_perdni_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_personal`');
            $field = new BlobField('Per_Foto');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_Dni');
            $lookupDataset->AddField($field, true);
            $field = new StringField('Per_Nombres');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Per_FechaNac');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_Celular');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_Correo');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_Renaes');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Per_OfiActual');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_NivelRemu');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Per_CondLabo');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Per_Nombres', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'PC PerDNI', 
                'PC_PerDNI', 
                $editor, 
                $this->dataset, 'Per_Dni', 'Per_Nombres', $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 PC_CapID field
            //
            $editor = new ComboBox('pc_capid_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`s7_capacitacion`');
            $field = new IntegerField('Cap_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Cap_Materia');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Cap_Desde');
            $lookupDataset->AddField($field, false);
            $field = new DateField('Cap_Hasta');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Cap_Proveedor');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Creditos');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Horas');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Nota');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_NumFolio');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_TipDoc');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Tipo');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('Cap_Costo');
            $lookupDataset->AddField($field, false);
            $field = new StringField('Cap_Detalle');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Cap_Materia', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'PC CapID', 
                'PC_CapID', 
                $editor, 
                $this->dataset, 'Cap_ID', 'Cap_Materia', $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 PC_ID field
            //
            $column = new TextViewColumn('PC_ID', 'PC ID', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Per_Nombres field
            //
            $column = new TextViewColumn('PC_PerDNI_Per_Nombres', 'PC PerDNI', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Materia field
            //
            $column = new TextViewColumn('PC_CapID_Cap_Materia', 'PC CapID', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
        }
    
        protected function AddExportColumns($grid)
        {
            //
            // View column for PC_ID field
            //
            $column = new TextViewColumn('PC_ID', 'PC ID', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Per_Nombres field
            //
            $column = new TextViewColumn('PC_PerDNI_Per_Nombres', 'PC PerDNI', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Materia field
            //
            $column = new TextViewColumn('PC_CapID_Cap_Materia', 'PC CapID', $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 'per_capDetailEdit0_modal_delete'; }
        protected function GetEnableModalGridDelete() { return true; }
    
        protected function CreateGrid()
        {
            $result = new Grid($this, $this->dataset, 'per_capDetailEditGrid0');
            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
            //
    
            return $result;
        }
        
        protected function OpenAdvancedSearchByDefault()
        {
            return false;
        }
    
        protected function DoGetGridHeader()
        {
            return '';
        }    
    }
    ?><?php
    
    ?><?php
    
    class m_personalPage extends Page
    {
        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('Estab', 'Per_Renaes_Estab', 'Per_Renaes_Estab_m_establecimiento'), 'Per_Renaes_Estab_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()
        {
            $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_personalssearch', $this->dataset,
                array('Per_Dni', 'Per_Nombres', 'Per_FechaNac', 'Per_Celular', 'Per_Correo', 'Per_Renaes_Estab', 'Per_OfiActual', 'Per_NivelRemu_UE_Desc', 'Per_CondLabo_Cond_Desc', 'Per_Foto'),
                array($this->RenderText('DNI'), $this->RenderText('Apellidos, Nombres'), $this->RenderText('Fecha de Nacimiento'), $this->RenderText('Celular'), $this->RenderText('Email'), $this->RenderText('Renaes'), $this->RenderText('Oficina Actual'), $this->RenderText('Per NivelRemu'), $this->RenderText('Per CondLabo'), $this->RenderText('Foto')),
                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, '='
                );
        }
    
        protected function CreateGridAdvancedSearchControl($grid)
        {
    
        }
    
        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());
            }
            if ($this->GetSecurityInfo()->HasAddGrant())
            {
                $column = $grid->AddViewColumn(new RowOperationByLinkColumn($this->GetLocalizerCaptions()->GetMessageString('Copy'), OPERATION_COPY, $this->dataset), $actionsBandName);
                $column->SetImagePath('images/copy_action.png');
            }
        }
    
        protected function AddFieldColumns($grid)
        {
            //
            // View column for Per_Foto field
            //
            $column = new ImageViewColumn('Per_Foto', 'Foto', $this->dataset, false, 'Per_Foto_handler_list');
            
            /* <inline edit column> */
            //
            // Edit column for Per_Foto field
            //
            $editor = new ImageUploader('per_foto_edit');
            $editor->SetShowImage(true);
            $editColumn = new FileUploadingColumn('Foto', 'Per_Foto', $editor, $this->dataset, false, false, 'Per_Foto_handler_inline_edit');
            $editColumn->SetAllowSetToNull(true);
            $editColumn->SetImageFilter(new NullFilter());
            $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(true);
            $editColumn = new FileUploadingColumn('Foto', 'Per_Foto', $editor, $this->dataset, false, false, 'Per_Foto_handler_inline_insert');
            $editColumn->SetAllowSetToNull(true);
            $editColumn->SetImageFilter(new NullFilter());
            $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', '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('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('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', 'Apellidos, 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('Apellidos, 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('Apellidos, 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', 'Fecha de Nacimiento', $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('Fecha de Nacimiento', '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('Fecha de Nacimiento', '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', 'Celular', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Per_Celular field
            //
            $editor = new TextEdit('per_celular_edit');
            $editColumn = new CustomEditColumn('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('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', 'Email', $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('Email', '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('Email', '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 Estab field
            //
            $column = new TextViewColumn('Per_Renaes_Estab', '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('Estab', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Renaes', 
                'Per_Renaes', 
                $editor, 
                $this->dataset, 'Renaes', 'Estab', $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('Estab', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Renaes', 
                'Per_Renaes', 
                $editor, 
                $this->dataset, 'Renaes', 'Estab', $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', 'Oficina Actual', $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('Oficina Actual', '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('Oficina Actual', '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);
            
            if (GetCurrentUserGrantForDataSource('m_personal.per_cap')->HasViewGrant())
            {
              //
            // View column for per_capDetailView0 detail
            //
            $column = new DetailColumn(array('Per_Dni'), 'detail0', 'per_capDetailEdit0_handler', 'per_capDetailView0_handler', $this->dataset, 'Per Cap');
              $grid->AddViewColumn($column);
            }
        }
    
        protected function AddSingleRecordViewColumns($grid)
        {
            //
            // View column for Per_Foto field
            //
            $column = new ImageViewColumn('Per_Foto', 'Foto', $this->dataset, false, 'Per_Foto_handler_view');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Per_Dni field
            //
            $column = new TextViewColumn('Per_Dni', 'DNI', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Per_Nombres field
            //
            $column = new TextViewColumn('Per_Nombres', 'Apellidos, Nombres', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Per_FechaNac field
            //
            $column = new DateTimeViewColumn('Per_FechaNac', 'Fecha de Nacimiento', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Per_Celular field
            //
            $column = new TextViewColumn('Per_Celular', 'Celular', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Per_Correo field
            //
            $column = new TextViewColumn('Per_Correo', 'Email', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Estab field
            //
            $column = new TextViewColumn('Per_Renaes_Estab', 'Renaes', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Per_OfiActual field
            //
            $column = new TextViewColumn('Per_OfiActual', 'Oficina Actual', $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(true);
            $editColumn = new FileUploadingColumn('Foto', 'Per_Foto', $editor, $this->dataset, false, false, 'Per_Foto_handler_edit');
            $editColumn->SetAllowSetToNull(true);
            $editColumn->SetImageFilter(new NullFilter());
            $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('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('Apellidos, 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('Fecha de Nacimiento', '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('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('Email', '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('Estab', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Renaes', 
                'Per_Renaes', 
                $editor, 
                $this->dataset, 'Renaes', 'Estab', $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('Oficina Actual', '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(true);
            $editColumn = new FileUploadingColumn('Foto', 'Per_Foto', $editor, $this->dataset, false, false, 'Per_Foto_handler_insert');
            $editColumn->SetAllowSetToNull(true);
            $editColumn->SetImageFilter(new NullFilter());
            $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('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('Apellidos, 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('Fecha de Nacimiento', '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('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('Email', '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('Estab', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Renaes', 
                'Per_Renaes', 
                $editor, 
                $this->dataset, 'Renaes', 'Estab', $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('Oficina Actual', '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 ImageViewColumn('Per_Foto', 'Foto', $this->dataset, false, 'Per_Foto_handler_print');
            $grid->AddPrintColumn($column);
            
            //
            // View column for Per_Dni field
            //
            $column = new TextViewColumn('Per_Dni', 'DNI', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Per_Nombres field
            //
            $column = new TextViewColumn('Per_Nombres', 'Apellidos, Nombres', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Per_FechaNac field
            //
            $column = new DateTimeViewColumn('Per_FechaNac', 'Fecha de Nacimiento', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Per_Celular field
            //
            $column = new TextViewColumn('Per_Celular', 'Celular', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Per_Correo field
            //
            $column = new TextViewColumn('Per_Correo', 'Email', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Estab field
            //
            $column = new TextViewColumn('Per_Renaes_Estab', 'Renaes', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Per_OfiActual field
            //
            $column = new TextViewColumn('Per_OfiActual', 'Oficina Actual', $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 ImageViewColumn('Per_Foto', 'Foto', $this->dataset, false, 'Per_Foto_handler_export');
            $grid->AddExportColumn($column);
            
            //
            // View column for Per_Dni field
            //
            $column = new TextViewColumn('Per_Dni', 'DNI', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Per_Nombres field
            //
            $column = new TextViewColumn('Per_Nombres', 'Apellidos, Nombres', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Per_FechaNac field
            //
            $column = new DateTimeViewColumn('Per_FechaNac', 'Fecha de Nacimiento', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Per_Celular field
            //
            $column = new TextViewColumn('Per_Celular', 'Celular', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Per_Correo field
            //
            $column = new TextViewColumn('Per_Correo', 'Email', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Estab field
            //
            $column = new TextViewColumn('Per_Renaes_Estab', 'Renaes', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Per_OfiActual field
            //
            $column = new TextViewColumn('Per_OfiActual', 'Oficina Actual', $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);
        }
    
        public function GetPageDirection()
        {
            return null;
        }
    
        protected function ApplyCommonColumnEditProperties($column)
        {
            $column->SetShowSetToNullCheckBox(false);
    	$column->SetVariableContainer($this->GetColumnVariableContainer());
        }
    
        function CreateMasterDetailRecordGridForper_capDetailEdit0Grid()
        {
            $result = new Grid($this, $this->dataset, 'MasterDetailRecordGridForper_capDetailEdit0');
            $result->SetAllowDeleteSelected(false);
            $result->SetShowUpdateLink(false);
            $result->SetEnabledInlineEditing(false);
            $result->SetName('master_grid');
            //
            // View column for Per_Foto field
            //
            $column = new ImageViewColumn('Per_Foto', 'Foto', $this->dataset, false, 'Per_Foto_handler_list');
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Per_Dni field
            //
            $column = new TextViewColumn('Per_Dni', 'DNI', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Per_Nombres field
            //
            $column = new TextViewColumn('Per_Nombres', 'Apellidos, Nombres', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Per_FechaNac field
            //
            $column = new DateTimeViewColumn('Per_FechaNac', 'Fecha de Nacimiento', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Per_Celular field
            //
            $column = new TextViewColumn('Per_Celular', 'Celular', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Per_Correo field
            //
            $column = new TextViewColumn('Per_Correo', 'Email', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Estab field
            //
            $column = new TextViewColumn('Per_Renaes_Estab', 'Renaes', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Per_OfiActual field
            //
            $column = new TextViewColumn('Per_OfiActual', 'Oficina Actual', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for UE_Desc field
            //
            $column = new TextViewColumn('Per_NivelRemu_UE_Desc', 'Per NivelRemu', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Cond_Desc field
            //
            $column = new TextViewColumn('Per_CondLabo_Cond_Desc', 'Per CondLabo', $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_personal_modal_delete'; }
        protected function GetEnableModalGridDelete() { return true; }
    
        protected function CreateGrid()
        {
            $result = new Grid($this, $this->dataset, 'm_personalGrid');
            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(false);
            $this->SetAdvancedSearchAvailable(false);
            $this->SetVisualEffectsEnabled(true);
            $this->SetShowTopPageNavigator(true);
            $this->SetShowBottomPageNavigator(true);
    
            //
            // Http Handlers
            //
            $handler = new ImageHTTPHandler($this->dataset, 'Per_Foto', 'Per_Foto_handler_list', new NullFilter());
            GetApplication()->RegisterHTTPHandler($handler);
            $handler = new PageHTTPHandler('per_capDetailView0_handler', new per_capDetailView0Page('Per Cap', 'Per Cap', array('PC_PerDNI'), GetCurrentUserGrantForDataSource('m_personal.per_cap'), 'UTF-8', 20, 'per_capDetailEdit0_handler'));
            GetApplication()->RegisterHTTPHandler($handler);
            $pageEdit = new per_capDetailEdit0Page($this, array('PC_PerDNI'), array('Per_Dni'), $this->GetForeingKeyFields(), $this->CreateMasterDetailRecordGridForper_capDetailEdit0Grid(), $this->dataset, GetCurrentUserGrantForDataSource('m_personal.per_cap'), 'UTF-8');
            $pageEdit->SetShortCaption('Per Cap');
            $pageEdit->SetHeader(GetPagesHeader());
            $pageEdit->SetFooter(GetPagesFooter());
            $pageEdit->SetCaption('Per Cap');
            $pageEdit->SetHttpHandlerName('per_capDetailEdit0_handler');
            $handler = new PageHTTPHandler('per_capDetailEdit0_handler', $pageEdit);
            GetApplication()->RegisterHTTPHandler($handler);$handler = new ImageHTTPHandler($this->dataset, 'Per_Foto', 'Per_Foto_handler_view', new NullFilter());
            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 ImageHTTPHandler($this->dataset, 'Per_Foto', 'Per_Foto_handler_print', new NullFilter());
            GetApplication()->RegisterHTTPHandler($handler);
            return $result;
        }
        
        protected function OpenAdvancedSearchByDefault()
        {
            return false;
        }
    
        protected function DoGetGridHeader()
        {
            return '';
        }
    }

    SetUpUserAuthorization(GetApplication());

    try
    {
        $Page = new m_personalPage("m_personal.php", "m_personal", GetCurrentUserGrantForDataSource("m_personal"), 'UTF-8');
        $Page->SetShortCaption('Personal');
        $Page->SetHeader(GetPagesHeader());
        $Page->SetFooter(GetPagesFooter());
        $Page->SetCaption('Personal');
        $Page->SetRecordPermission(GetCurrentUserRecordPermissionsForDataSource("m_personal"));

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

?>
