<?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 s7_capacitacionDetailView0Page extends DetailPage
    {
        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 AddFieldColumns($grid)
        {
            //
            // View column for Cap_ID field
            //
            $column = new TextViewColumn('Cap_ID', 'Cap ID', $this->dataset);
            $column->SetOrderable(false);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Cap_Materia field
            //
            $column = new TextViewColumn('Cap_Materia', 'Cap Materia', $this->dataset);
            $column->SetOrderable(false);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('Cap_Materia_handler');
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Materia field
            //
            $editor = new TextAreaEdit('cap_materia_edit', 50, 8);
            $editColumn = new CustomEditColumn('Cap 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('Cap 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', 'Cap Desde', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(false);
            
            /* <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('Cap Desde', '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('Cap Desde', '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', 'Cap Hasta', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(false);
            
            /* <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('Cap Hasta', '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('Cap Hasta', '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', 'Cap Proveedor', $this->dataset);
            $column->SetOrderable(false);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('Cap_Proveedor_handler');
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Proveedor field
            //
            $editor = new TextAreaEdit('cap_proveedor_edit', 50, 8);
            $editColumn = new CustomEditColumn('Cap 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('Cap 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', 'Cap Creditos', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Creditos field
            //
            $editor = new TextEdit('cap_creditos_edit');
            $editColumn = new CustomEditColumn('Cap 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('Cap 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', 'Cap Horas', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Horas field
            //
            $editor = new TextEdit('cap_horas_edit');
            $editColumn = new CustomEditColumn('Cap 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('Cap 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', 'Cap Nota', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Nota field
            //
            $editor = new TextEdit('cap_nota_edit');
            $editColumn = new CustomEditColumn('Cap Nota', '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('Cap Nota', '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', 'Cap NumFolio', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_NumFolio field
            //
            $editor = new TextEdit('cap_numfolio_edit');
            $editColumn = new CustomEditColumn('Cap NumFolio', '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('Cap NumFolio', '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', 'Cap TipDoc', $this->dataset);
            $column->SetOrderable(false);
            
            /* <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(
                'Cap TipDoc', 
                '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(
                'Cap TipDoc', 
                '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', 'Cap Tipo', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Tipo field
            //
            $editor = new TextEdit('cap_tipo_edit');
            $editColumn = new CustomEditColumn('Cap Tipo', '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('Cap Tipo', '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', 'Cap Costo', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Costo field
            //
            $editor = new TextEdit('cap_costo_edit');
            $editColumn = new CustomEditColumn('Cap 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('Cap 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', 'Cap Detalle', $this->dataset);
            $column->SetOrderable(false);
            $column->SetMaxLength(75);
            $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('Cap 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('Cap 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);
        }
        
        function GetCustomClientScript()
        {
            return ;
        }
        
        function GetOnPageLoadedClientScript()
        {
            return ;
        }
    
        public function GetPageDirection()
        {
            return null;
        }
    
        protected function ApplyCommonColumnEditProperties($column)
        {
            $column->SetShowSetToNullCheckBox(true);
        }
    
        protected function CreateGrid()
        {
            $result = new Grid($this, $this->dataset, 's7_capacitacionDetailViewGrid0');
            $result->SetAllowDeleteSelected(false);
            $result->SetUseFixedHeader(false);
            
            $result->SetShowLineNumbers(false);
            
            $result->SetHighlightRowAtHover(false);
            $result->SetWidth('');
            $this->AddFieldColumns($result);
            //
            // View column for Cap_Materia field
            //
            $column = new TextViewColumn('Cap_Materia', 'Cap Materia', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Materia field
            //
            $editor = new TextAreaEdit('cap_materia_edit', 50, 8);
            $editColumn = new CustomEditColumn('Cap 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('Cap 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> */
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'Cap_Materia_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for Cap_Proveedor field
            //
            $column = new TextViewColumn('Cap_Proveedor', 'Cap Proveedor', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Proveedor field
            //
            $editor = new TextAreaEdit('cap_proveedor_edit', 50, 8);
            $editColumn = new CustomEditColumn('Cap 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('Cap 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> */
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'Cap_Proveedor_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for Cap_Detalle field
            //
            $column = new TextViewColumn('Cap_Detalle', 'Cap Detalle', $this->dataset);
            $column->SetOrderable(false);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Detalle field
            //
            $editor = new TextAreaEdit('cap_detalle_edit', 50, 8);
            $editColumn = new CustomEditColumn('Cap 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('Cap 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);
            return $result;
        }
    }
    
    
    
    ?><?php
    
    ?><?php
    
    class s7_capacitacionDetailEdit0Page extends DetailPageEdit
    {
        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()
        {
            return null;
        }
    
        protected function CreateRssGenerator()
        {
            return null;
        }
    
        protected function CreateGridSearchControl($grid)
        {
            $grid->UseFilter = true;
            $grid->SearchControl = new SimpleSearch('s7_capacitacionDetailEdit0ssearch', $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('Cap ID'), $this->RenderText('Cap Materia'), $this->RenderText('Cap Desde'), $this->RenderText('Cap Hasta'), $this->RenderText('Cap Proveedor'), $this->RenderText('Cap Creditos'), $this->RenderText('Cap Horas'), $this->RenderText('Cap Nota'), $this->RenderText('Cap NumFolio'), $this->RenderText('Cap TipDoc'), $this->RenderText('Cap Tipo'), $this->RenderText('Cap Costo'), $this->RenderText('Cap 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)
        {
            $this->AdvancedSearchControl = new AdvancedSearchControl('s7_capacitacionDetailEdit0asearch', $this->dataset, $this->GetLocalizerCaptions(), $this->GetColumnVariableContainer(), $this->CreateLinkBuilder());
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Cap_ID', $this->RenderText('Cap ID')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Cap_Materia', $this->RenderText('Cap Materia')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateDateTimeSearchInput('Cap_Desde', $this->RenderText('Cap Desde')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateDateTimeSearchInput('Cap_Hasta', $this->RenderText('Cap Hasta')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Cap_Proveedor', $this->RenderText('Cap Proveedor')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Cap_Creditos', $this->RenderText('Cap Creditos')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Cap_Horas', $this->RenderText('Cap Horas')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Cap_Nota', $this->RenderText('Cap Nota')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Cap_NumFolio', $this->RenderText('Cap NumFolio')));
            
            $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);
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateLookupSearchInput('Cap_TipDoc', $this->RenderText('Cap TipDoc'), $lookupDataset, 'Tdoc_ID', 'Tdoc_Desc', false));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Cap_Tipo', $this->RenderText('Cap Tipo')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Cap_Costo', $this->RenderText('Cap Costo')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Cap_Detalle', $this->RenderText('Cap Detalle')));
        }
    
        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 Cap_ID field
            //
            $column = new TextViewColumn('Cap_ID', 'Cap ID', $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', 'Cap Materia', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('Cap_Materia_handler');
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Materia field
            //
            $editor = new TextAreaEdit('cap_materia_edit', 50, 8);
            $editColumn = new CustomEditColumn('Cap 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('Cap 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', 'Cap Desde', $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('Cap Desde', '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('Cap Desde', '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', 'Cap Hasta', $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('Cap Hasta', '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('Cap Hasta', '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', 'Cap Proveedor', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('Cap_Proveedor_handler');
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Proveedor field
            //
            $editor = new TextAreaEdit('cap_proveedor_edit', 50, 8);
            $editColumn = new CustomEditColumn('Cap 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('Cap 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', 'Cap Creditos', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Creditos field
            //
            $editor = new TextEdit('cap_creditos_edit');
            $editColumn = new CustomEditColumn('Cap 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('Cap 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', 'Cap Horas', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Horas field
            //
            $editor = new TextEdit('cap_horas_edit');
            $editColumn = new CustomEditColumn('Cap 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('Cap 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', 'Cap Nota', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Nota field
            //
            $editor = new TextEdit('cap_nota_edit');
            $editColumn = new CustomEditColumn('Cap Nota', '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('Cap Nota', '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', 'Cap NumFolio', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_NumFolio field
            //
            $editor = new TextEdit('cap_numfolio_edit');
            $editColumn = new CustomEditColumn('Cap NumFolio', '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('Cap NumFolio', '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', 'Cap TipDoc', $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(
                'Cap TipDoc', 
                '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(
                'Cap TipDoc', 
                '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', 'Cap Tipo', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Tipo field
            //
            $editor = new TextEdit('cap_tipo_edit');
            $editColumn = new CustomEditColumn('Cap Tipo', '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('Cap Tipo', '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', 'Cap Costo', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Cap_Costo field
            //
            $editor = new TextEdit('cap_costo_edit');
            $editColumn = new CustomEditColumn('Cap 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('Cap 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', 'Cap Detalle', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $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('Cap 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('Cap 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);
        }
    
        protected function AddSingleRecordViewColumns($grid)
        {
            //
            // View column for Cap_ID field
            //
            $column = new TextViewColumn('Cap_ID', 'Cap ID', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Materia field
            //
            $column = new TextViewColumn('Cap_Materia', 'Cap Materia', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('Cap_Materia_handler');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Desde field
            //
            $column = new DateTimeViewColumn('Cap_Desde', 'Cap Desde', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Hasta field
            //
            $column = new DateTimeViewColumn('Cap_Hasta', 'Cap Hasta', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Proveedor field
            //
            $column = new TextViewColumn('Cap_Proveedor', 'Cap Proveedor', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('Cap_Proveedor_handler');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Creditos field
            //
            $column = new TextViewColumn('Cap_Creditos', 'Cap Creditos', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Horas field
            //
            $column = new TextViewColumn('Cap_Horas', 'Cap Horas', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Nota field
            //
            $column = new TextViewColumn('Cap_Nota', 'Cap Nota', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_NumFolio field
            //
            $column = new TextViewColumn('Cap_NumFolio', 'Cap NumFolio', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Tdoc_Desc field
            //
            $column = new TextViewColumn('Cap_TipDoc_Tdoc_Desc', 'Cap TipDoc', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Tipo field
            //
            $column = new TextViewColumn('Cap_Tipo', 'Cap Tipo', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Costo field
            //
            $column = new TextViewColumn('Cap_Costo', 'Cap Costo', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Cap_Detalle field
            //
            $column = new TextViewColumn('Cap_Detalle', 'Cap Detalle', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $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('Cap 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('Cap Desde', '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('Cap Hasta', '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('Cap 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('Cap 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('Cap 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('Cap Nota', '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('Cap NumFolio', '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(
                'Cap TipDoc', 
                '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('Cap Tipo', '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('Cap 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('Cap 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('Cap 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('Cap Desde', '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('Cap Hasta', '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('Cap 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('Cap 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('Cap 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('Cap Nota', '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('Cap NumFolio', '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(
                'Cap TipDoc', 
                '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('Cap Tipo', '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('Cap 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('Cap 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', 'Cap ID', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Materia field
            //
            $column = new TextViewColumn('Cap_Materia', 'Cap Materia', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Desde field
            //
            $column = new DateTimeViewColumn('Cap_Desde', 'Cap Desde', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Hasta field
            //
            $column = new DateTimeViewColumn('Cap_Hasta', 'Cap Hasta', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Proveedor field
            //
            $column = new TextViewColumn('Cap_Proveedor', 'Cap Proveedor', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Creditos field
            //
            $column = new TextViewColumn('Cap_Creditos', 'Cap Creditos', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Horas field
            //
            $column = new TextViewColumn('Cap_Horas', 'Cap Horas', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Nota field
            //
            $column = new TextViewColumn('Cap_Nota', 'Cap Nota', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_NumFolio field
            //
            $column = new TextViewColumn('Cap_NumFolio', 'Cap NumFolio', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Tdoc_Desc field
            //
            $column = new TextViewColumn('Cap_TipDoc_Tdoc_Desc', 'Cap TipDoc', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Tipo field
            //
            $column = new TextViewColumn('Cap_Tipo', 'Cap Tipo', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Cap_Costo field
            //
            $column = new TextViewColumn('Cap_Costo', 'Cap 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', 'Cap ID', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Materia field
            //
            $column = new TextViewColumn('Cap_Materia', 'Cap Materia', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Desde field
            //
            $column = new DateTimeViewColumn('Cap_Desde', 'Cap Desde', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Hasta field
            //
            $column = new DateTimeViewColumn('Cap_Hasta', 'Cap Hasta', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Proveedor field
            //
            $column = new TextViewColumn('Cap_Proveedor', 'Cap Proveedor', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Creditos field
            //
            $column = new TextViewColumn('Cap_Creditos', 'Cap Creditos', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Horas field
            //
            $column = new TextViewColumn('Cap_Horas', 'Cap Horas', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Nota field
            //
            $column = new TextViewColumn('Cap_Nota', 'Cap Nota', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_NumFolio field
            //
            $column = new TextViewColumn('Cap_NumFolio', 'Cap NumFolio', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Tdoc_Desc field
            //
            $column = new TextViewColumn('Cap_TipDoc_Tdoc_Desc', 'Cap TipDoc', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Tipo field
            //
            $column = new TextViewColumn('Cap_Tipo', 'Cap Tipo', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Cap_Costo field
            //
            $column = new TextViewColumn('Cap_Costo', 'Cap 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);
        }
    
        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 's7_capacitacionDetailEdit0_modal_delete'; }
        protected function GetEnableModalGridDelete() { return true; }
    
        protected function CreateGrid()
        {
            $result = new Grid($this, $this->dataset, 's7_capacitacionDetailEditGrid0');
            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_Materia field
            //
            $column = new TextViewColumn('Cap_Materia', 'Cap 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('Cap 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('Cap 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> */
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'Cap_Materia_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for Cap_Proveedor field
            //
            $column = new TextViewColumn('Cap_Proveedor', 'Cap 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('Cap 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('Cap 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> */
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'Cap_Proveedor_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for Cap_Detalle field
            //
            $column = new TextViewColumn('Cap_Detalle', 'Cap 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('Cap 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('Cap 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);//
            // View column for Cap_Materia field
            //
            $column = new TextViewColumn('Cap_Materia', 'Cap Materia', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'Cap_Materia_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for Cap_Proveedor field
            //
            $column = new TextViewColumn('Cap_Proveedor', 'Cap Proveedor', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'Cap_Proveedor_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for Cap_Detalle field
            //
            $column = new TextViewColumn('Cap_Detalle', 'Cap 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 '';
        }    
    }
    ?><?php
    
    ?><?php
    
    class m_tipdocPage extends Page
    {
        protected function DoBeforeCreate()
        {
            $this->dataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`m_tipdoc`');
            $field = new IntegerField('Tdoc_ID', null, null, true);
            $this->dataset->AddField($field, true);
            $field = new StringField('Tdoc_Desc');
            $this->dataset->AddField($field, false);
        }
    
        protected function CreatePageNavigator()
        {
            $result = new CompositePageNavigator($this);
            
            $partitionNavigator = new PageNavigator('pnav', $this, $this->dataset);
            $partitionNavigator->SetRowsPerPage(50);
            $result->AddPageNavigator($partitionNavigator);
            
            return $result;
        }
    
        public function GetPageList()
        {
            $currentPageCaption = $this->GetShortCaption();
            $result = new PageList();
            if (GetCurrentUserGrantForDataSource('m_personal')->HasViewGrant())
                $result->AddPage(new PageLink($this->RenderText('Personal'), 'm_personal.php', $this->RenderText('Personal'), $currentPageCaption == $this->RenderText('Personal')));
            if (GetCurrentUserGrantForDataSource('per_cap')->HasViewGrant())
                $result->AddPage(new PageLink($this->RenderText('Enlace'), 'per_cap.php', $this->RenderText('Enlace'), $currentPageCaption == $this->RenderText('Enlace')));
            if (GetCurrentUserGrantForDataSource('s7_capacitacion')->HasViewGrant())
                $result->AddPage(new PageLink($this->RenderText('Materia'), 's7_capacitacion.php', $this->RenderText('Materia'), $currentPageCaption == $this->RenderText('Materia')));
            
            if ( HasAdminPage() && GetApplication()->HasAdminGrantForCurrentUser() )
              $result->AddPage(new PageLink($this->RenderText('Admin page'), 'phpgen_admin.php', 'Admin page', false, true));
            return $result;
        }
    
        protected function CreateRssGenerator()
        {
            return null;
        }
    
        protected function CreateGridSearchControl($grid)
        {
            $grid->UseFilter = true;
            $grid->SearchControl = new SimpleSearch('m_tipdocssearch', $this->dataset,
                array('Tdoc_ID', 'Tdoc_Desc'),
                array($this->RenderText('Tdoc ID'), $this->RenderText('Tdoc Desc')),
                array(
                    '=' => $this->GetLocalizerCaptions()->GetMessageString('equals'),
                    '<>' => $this->GetLocalizerCaptions()->GetMessageString('doesNotEquals'),
                    '<' => $this->GetLocalizerCaptions()->GetMessageString('isLessThan'),
                    '<=' => $this->GetLocalizerCaptions()->GetMessageString('isLessThanOrEqualsTo'),
                    '>' => $this->GetLocalizerCaptions()->GetMessageString('isGreaterThan'),
                    '>=' => $this->GetLocalizerCaptions()->GetMessageString('isGreaterThanOrEqualsTo'),
                    'ILIKE' => $this->GetLocalizerCaptions()->GetMessageString('Like'),
                    'STARTS' => $this->GetLocalizerCaptions()->GetMessageString('StartsWith'),
                    'ENDS' => $this->GetLocalizerCaptions()->GetMessageString('EndsWith'),
                    'CONTAINS' => $this->GetLocalizerCaptions()->GetMessageString('Contains')
                    ), $this->GetLocalizerCaptions(), $this, 'CONTAINS'
                );
        }
    
        protected function CreateGridAdvancedSearchControl($grid)
        {
            $this->AdvancedSearchControl = new AdvancedSearchControl('m_tipdocasearch', $this->dataset, $this->GetLocalizerCaptions(), $this->GetColumnVariableContainer(), $this->CreateLinkBuilder());
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Tdoc_ID', $this->RenderText('Tdoc ID')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Tdoc_Desc', $this->RenderText('Tdoc Desc')));
        }
    
        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 Tdoc_ID field
            //
            $column = new TextViewColumn('Tdoc_ID', 'Tdoc ID', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Tdoc_Desc field
            //
            $column = new TextViewColumn('Tdoc_Desc', 'Tdoc Desc', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for Tdoc_Desc field
            //
            $editor = new TextEdit('tdoc_desc_edit');
            $editor->SetSize(20);
            $editor->SetMaxLength(20);
            $editColumn = new CustomEditColumn('Tdoc Desc', 'Tdoc_Desc', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for Tdoc_Desc field
            //
            $editor = new TextEdit('tdoc_desc_edit');
            $editor->SetSize(20);
            $editor->SetMaxLength(20);
            $editColumn = new CustomEditColumn('Tdoc Desc', 'Tdoc_Desc', $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('m_tipdoc.s7_capacitacion')->HasViewGrant())
            {
              //
            // View column for s7_capacitacionDetailView0 detail
            //
            $column = new DetailColumn(array('Tdoc_ID'), 'detail0', 's7_capacitacionDetailEdit0_handler', 's7_capacitacionDetailView0_handler', $this->dataset, 'S7 Capacitacion');
              $grid->AddViewColumn($column);
            }
        }
    
        protected function AddSingleRecordViewColumns($grid)
        {
            //
            // View column for Tdoc_ID field
            //
            $column = new TextViewColumn('Tdoc_ID', 'Tdoc ID', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Tdoc_Desc field
            //
            $column = new TextViewColumn('Tdoc_Desc', 'Tdoc Desc', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
        }
    
        protected function AddEditColumns($grid)
        {
            //
            // Edit column for Tdoc_Desc field
            //
            $editor = new TextEdit('tdoc_desc_edit');
            $editor->SetSize(20);
            $editor->SetMaxLength(20);
            $editColumn = new CustomEditColumn('Tdoc Desc', 'Tdoc_Desc', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
        }
    
        protected function AddInsertColumns($grid)
        {
            //
            // Edit column for Tdoc_Desc field
            //
            $editor = new TextEdit('tdoc_desc_edit');
            $editor->SetSize(20);
            $editor->SetMaxLength(20);
            $editColumn = new CustomEditColumn('Tdoc Desc', 'Tdoc_Desc', $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 Tdoc_ID field
            //
            $column = new TextViewColumn('Tdoc_ID', 'Tdoc ID', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Tdoc_Desc field
            //
            $column = new TextViewColumn('Tdoc_Desc', 'Tdoc Desc', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
        }
    
        protected function AddExportColumns($grid)
        {
            //
            // View column for Tdoc_ID field
            //
            $column = new TextViewColumn('Tdoc_ID', 'Tdoc ID', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Tdoc_Desc field
            //
            $column = new TextViewColumn('Tdoc_Desc', 'Tdoc Desc', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
        }
    
        public function GetPageDirection()
        {
            return null;
        }
    
        protected function ApplyCommonColumnEditProperties($column)
        {
            $column->SetShowSetToNullCheckBox(true);
    	$column->SetVariableContainer($this->GetColumnVariableContainer());
        }
    
        function CreateMasterDetailRecordGridFors7_capacitacionDetailEdit0Grid()
        {
            $result = new Grid($this, $this->dataset, 'MasterDetailRecordGridFors7_capacitacionDetailEdit0');
            $result->SetAllowDeleteSelected(false);
            $result->SetShowUpdateLink(false);
            $result->SetEnabledInlineEditing(false);
            $result->SetName('master_grid');
            //
            // View column for Tdoc_ID field
            //
            $column = new TextViewColumn('Tdoc_ID', 'Tdoc ID', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            //
            // View column for Tdoc_Desc field
            //
            $column = new TextViewColumn('Tdoc_Desc', 'Tdoc Desc', $this->dataset);
            $column->SetOrderable(true);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $result->AddViewColumn($column);
            
            return $result;
        }
        
        function GetCustomClientScript()
        {
            return ;
        }
        
        function GetOnPageLoadedClientScript()
        {
            return ;
        }
        public function ShowEditButtonHandler($show)
        {
            if ($this->GetRecordPermission() != null)
                $show = $this->GetRecordPermission()->HasEditGrant($this->GetDataset());
        }
        public function ShowDeleteButtonHandler($show)
        {
            if ($this->GetRecordPermission() != null)
                $show = $this->GetRecordPermission()->HasDeleteGrant($this->GetDataset());
        }
        
        public function GetModalGridDeleteHandler() { return 'm_tipdoc_modal_delete'; }
        protected function GetEnableModalGridDelete() { return true; }
    
        protected function CreateGrid()
        {
            $result = new Grid($this, $this->dataset, 'm_tipdocGrid');
            if ($this->GetSecurityInfo()->HasDeleteGrant())
               $result->SetAllowDeleteSelected(false);
            else
               $result->SetAllowDeleteSelected(false);   
            
            ApplyCommonPageSettings($this, $result);
            
            $result->SetUseImagesForActions(true);
            $result->SetUseFixedHeader(false);
            
            $result->SetShowLineNumbers(false);
            
            $result->SetHighlightRowAtHover(false);
            $result->SetWidth('');
            $this->CreateGridSearchControl($result);
            $this->CreateGridAdvancedSearchControl($result);
    
            $this->AddFieldColumns($result);
            $this->AddSingleRecordViewColumns($result);
            $this->AddEditColumns($result);
            $this->AddInsertColumns($result);
            $this->AddPrintColumns($result);
            $this->AddExportColumns($result);
            $this->AddOperationsColumns($result);
            $this->SetShowPageList(true);
            $this->SetExportToExcelAvailable(true);
            $this->SetExportToWordAvailable(false);
            $this->SetExportToXmlAvailable(false);
            $this->SetExportToCsvAvailable(false);
            $this->SetExportToPdfAvailable(false);
            $this->SetPrinterFriendlyAvailable(false);
            $this->SetSimpleSearchAvailable(true);
            $this->SetAdvancedSearchAvailable(false);
            $this->SetVisualEffectsEnabled(true);
            $this->SetShowTopPageNavigator(true);
            $this->SetShowBottomPageNavigator(true);
    
            //
            // Http Handlers
            //
            $handler = new PageHTTPHandler('s7_capacitacionDetailView0_handler', new s7_capacitacionDetailView0Page('S7 Capacitacion', 'S7 Capacitacion', array('Cap_TipDoc'), GetCurrentUserGrantForDataSource('m_tipdoc.s7_capacitacion'), 'UTF-8', 20, 's7_capacitacionDetailEdit0_handler'));
            GetApplication()->RegisterHTTPHandler($handler);
            $pageEdit = new s7_capacitacionDetailEdit0Page($this, array('Cap_TipDoc'), array('Tdoc_ID'), $this->GetForeingKeyFields(), $this->CreateMasterDetailRecordGridFors7_capacitacionDetailEdit0Grid(), $this->dataset, GetCurrentUserGrantForDataSource('m_tipdoc.s7_capacitacion'), 'UTF-8');
            $pageEdit->SetShortCaption('S7 Capacitacion');
            $pageEdit->SetHeader(GetPagesHeader());
            $pageEdit->SetFooter(GetPagesFooter());
            $pageEdit->SetCaption('S7 Capacitacion');
            $pageEdit->SetHttpHandlerName('s7_capacitacionDetailEdit0_handler');
            $handler = new PageHTTPHandler('s7_capacitacionDetailEdit0_handler', $pageEdit);
            GetApplication()->RegisterHTTPHandler($handler);
            return $result;
        }
        
        protected function OpenAdvancedSearchByDefault()
        {
            return false;
        }
    
        protected function DoGetGridHeader()
        {
            return '';
        }
    }

    SetUpUserAuthorization(GetApplication());

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

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

?>
