<?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 s7_capacitacionPage extends Page
    {
        protected function DoBeforeCreate()
        {
            $this->dataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`s7_capacitacion`');
            $field = new IntegerField('Cap_ID', null, null, true);
            $this->dataset->AddField($field, true);
            $field = new StringField('Cap_Materia');
            $this->dataset->AddField($field, false);
            $field = new DateField('Cap_Desde');
            $this->dataset->AddField($field, false);
            $field = new DateField('Cap_Hasta');
            $this->dataset->AddField($field, false);
            $field = new StringField('Cap_Proveedor');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Cap_Creditos');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Cap_Horas');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Cap_Nota');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Cap_NumFolio');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Cap_TipDoc');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Cap_Tipo');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Cap_Costo');
            $this->dataset->AddField($field, false);
            $field = new StringField('Cap_Detalle');
            $this->dataset->AddField($field, false);
            $this->dataset->AddLookupField('Cap_TipDoc', 'm_tipdoc', new IntegerField('Tdoc_ID', null, null, true), new StringField('Tdoc_Desc', 'Cap_TipDoc_Tdoc_Desc', 'Cap_TipDoc_Tdoc_Desc_m_tipdoc'), 'Cap_TipDoc_Tdoc_Desc_m_tipdoc');
        }
    
        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('s7_capacitacionssearch', $this->dataset,
                array('Cap_ID', 'Cap_Materia', 'Cap_Desde', 'Cap_Hasta', 'Cap_Proveedor', 'Cap_Creditos', 'Cap_Horas', 'Cap_Nota', 'Cap_NumFolio', 'Cap_TipDoc_Tdoc_Desc', 'Cap_Tipo', 'Cap_Costo', 'Cap_Detalle'),
                array($this->RenderText('ID Capacitacion'), $this->RenderText('Materia'), $this->RenderText('Fecha Inicio'), $this->RenderText('Fecha Final'), $this->RenderText('Proveedor'), $this->RenderText('Nro de Creditos'), $this->RenderText('Nro de Horas'), $this->RenderText('Calificacion'), $this->RenderText('Nro de Folios'), $this->RenderText('Tipo de Documento'), $this->RenderText('Tipo de Capacitacion'), $this->RenderText('Costo'), $this->RenderText('Detalle')),
                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)
        {
    
        }
    
        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 Cap_ID field
            //
            $column = new TextViewColumn('Cap_ID', 'ID Capacitacion', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Cap_Materia field
            //
            $column = new TextViewColumn('Cap_Materia', 'Materia', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Materia field
            //
            $editor = new TextAreaEdit('cap_materia_edit', 50, 8);
            $editColumn = new CustomEditColumn('Materia', 'Cap_Materia', $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 Cap_Materia field
            //
            $editor = new TextAreaEdit('cap_materia_edit', 50, 8);
            $editColumn = new CustomEditColumn('Materia', 'Cap_Materia', $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 Cap_Desde field
            //
            $column = new DateTimeViewColumn('Cap_Desde', 'Fecha Inicio', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Desde field
            //
            $editor = new DateTimeEdit('cap_desde_edit', true, 'Y-m-d H:i:s', 0);
            $editColumn = new CustomEditColumn('Fecha Inicio', 'Cap_Desde', $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 Cap_Desde field
            //
            $editor = new DateTimeEdit('cap_desde_edit', true, 'Y-m-d H:i:s', 0);
            $editColumn = new CustomEditColumn('Fecha Inicio', 'Cap_Desde', $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 Cap_Hasta field
            //
            $column = new DateTimeViewColumn('Cap_Hasta', 'Fecha Final', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Hasta field
            //
            $editor = new DateTimeEdit('cap_hasta_edit', true, 'Y-m-d H:i:s', 0);
            $editColumn = new CustomEditColumn('Fecha Final', 'Cap_Hasta', $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 Cap_Hasta field
            //
            $editor = new DateTimeEdit('cap_hasta_edit', true, 'Y-m-d H:i:s', 0);
            $editColumn = new CustomEditColumn('Fecha Final', 'Cap_Hasta', $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 Cap_Proveedor field
            //
            $column = new TextViewColumn('Cap_Proveedor', 'Proveedor', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Proveedor field
            //
            $editor = new TextAreaEdit('cap_proveedor_edit', 50, 8);
            $editColumn = new CustomEditColumn('Proveedor', 'Cap_Proveedor', $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 Cap_Proveedor field
            //
            $editor = new TextAreaEdit('cap_proveedor_edit', 50, 8);
            $editColumn = new CustomEditColumn('Proveedor', 'Cap_Proveedor', $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 Cap_Creditos field
            //
            $column = new TextViewColumn('Cap_Creditos', 'Nro de Creditos', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Creditos field
            //
            $editor = new TextEdit('cap_creditos_edit');
            $editColumn = new CustomEditColumn('Nro de Creditos', 'Cap_Creditos', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Cap_Creditos field
            //
            $editor = new TextEdit('cap_creditos_edit');
            $editColumn = new CustomEditColumn('Nro de Creditos', 'Cap_Creditos', $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 Cap_Horas field
            //
            $column = new TextViewColumn('Cap_Horas', 'Nro de Horas', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Horas field
            //
            $editor = new TextEdit('cap_horas_edit');
            $editColumn = new CustomEditColumn('Nro de Horas', 'Cap_Horas', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Cap_Horas field
            //
            $editor = new TextEdit('cap_horas_edit');
            $editColumn = new CustomEditColumn('Nro de Horas', 'Cap_Horas', $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 Cap_Nota field
            //
            $column = new TextViewColumn('Cap_Nota', 'Calificacion', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Nota field
            //
            $editor = new TextEdit('cap_nota_edit');
            $editColumn = new CustomEditColumn('Calificacion', 'Cap_Nota', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Cap_Nota field
            //
            $editor = new TextEdit('cap_nota_edit');
            $editColumn = new CustomEditColumn('Calificacion', 'Cap_Nota', $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 Cap_NumFolio field
            //
            $column = new TextViewColumn('Cap_NumFolio', 'Nro de Folios', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_NumFolio field
            //
            $editor = new TextEdit('cap_numfolio_edit');
            $editColumn = new CustomEditColumn('Nro de Folios', 'Cap_NumFolio', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Cap_NumFolio field
            //
            $editor = new TextEdit('cap_numfolio_edit');
            $editColumn = new CustomEditColumn('Nro de Folios', 'Cap_NumFolio', $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 Tdoc_Desc field
            //
            $column = new TextViewColumn('Cap_TipDoc_Tdoc_Desc', 'Tipo de Documento', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_TipDoc field
            //
            $editor = new ComboBox('cap_tipdoc_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_tipdoc`');
            $field = new IntegerField('Tdoc_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Tdoc_Desc');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Tdoc_Desc', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Tipo de Documento', 
                'Cap_TipDoc', 
                $editor, 
                $this->dataset, 'Tdoc_ID', 'Tdoc_Desc', $lookupDataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Cap_TipDoc field
            //
            $editor = new ComboBox('cap_tipdoc_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_tipdoc`');
            $field = new IntegerField('Tdoc_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Tdoc_Desc');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Tdoc_Desc', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Tipo de Documento', 
                'Cap_TipDoc', 
                $editor, 
                $this->dataset, 'Tdoc_ID', 'Tdoc_Desc', $lookupDataset);
            $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 Cap_Tipo field
            //
            $column = new TextViewColumn('Cap_Tipo', 'Tipo de Capacitacion', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Tipo field
            //
            $editor = new TextEdit('cap_tipo_edit');
            $editColumn = new CustomEditColumn('Tipo de Capacitacion', 'Cap_Tipo', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Cap_Tipo field
            //
            $editor = new TextEdit('cap_tipo_edit');
            $editColumn = new CustomEditColumn('Tipo de Capacitacion', 'Cap_Tipo', $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 Cap_Costo field
            //
            $column = new TextViewColumn('Cap_Costo', 'Costo', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Costo field
            //
            $editor = new TextEdit('cap_costo_edit');
            $editColumn = new CustomEditColumn('Costo', 'Cap_Costo', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Cap_Costo field
            //
            $editor = new TextEdit('cap_costo_edit');
            $editColumn = new CustomEditColumn('Costo', 'Cap_Costo', $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 Cap_Detalle field
            //
            $column = new TextViewColumn('Cap_Detalle', 'Detalle', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(250);
            $column->SetFullTextWindowHandlerName('Cap_Detalle_handler');
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Detalle field
            //
            $editor = new TextAreaEdit('cap_detalle_edit', 50, 8);
            $editColumn = new CustomEditColumn('Detalle', 'Cap_Detalle', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Cap_Detalle field
            //
            $editor = new TextAreaEdit('cap_detalle_edit', 50, 8);
            $editColumn = new CustomEditColumn('Detalle', 'Cap_Detalle', $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);
            
            if (GetCurrentUserGrantForDataSource('s7_capacitacion.per_cap')->HasViewGrant())
            {
              //
            // View column for per_capDetailView0 detail
            //
            $column = new DetailColumn(array('Cap_ID'), 'detail0', 'per_capDetailEdit0_handler', 'per_capDetailView0_handler', $this->dataset, 'Per Cap');
              $grid->AddViewColumn($column);
            }
        }
    
        protected function AddSingleRecordViewColumns($grid)
        {
            //
            // View column for Cap_ID field
            //
            $column = new TextViewColumn('Cap_ID', 'ID Capacitacion', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Materia field
            //
            $column = new TextViewColumn('Cap_Materia', 'Materia', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Desde field
            //
            $column = new DateTimeViewColumn('Cap_Desde', 'Fecha Inicio', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Hasta field
            //
            $column = new DateTimeViewColumn('Cap_Hasta', 'Fecha Final', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Proveedor field
            //
            $column = new TextViewColumn('Cap_Proveedor', 'Proveedor', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Creditos field
            //
            $column = new TextViewColumn('Cap_Creditos', 'Nro de Creditos', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Horas field
            //
            $column = new TextViewColumn('Cap_Horas', 'Nro de Horas', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Nota field
            //
            $column = new TextViewColumn('Cap_Nota', 'Calificacion', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_NumFolio field
            //
            $column = new TextViewColumn('Cap_NumFolio', 'Nro de Folios', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Tdoc_Desc field
            //
            $column = new TextViewColumn('Cap_TipDoc_Tdoc_Desc', 'Tipo de Documento', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Tipo field
            //
            $column = new TextViewColumn('Cap_Tipo', 'Tipo de Capacitacion', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Costo field
            //
            $column = new TextViewColumn('Cap_Costo', 'Costo', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Detalle field
            //
            $column = new TextViewColumn('Cap_Detalle', 'Detalle', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(250);
            $column->SetFullTextWindowHandlerName('Cap_Detalle_handler');
            $grid->AddSingleRecordViewColumn($column);
        }
    
        protected function AddEditColumns($grid)
        {
            //
            // Edit column for Cap_Materia field
            //
            $editor = new TextAreaEdit('cap_materia_edit', 50, 8);
            $editColumn = new CustomEditColumn('Materia', 'Cap_Materia', $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 Cap_Desde field
            //
            $editor = new DateTimeEdit('cap_desde_edit', true, 'Y-m-d H:i:s', 0);
            $editColumn = new CustomEditColumn('Fecha Inicio', 'Cap_Desde', $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 Cap_Hasta field
            //
            $editor = new DateTimeEdit('cap_hasta_edit', true, 'Y-m-d H:i:s', 0);
            $editColumn = new CustomEditColumn('Fecha Final', 'Cap_Hasta', $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 Cap_Proveedor field
            //
            $editor = new TextAreaEdit('cap_proveedor_edit', 50, 8);
            $editColumn = new CustomEditColumn('Proveedor', 'Cap_Proveedor', $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 Cap_Creditos field
            //
            $editor = new TextEdit('cap_creditos_edit');
            $editColumn = new CustomEditColumn('Nro de Creditos', 'Cap_Creditos', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Cap_Horas field
            //
            $editor = new TextEdit('cap_horas_edit');
            $editColumn = new CustomEditColumn('Nro de Horas', 'Cap_Horas', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Cap_Nota field
            //
            $editor = new TextEdit('cap_nota_edit');
            $editColumn = new CustomEditColumn('Calificacion', 'Cap_Nota', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Cap_NumFolio field
            //
            $editor = new TextEdit('cap_numfolio_edit');
            $editColumn = new CustomEditColumn('Nro de Folios', 'Cap_NumFolio', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Cap_TipDoc field
            //
            $editor = new ComboBox('cap_tipdoc_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_tipdoc`');
            $field = new IntegerField('Tdoc_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Tdoc_Desc');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Tdoc_Desc', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Tipo de Documento', 
                'Cap_TipDoc', 
                $editor, 
                $this->dataset, 'Tdoc_ID', 'Tdoc_Desc', $lookupDataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Cap_Tipo field
            //
            $editor = new TextEdit('cap_tipo_edit');
            $editColumn = new CustomEditColumn('Tipo de Capacitacion', 'Cap_Tipo', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Cap_Costo field
            //
            $editor = new TextEdit('cap_costo_edit');
            $editColumn = new CustomEditColumn('Costo', 'Cap_Costo', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for Cap_Detalle field
            //
            $editor = new TextAreaEdit('cap_detalle_edit', 50, 8);
            $editColumn = new CustomEditColumn('Detalle', 'Cap_Detalle', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
        }
    
        protected function AddInsertColumns($grid)
        {
            //
            // Edit column for Cap_Materia field
            //
            $editor = new TextAreaEdit('cap_materia_edit', 50, 8);
            $editColumn = new CustomEditColumn('Materia', 'Cap_Materia', $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 Cap_Desde field
            //
            $editor = new DateTimeEdit('cap_desde_edit', true, 'Y-m-d H:i:s', 0);
            $editColumn = new CustomEditColumn('Fecha Inicio', 'Cap_Desde', $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 Cap_Hasta field
            //
            $editor = new DateTimeEdit('cap_hasta_edit', true, 'Y-m-d H:i:s', 0);
            $editColumn = new CustomEditColumn('Fecha Final', 'Cap_Hasta', $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 Cap_Proveedor field
            //
            $editor = new TextAreaEdit('cap_proveedor_edit', 50, 8);
            $editColumn = new CustomEditColumn('Proveedor', 'Cap_Proveedor', $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 Cap_Creditos field
            //
            $editor = new TextEdit('cap_creditos_edit');
            $editColumn = new CustomEditColumn('Nro de Creditos', 'Cap_Creditos', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Cap_Horas field
            //
            $editor = new TextEdit('cap_horas_edit');
            $editColumn = new CustomEditColumn('Nro de Horas', 'Cap_Horas', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Cap_Nota field
            //
            $editor = new TextEdit('cap_nota_edit');
            $editColumn = new CustomEditColumn('Calificacion', 'Cap_Nota', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Cap_NumFolio field
            //
            $editor = new TextEdit('cap_numfolio_edit');
            $editColumn = new CustomEditColumn('Nro de Folios', 'Cap_NumFolio', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Cap_TipDoc field
            //
            $editor = new ComboBox('cap_tipdoc_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_tipdoc`');
            $field = new IntegerField('Tdoc_ID', null, null, true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('Tdoc_Desc');
            $lookupDataset->AddField($field, false);
            $lookupDataset->SetOrderBy('Tdoc_Desc', GetOrderTypeAsSQL(otAscending));
            $editColumn = new LookUpEditColumn(
                'Tipo de Documento', 
                'Cap_TipDoc', 
                $editor, 
                $this->dataset, 'Tdoc_ID', 'Tdoc_Desc', $lookupDataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Cap_Tipo field
            //
            $editor = new TextEdit('cap_tipo_edit');
            $editColumn = new CustomEditColumn('Tipo de Capacitacion', 'Cap_Tipo', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Cap_Costo field
            //
            $editor = new TextEdit('cap_costo_edit');
            $editColumn = new CustomEditColumn('Costo', 'Cap_Costo', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for Cap_Detalle field
            //
            $editor = new TextAreaEdit('cap_detalle_edit', 50, 8);
            $editColumn = new CustomEditColumn('Detalle', 'Cap_Detalle', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $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 Cap_ID field
            //
            $column = new TextViewColumn('Cap_ID', 'ID Capacitacion', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Materia field
            //
            $column = new TextViewColumn('Cap_Materia', 'Materia', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Desde field
            //
            $column = new DateTimeViewColumn('Cap_Desde', 'Fecha Inicio', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Hasta field
            //
            $column = new DateTimeViewColumn('Cap_Hasta', 'Fecha Final', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Proveedor field
            //
            $column = new TextViewColumn('Cap_Proveedor', 'Proveedor', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Creditos field
            //
            $column = new TextViewColumn('Cap_Creditos', 'Nro de Creditos', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Horas field
            //
            $column = new TextViewColumn('Cap_Horas', 'Nro de Horas', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Nota field
            //
            $column = new TextViewColumn('Cap_Nota', 'Calificacion', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_NumFolio field
            //
            $column = new TextViewColumn('Cap_NumFolio', 'Nro de Folios', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Tdoc_Desc field
            //
            $column = new TextViewColumn('Cap_TipDoc_Tdoc_Desc', 'Tipo de Documento', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Tipo field
            //
            $column = new TextViewColumn('Cap_Tipo', 'Tipo de Capacitacion', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Costo field
            //
            $column = new TextViewColumn('Cap_Costo', 'Costo', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Detalle field
            //
            $column = new TextViewColumn('Cap_Detalle', 'Cap Detalle', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
        }
    
        protected function AddExportColumns($grid)
        {
            //
            // View column for Cap_ID field
            //
            $column = new TextViewColumn('Cap_ID', 'ID Capacitacion', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Materia field
            //
            $column = new TextViewColumn('Cap_Materia', 'Materia', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Desde field
            //
            $column = new DateTimeViewColumn('Cap_Desde', 'Fecha Inicio', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Hasta field
            //
            $column = new DateTimeViewColumn('Cap_Hasta', 'Fecha Final', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Proveedor field
            //
            $column = new TextViewColumn('Cap_Proveedor', 'Proveedor', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Creditos field
            //
            $column = new TextViewColumn('Cap_Creditos', 'Nro de Creditos', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Horas field
            //
            $column = new TextViewColumn('Cap_Horas', 'Nro de Horas', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Nota field
            //
            $column = new TextViewColumn('Cap_Nota', 'Calificacion', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_NumFolio field
            //
            $column = new TextViewColumn('Cap_NumFolio', 'Nro de Folios', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Tdoc_Desc field
            //
            $column = new TextViewColumn('Cap_TipDoc_Tdoc_Desc', 'Tipo de Documento', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Tipo field
            //
            $column = new TextViewColumn('Cap_Tipo', 'Tipo de Capacitacion', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Costo field
            //
            $column = new TextViewColumn('Cap_Costo', 'Costo', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Detalle field
            //
            $column = new TextViewColumn('Cap_Detalle', 'Cap Detalle', $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 Cap_ID field
            //
            $column = new TextViewColumn('Cap_ID', 'ID Capacitacion', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Cap_Materia field
            //
            $column = new TextViewColumn('Cap_Materia', 'Materia', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Cap_Desde field
            //
            $column = new DateTimeViewColumn('Cap_Desde', 'Fecha Inicio', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Cap_Hasta field
            //
            $column = new DateTimeViewColumn('Cap_Hasta', 'Fecha Final', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Cap_Proveedor field
            //
            $column = new TextViewColumn('Cap_Proveedor', 'Proveedor', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Cap_Creditos field
            //
            $column = new TextViewColumn('Cap_Creditos', 'Nro de Creditos', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Cap_Horas field
            //
            $column = new TextViewColumn('Cap_Horas', 'Nro de Horas', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Cap_Nota field
            //
            $column = new TextViewColumn('Cap_Nota', 'Calificacion', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Cap_NumFolio field
            //
            $column = new TextViewColumn('Cap_NumFolio', 'Nro de Folios', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Tdoc_Desc field
            //
            $column = new TextViewColumn('Cap_TipDoc_Tdoc_Desc', 'Tipo de Documento', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Cap_Tipo field
            //
            $column = new TextViewColumn('Cap_Tipo', 'Tipo de Capacitacion', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Cap_Costo field
            //
            $column = new TextViewColumn('Cap_Costo', 'Costo', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Cap_Detalle field
            //
            $column = new TextViewColumn('Cap_Detalle', 'Detalle', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(250);
            $column->SetFullTextWindowHandlerName('Cap_Detalle_handler');
            $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 's7_capacitacion_modal_delete'; }
        protected function GetEnableModalGridDelete() { return true; }
    
        protected function CreateGrid()
        {
            $result = new Grid($this, $this->dataset, 's7_capacitacionGrid');
            if ($this->GetSecurityInfo()->HasDeleteGrant())
               $result->SetAllowDeleteSelected(false);
            else
               $result->SetAllowDeleteSelected(false);   
            
            ApplyCommonPageSettings($this, $result);
            
            $result->SetUseImagesForActions(true);
            $result->SetUseFixedHeader(false);
            
            $result->SetShowLineNumbers(false);
            
            $result->SetHighlightRowAtHover(false);
            $result->SetWidth('');
            $this->CreateGridSearchControl($result);
            $this->CreateGridAdvancedSearchControl($result);
    
            $this->AddFieldColumns($result);
            $this->AddSingleRecordViewColumns($result);
            $this->AddEditColumns($result);
            $this->AddInsertColumns($result);
            $this->AddPrintColumns($result);
            $this->AddExportColumns($result);
            $this->AddOperationsColumns($result);
            $this->SetShowPageList(true);
            $this->SetExportToExcelAvailable(true);
            $this->SetExportToWordAvailable(false);
            $this->SetExportToXmlAvailable(false);
            $this->SetExportToCsvAvailable(false);
            $this->SetExportToPdfAvailable(false);
            $this->SetPrinterFriendlyAvailable(false);
            $this->SetSimpleSearchAvailable(true);
            $this->SetAdvancedSearchAvailable(false);
            $this->SetVisualEffectsEnabled(true);
            $this->SetShowTopPageNavigator(true);
            $this->SetShowBottomPageNavigator(true);
    
            //
            // Http Handlers
            //
            //
            // View column for Cap_Detalle field
            //
            $column = new TextViewColumn('Cap_Detalle', 'Detalle', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Detalle field
            //
            $editor = new TextAreaEdit('cap_detalle_edit', 50, 8);
            $editColumn = new CustomEditColumn('Detalle', 'Cap_Detalle', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Cap_Detalle field
            //
            $editor = new TextAreaEdit('cap_detalle_edit', 50, 8);
            $editColumn = new CustomEditColumn('Detalle', 'Cap_Detalle', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'Cap_Detalle_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            $handler = new PageHTTPHandler('per_capDetailView0_handler', new per_capDetailView0Page('Per Cap', 'Per Cap', array('PC_CapID'), GetCurrentUserGrantForDataSource('s7_capacitacion.per_cap'), 'UTF-8', 20, 'per_capDetailEdit0_handler'));
            GetApplication()->RegisterHTTPHandler($handler);
            $pageEdit = new per_capDetailEdit0Page($this, array('PC_CapID'), array('Cap_ID'), $this->GetForeingKeyFields(), $this->CreateMasterDetailRecordGridForper_capDetailEdit0Grid(), $this->dataset, GetCurrentUserGrantForDataSource('s7_capacitacion.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);//
            // View column for Cap_Detalle field
            //
            $column = new TextViewColumn('Cap_Detalle', 'Detalle', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'Cap_Detalle_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            return $result;
        }
        
        protected function OpenAdvancedSearchByDefault()
        {
            return false;
        }
    
        protected function DoGetGridHeader()
        {
            return '';
        }
    }

    SetUpUserAuthorization(GetApplication());

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

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

?>
