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


    include_once dirname(__FILE__) . '/' . 'components/utils/check_utils.php';
    CheckPHPVersion();
    CheckTemplatesCacheFolderIsExistsAndWritable();


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

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

    
    
    // OnBeforePageExecute event handler
    
    
    
    class calendarioDetailView0resolucionPage extends DetailPage
    {
        protected function DoBeforeCreate()
        {
            $this->dataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`calendario`');
            $field = new IntegerField('id_calendar', null, null, true);
            $field->SetIsNotNull(true);
            $this->dataset->AddField($field, true);
            $field = new IntegerField('id_resoluc');
            $field->SetIsNotNull(true);
            $this->dataset->AddField($field, false);
            $field = new DateField('fechcalendar');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('montocalendar');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Realizopago');
            $this->dataset->AddField($field, false);
            $field = new DateField('fechpago');
            $this->dataset->AddField($field, false);
            $field = new DateField('fechreg');
            $this->dataset->AddField($field, false);
            $this->dataset->AddLookupField('id_resoluc', 'resolucion', new IntegerField('id_resoluc', null, null, true), new StringField('numresoluc', 'id_resoluc_numresoluc', 'id_resoluc_numresoluc_resolucion'), 'id_resoluc_numresoluc_resolucion');
        }
    
        protected function DoPrepare() {
    
        }
    
        protected function AddFieldColumns(Grid $grid, $withDetails = true)
        {
            //
            // View column for numresoluc field
            //
            $column = new TextViewColumn('id_resoluc_numresoluc', 'Nro de Resolución', $this->dataset);
            $column->SetOrderable(false);
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for fechcalendar field
            //
            $column = new DateTimeViewColumn('fechcalendar', 'Fecha Calendario', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(false);
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Realizopago field
            //
            $column = new CheckboxViewColumn('Realizopago', 'Realizó Pago', $this->dataset);
            $column->SetOrderable(false);
            $column->setDisplayValues($this->RenderText('<span class="pg-row-checkbox checked"></span>'), $this->RenderText('<span class="pg-row-checkbox"></span>'));
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for fechpago field
            //
            $column = new DateTimeViewColumn('fechpago', 'Fecha Pago', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(false);
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for montocalendar field
            //
            $column = new NumberViewColumn('montocalendar', 'Monto S/.', $this->dataset);
            $grid->SetTotal($column, PredefinedAggregate::$Sum);
            $column->SetOrderable(false);
            $column->setNumberAfterDecimal(4);
            $column->setThousandsSeparator(',');
            $column->setDecimalSeparator('.');
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
        }
        
        function GetCustomClientScript()
        {
            return ;
        }
        
        function GetOnPageLoadedClientScript()
        {
            return ;
        }
    
        public function GetPageDirection()
        {
            return null;
        }
    
        protected function ApplyCommonColumnEditProperties(CustomEditColumn $column)
        {
            $column->SetDisplaySetToNullCheckBox(false);
            $column->SetDisplaySetToDefaultCheckBox(false);
        }
    
        protected function CreateGrid()
        {
            $result = new Grid($this, $this->dataset, 'calendarioDetailViewGrid0resolucion');
            $result->SetAllowDeleteSelected(false);
            ApplyCommonPageSettings($this, $result);
            $defaultSortedColumns = array();
            $defaultSortedColumns[] = new SortColumn('id_calendar', 'ASC');
            $result->setDefaultOrdering($defaultSortedColumns);
            $result->SetUseFixedHeader(false);
            $result->SetShowLineNumbers(false);
            $result->SetShowKeyColumnsImagesInHeader(false);
            $result->SetViewMode(ViewMode::TABLE);
            $result->setEnableRuntimeCustomization(false);
            $result->setTableBordered(false);
            $result->setTableCondensed(false);
            
            $result->SetHighlightRowAtHover(false);
            $result->SetWidth('');
            $this->AddFieldColumns($result);
    
            return $result;
        }
    }
    
    
    
    // OnBeforePageExecute event handler
    
    
    
    class calendarioDetailEdit0resolucionPage extends DetailPageEdit
    {
        protected function DoBeforeCreate()
        {
            $this->dataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`calendario`');
            $field = new IntegerField('id_calendar', null, null, true);
            $field->SetIsNotNull(true);
            $this->dataset->AddField($field, true);
            $field = new IntegerField('id_resoluc');
            $field->SetIsNotNull(true);
            $this->dataset->AddField($field, false);
            $field = new DateField('fechcalendar');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('montocalendar');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('Realizopago');
            $this->dataset->AddField($field, false);
            $field = new DateField('fechpago');
            $this->dataset->AddField($field, false);
            $field = new DateField('fechreg');
            $this->dataset->AddField($field, false);
            $this->dataset->AddLookupField('id_resoluc', 'resolucion', new IntegerField('id_resoluc', null, null, true), new StringField('numresoluc', 'id_resoluc_numresoluc', 'id_resoluc_numresoluc_resolucion'), 'id_resoluc_numresoluc_resolucion');
        }
    
        protected function DoPrepare() {
    
        }
    
        protected function CreatePageNavigator()
        {
            $result = new CompositePageNavigator($this);
            
            $partitionNavigator = new PageNavigator('pnav', $this, $this->dataset);
            $partitionNavigator->SetRowsPerPage(40);
            $result->AddPageNavigator($partitionNavigator);
            
            return $result;
        }
    
        protected function CreateRssGenerator()
        {
            return null;
        }
    
        protected function setupCharts()
        {
    
        }
    
        protected function CreateGridSearchControl(Grid $grid)
        {
            $grid->UseFilter = true;
            $grid->SearchControl = new SimpleSearch('calendarioDetailEdit0resolucionssearch', $this->dataset,
                array('id_calendar', 'id_resoluc_numresoluc', 'fechcalendar', 'Realizopago', 'fechpago', 'montocalendar', 'fechreg'),
                array($this->RenderText('Id Calendario'), $this->RenderText('Nro de Resolución'), $this->RenderText('Fecha Calendario'), $this->RenderText('Realizó Pago'), $this->RenderText('Fecha Pago'), $this->RenderText('Monto S/.'), $this->RenderText('Fechreg')),
                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 $grid)
        {
            $this->AdvancedSearchControl = new AdvancedSearchControl('calendarioDetailEdit0resolucionasearch', $this->dataset, $this->GetLocalizerCaptions(), $this->GetColumnVariableContainer(), $this->CreateLinkBuilder());
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('id_calendar', $this->RenderText('Id Calendario')));
            
            $lookupDataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`resolucion`');
            $field = new IntegerField('id_resoluc', null, null, true);
            $field->SetIsNotNull(true);
            $lookupDataset->AddField($field, true);
            $field = new StringField('numresoluc');
            $field->SetIsNotNull(true);
            $lookupDataset->AddField($field, false);
            $field = new StringField('ruc');
            $field->SetIsNotNull(true);
            $lookupDataset->AddField($field, false);
            $field = new StringField('razonsocial');
            $field->SetIsNotNull(true);
            $lookupDataset->AddField($field, false);
            $field = new StringField('direccion');
            $field->SetIsNotNull(true);
            $lookupDataset->AddField($field, false);
            $field = new StringField('telefono');
            $lookupDataset->AddField($field, false);
            $field = new DateField('fechresoluc');
            $field->SetIsNotNull(true);
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('UIT');
            $field->SetIsNotNull(true);
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('montoresoluc');
            $field->SetIsNotNull(true);
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('monto2');
            $lookupDataset->AddField($field, false);
            $field = new IntegerField('estado');
            $lookupDataset->AddField($field, false);
            $field = new DateField('adm_fechfirma');
            $lookupDataset->AddField($field, false);
            $field = new DateField('adm_fechnotificado');
            $lookupDataset->AddField($field, false);
            $field = new DateField('adm_fechreg');
            $lookupDataset->AddField($field, false);
            $field = new DateTimeField('fechregresoluc');
            $field->SetIsNotNull(true);
            $lookupDataset->AddField($field, false);
            $lookupDataset->setOrderByField('numresoluc', GetOrderTypeAsSQL(otAscending));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateLookupSearchInput('id_resoluc', $this->RenderText('Nro de Resolución'), $lookupDataset, 'id_resoluc', 'numresoluc', false, 8));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateDateTimeSearchInput('fechcalendar', $this->RenderText('Fecha Calendario'), 'd-m-Y'));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('Realizopago', $this->RenderText('Realizó Pago')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateDateTimeSearchInput('fechpago', $this->RenderText('Fecha Pago'), 'd-m-Y'));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('montocalendar', $this->RenderText('Monto S/.')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateDateTimeSearchInput('fechreg', $this->RenderText('Fechreg'), 'd-m-Y'));
        }
    
        public function GetPageDirection()
        {
            return null;
        }
    
        protected function AddOperationsColumns(Grid $grid)
        {
            $actions = $grid->getActions();
            $actions->setCaption($this->GetLocalizerCaptions()->GetMessageString('Actions'));
            $actions->setPosition(ActionList::POSITION_LEFT);
            if ($this->GetSecurityInfo()->HasViewGrant())
            {
                $operation = new ModalViewOperation(
                    $this->GetLocalizerCaptions()->GetMessageString('View'),
                    $this->GetLocalizerCaptions()->GetMessageString('View'), $this->dataset,
                    $this->GetModalGridViewHandler(), $grid);
                $operation->setUseImage(true);
                $actions->addOperation($operation);
            }
            if ($this->GetSecurityInfo()->HasEditGrant())
            {
                $operation = new ModalEditOperation(
                    $this->GetLocalizerCaptions()->GetMessageString('Edit'),
                    $this->GetLocalizerCaptions()->GetMessageString('Edit'), $this->dataset,
                    $this->GetModalGridEditingHandler(), $grid);
                $operation->setUseImage(true);
                $actions->addOperation($operation);
                $operation->OnShow->AddListener('ShowEditButtonHandler', $this);
            }
            if ($this->GetSecurityInfo()->HasDeleteGrant())
            {
                $operation = new LinkOperation($this->GetLocalizerCaptions()->GetMessageString('Delete'), OPERATION_DELETE, $this->dataset, $grid);
                $operation->setUseImage(true);
                $actions->addOperation($operation);
                $operation->OnShow->AddListener('ShowDeleteButtonHandler', $this);
                $operation->SetAdditionalAttribute('data-modal-operation', 'delete');
                $operation->SetAdditionalAttribute('data-delete-handler-name', $this->GetModalGridDeleteHandler());
            }
            if ($this->GetSecurityInfo()->HasAddGrant())
            {
                $operation = new ModalCopyOperation(
                    $this->GetLocalizerCaptions()->GetMessageString('Copy'),
                    $this->GetLocalizerCaptions()->GetMessageString('Copy'), $this->dataset,
                    $this->GetModalGridCopyHandler(), $grid);
                $operation->setUseImage(true);
                $actions->addOperation($operation);
            }
        }
    
        protected function AddFieldColumns(Grid $grid, $withDetails = true)
        {
            //
            // View column for numresoluc field
            //
            $column = new TextViewColumn('id_resoluc_numresoluc', 'Nro de Resolución', $this->dataset);
            $column->SetOrderable(true);
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for fechcalendar field
            //
            $column = new DateTimeViewColumn('fechcalendar', 'Fecha Calendario', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for Realizopago field
            //
            $column = new CheckboxViewColumn('Realizopago', 'Realizó Pago', $this->dataset);
            $column->SetOrderable(true);
            $column->setDisplayValues($this->RenderText('<span class="pg-row-checkbox checked"></span>'), $this->RenderText('<span class="pg-row-checkbox"></span>'));
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for fechpago field
            //
            $column = new DateTimeViewColumn('fechpago', 'Fecha Pago', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for montocalendar field
            //
            $column = new NumberViewColumn('montocalendar', 'Monto S/.', $this->dataset);
            $grid->SetTotal($column, PredefinedAggregate::$Sum);
            $column->SetOrderable(true);
            $column->setNumberAfterDecimal(4);
            $column->setThousandsSeparator(',');
            $column->setDecimalSeparator('.');
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
        }
    
        protected function AddSingleRecordViewColumns(Grid $grid)
        {
            //
            // View column for id_calendar field
            //
            $column = new TextViewColumn('id_calendar', 'Id Calendario', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for numresoluc field
            //
            $column = new TextViewColumn('id_resoluc_numresoluc', 'Nro de Resolución', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for fechcalendar field
            //
            $column = new DateTimeViewColumn('fechcalendar', 'Fecha Calendario', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for Realizopago field
            //
            $column = new CheckboxViewColumn('Realizopago', 'Realizó Pago', $this->dataset);
            $column->SetOrderable(true);
            $column->setDisplayValues($this->RenderText('<span class="pg-row-checkbox checked"></span>'), $this->RenderText('<span class="pg-row-checkbox"></span>'));
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for fechpago field
            //
            $column = new DateTimeViewColumn('fechpago', 'Fecha Pago', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for montocalendar field
            //
            $column = new NumberViewColumn('montocalendar', 'Monto S/.', $this->dataset);
            $column->SetOrderable(true);
            $column->setNumberAfterDecimal(4);
            $column->setThousandsSeparator(',');
            $column->setDecimalSeparator('.');
            $grid->AddSingleRecordViewColumn($column);
        }
    
        protected function AddEditColumns(Grid $grid)
        {
    
        }
    
        protected function AddInsertColumns(Grid $grid)
        {
    
            if ($this->GetSecurityInfo()->HasAddGrant())
            {
                $grid->SetShowAddButton(true);
                $grid->SetShowInlineAddButton(false);
            }
            else
            {
                $grid->SetShowInlineAddButton(false);
                $grid->SetShowAddButton(false);
            }
        }
    
        protected function AddPrintColumns(Grid $grid)
        {
            //
            // View column for id_calendar field
            //
            $column = new TextViewColumn('id_calendar', 'Id Calendario', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for numresoluc field
            //
            $column = new TextViewColumn('id_resoluc_numresoluc', 'Nro de Resolución', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for fechcalendar field
            //
            $column = new DateTimeViewColumn('fechcalendar', 'Fecha Calendario', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for Realizopago field
            //
            $column = new CheckboxViewColumn('Realizopago', 'Realizó Pago', $this->dataset);
            $column->SetOrderable(true);
            $column->setDisplayValues($this->RenderText('<span class="pg-row-checkbox checked"></span>'), $this->RenderText('<span class="pg-row-checkbox"></span>'));
            $grid->AddPrintColumn($column);
            
            //
            // View column for fechpago field
            //
            $column = new DateTimeViewColumn('fechpago', 'Fecha Pago', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for montocalendar field
            //
            $column = new NumberViewColumn('montocalendar', 'Monto S/.', $this->dataset);
            $column->SetOrderable(true);
            $column->setNumberAfterDecimal(4);
            $column->setThousandsSeparator(',');
            $column->setDecimalSeparator('.');
            $grid->AddPrintColumn($column);
            
            //
            // View column for fechreg field
            //
            $column = new DateTimeViewColumn('fechreg', 'Fechreg', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
        }
    
        protected function AddExportColumns(Grid $grid)
        {
            //
            // View column for id_calendar field
            //
            $column = new TextViewColumn('id_calendar', 'Id Calendario', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for numresoluc field
            //
            $column = new TextViewColumn('id_resoluc_numresoluc', 'Nro de Resolución', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for fechcalendar field
            //
            $column = new DateTimeViewColumn('fechcalendar', 'Fecha Calendario', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for Realizopago field
            //
            $column = new CheckboxViewColumn('Realizopago', 'Realizó Pago', $this->dataset);
            $column->SetOrderable(true);
            $column->setDisplayValues($this->RenderText('<span class="pg-row-checkbox checked"></span>'), $this->RenderText('<span class="pg-row-checkbox"></span>'));
            $grid->AddExportColumn($column);
            
            //
            // View column for fechpago field
            //
            $column = new DateTimeViewColumn('fechpago', 'Fecha Pago', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for montocalendar field
            //
            $column = new NumberViewColumn('montocalendar', 'Monto S/.', $this->dataset);
            $column->SetOrderable(true);
            $column->setNumberAfterDecimal(4);
            $column->setThousandsSeparator(',');
            $column->setDecimalSeparator('.');
            $grid->AddExportColumn($column);
            
            //
            // View column for fechreg field
            //
            $column = new DateTimeViewColumn('fechreg', 'Fechreg', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
        }
    
        protected function ApplyCommonColumnEditProperties(CustomEditColumn $column)
        {
            $column->SetDisplaySetToNullCheckBox(false);
            $column->SetDisplaySetToDefaultCheckBox(false);
        	$column->SetVariableContainer($this->GetColumnVariableContainer());
        }
    
        function GetCustomClientScript()
        {
            return ;
        }
        
        function GetOnPageLoadedClientScript()
        {
            return ;
        }
        public function GetModalGridViewHandler() { return 'calendarioDetailEdit0resolucion_inline_record_view'; }
        protected function GetEnableModalSingleRecordView() { return true; }
        
        public function GetModalGridEditingHandler() { return 'calendarioDetailEdit0resolucion_inline_edit'; }
        protected function GetEnableModalGridEditing() { return true; }
        
        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 'calendarioDetailEdit0resolucion_modal_delete'; }
        protected function GetEnableModalGridDelete() { return true; }
        
        public function GetModalGridCopyHandler() { return 'calendarioDetailEdit0resolucion_inline_edit'; }
        protected function GetEnableModalGridCopy() { return true; }
    
        protected function CreateGrid()
        {
            $result = new Grid($this, $this->dataset, 'calendarioDetailEditGrid0resolucion');
            if ($this->GetSecurityInfo()->HasDeleteGrant())
                $result->SetAllowDeleteSelected(false);
            else
                $result->SetAllowDeleteSelected(false);
            ApplyCommonPageSettings($this, $result);
            $result->SetUseImagesForActions(true);
            $defaultSortedColumns = array();
            $defaultSortedColumns[] = new SortColumn('id_calendar', 'ASC');
            $result->setDefaultOrdering($defaultSortedColumns);
            $result->SetUseFixedHeader(false);
            $result->SetShowLineNumbers(false);
            $result->SetShowKeyColumnsImagesInHeader(false);
            $result->SetViewMode(ViewMode::TABLE);
            $result->setEnableRuntimeCustomization(false);
            $result->setTableBordered(false);
            $result->setTableCondensed(false);
            $result->SetUseModalInserting(true);
            
            $result->SetHighlightRowAtHover(false);
            $result->SetWidth('');
            $this->CreateGridSearchControl($result);
            $this->CreateGridAdvancedSearchControl($result);
            $this->AddOperationsColumns($result);
            $this->AddFieldColumns($result);
            $this->AddSingleRecordViewColumns($result);
            $this->AddEditColumns($result);
            $this->AddInsertColumns($result);
            $this->AddPrintColumns($result);
            $this->AddExportColumns($result);
    
            $this->SetShowPageList(true);
            $this->SetSimpleSearchAvailable(false);
            $this->SetAdvancedSearchAvailable(false);
            $this->SetShowTopPageNavigator(true);
            $this->SetShowBottomPageNavigator(true);
            $this->setPrintListAvailable(false);
            $this->setPrintListRecordAvailable(false);
            $this->setPrintOneRecordAvailable(false);
            $this->setExportListAvailable(array('excel'));
            $this->setExportListRecordAvailable(array());
            $this->setExportOneRecordAvailable(array('excel'));
    
            //
            // Http Handlers
            //
    
            return $result;
        }
        
        public function OpenAdvancedSearchByDefault()
        {
            return false;
        }
    
        protected function DoGetGridHeader()
        {
            return '';
        }    
    }
    // OnGlobalBeforePageExecute event handler
    
    
    // OnBeforePageExecute event handler
    
    
    
    class resolucionPage extends Page
    {
        protected function DoBeforeCreate()
        {
            $this->dataset = new TableDataset(
                new MyConnectionFactory(),
                GetConnectionOptions(),
                '`resolucion`');
            $field = new IntegerField('id_resoluc', null, null, true);
            $field->SetIsNotNull(true);
            $this->dataset->AddField($field, true);
            $field = new StringField('numresoluc');
            $field->SetIsNotNull(true);
            $this->dataset->AddField($field, false);
            $field = new StringField('ruc');
            $field->SetIsNotNull(true);
            $this->dataset->AddField($field, false);
            $field = new StringField('razonsocial');
            $field->SetIsNotNull(true);
            $this->dataset->AddField($field, false);
            $field = new StringField('direccion');
            $field->SetIsNotNull(true);
            $this->dataset->AddField($field, false);
            $field = new StringField('telefono');
            $this->dataset->AddField($field, false);
            $field = new DateField('fechresoluc');
            $field->SetIsNotNull(true);
            $this->dataset->AddField($field, false);
            $field = new IntegerField('UIT');
            $field->SetIsNotNull(true);
            $this->dataset->AddField($field, false);
            $field = new IntegerField('montoresoluc');
            $field->SetIsNotNull(true);
            $this->dataset->AddField($field, false);
            $field = new IntegerField('monto2');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('estado');
            $this->dataset->AddField($field, false);
            $field = new DateField('adm_fechfirma');
            $this->dataset->AddField($field, false);
            $field = new DateField('adm_fechnotificado');
            $this->dataset->AddField($field, false);
            $field = new DateField('adm_fechreg');
            $this->dataset->AddField($field, false);
            $field = new DateTimeField('fechregresoluc');
            $field->SetIsNotNull(true);
            $this->dataset->AddField($field, false);
        }
    
        protected function DoPrepare() {
    
        }
    
        protected function CreatePageNavigator()
        {
            $result = new CompositePageNavigator($this);
            
            $partitionNavigator = new PageNavigator('pnav', $this, $this->dataset);
            $partitionNavigator->SetRowsPerPage(40);
            $result->AddPageNavigator($partitionNavigator);
            
            return $result;
        }
    
        protected function CreateRssGenerator()
        {
            return null;
        }
    
        protected function setupCharts()
        {
    
        }
    
        protected function CreateGridSearchControl(Grid $grid)
        {
            $grid->UseFilter = true;
            $grid->SearchControl = new SimpleSearch('resolucionssearch', $this->dataset,
                array('id_resoluc', 'numresoluc', 'fechresoluc', 'ruc', 'razonsocial', 'direccion', 'telefono', 'UIT', 'estado', 'adm_fechnotificado', 'montoresoluc', 'monto2'),
                array($this->RenderText('Id Resolución'), $this->RenderText('Nro Resolución'), $this->RenderText('Fecha Resolución'), $this->RenderText('RUC'), $this->RenderText('Razón Social'), $this->RenderText('Dirección'), $this->RenderText('Teléfono'), $this->RenderText('UIT'), $this->RenderText('Notificado'), $this->RenderText('Fecha de Notificado'), $this->RenderText('Monto Resolución S/.'), $this->RenderText('Monto Final S/.')),
                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 $grid)
        {
            $this->AdvancedSearchControl = new AdvancedSearchControl('resolucionasearch', $this->dataset, $this->GetLocalizerCaptions(), $this->GetColumnVariableContainer(), $this->CreateLinkBuilder());
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('id_resoluc', $this->RenderText('Id Resolución')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('numresoluc', $this->RenderText('Nro Resolución')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateDateTimeSearchInput('fechresoluc', $this->RenderText('Fecha Resolución'), 'd-m-Y'));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('ruc', $this->RenderText('RUC')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('razonsocial', $this->RenderText('Razón Social')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('direccion', $this->RenderText('Dirección')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('telefono', $this->RenderText('Teléfono')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('UIT', $this->RenderText('UIT')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('estado', $this->RenderText('Notificado')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateDateTimeSearchInput('adm_fechnotificado', $this->RenderText('Fecha de Notificado'), 'd-m-Y'));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('montoresoluc', $this->RenderText('Monto Resolución S/.')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('monto2', $this->RenderText('Monto Final S/.')));
        }
    
        protected function AddOperationsColumns(Grid $grid)
        {
            $actions = $grid->getActions();
            $actions->setCaption($this->GetLocalizerCaptions()->GetMessageString('Actions'));
            $actions->setPosition(ActionList::POSITION_LEFT);
            if ($this->GetSecurityInfo()->HasViewGrant())
            {
                $operation = new LinkOperation($this->GetLocalizerCaptions()->GetMessageString('View'), OPERATION_VIEW, $this->dataset, $grid);
                $operation->setUseImage(true);
                $actions->addOperation($operation);
            }
        }
    
        protected function AddFieldColumns(Grid $grid, $withDetails = true)
        {
            //
            // View column for numresoluc field
            //
            $column = new TextViewColumn('numresoluc', 'Nro Resolución', $this->dataset);
            $column->SetOrderable(true);
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for fechresoluc field
            //
            $column = new DateTimeViewColumn('fechresoluc', 'Fecha Resolución', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for ruc field
            //
            $column = new TextViewColumn('ruc', 'RUC', $this->dataset);
            $column->SetOrderable(true);
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for razonsocial field
            //
            $column = new TextViewColumn('razonsocial', 'Razón Social', $this->dataset);
            $column->SetOrderable(true);
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for estado field
            //
            $column = new CheckboxViewColumn('estado', 'Notificado', $this->dataset);
            $column->SetOrderable(true);
            $column->setDisplayValues($this->RenderText('<span class="pg-row-checkbox checked"></span>'), $this->RenderText('<span class="pg-row-checkbox"></span>'));
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for adm_fechnotificado field
            //
            $column = new DateTimeViewColumn('adm_fechnotificado', 'Fecha de Notificado', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for montoresoluc field
            //
            $column = new NumberViewColumn('montoresoluc', 'Monto Resolución S/.', $this->dataset);
            $column->SetOrderable(true);
            $column->setNumberAfterDecimal(2);
            $column->setThousandsSeparator(',');
            $column->setDecimalSeparator('.');
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for monto2 field
            //
            $column = new TextViewColumn('monto2', 'Monto Final S/.', $this->dataset);
            $column->SetOrderable(true);
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            if (GetCurrentUserGrantForDataSource('resolucion.calendario')->HasViewGrant() && $withDetails)
            {
              //
            // View column for calendarioDetailView0resolucion detail
            //
            $column = new DetailColumn(array('id_resoluc'), 'detail0resolucion', 'calendarioDetailEdit0resolucion_handler', 'calendarioDetailView0resolucion_handler', $this->dataset, 'Calendario');
            $column->setMinimalVisibility(ColumnVisibility::PHONE);
              $grid->AddViewColumn($column);
            }
        }
    
        protected function AddSingleRecordViewColumns(Grid $grid)
        {
            //
            // View column for numresoluc field
            //
            $column = new TextViewColumn('numresoluc', 'Nro Resolución', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for fechresoluc field
            //
            $column = new DateTimeViewColumn('fechresoluc', 'Fecha Resolución', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for ruc field
            //
            $column = new TextViewColumn('ruc', 'RUC', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for razonsocial field
            //
            $column = new TextViewColumn('razonsocial', 'Razón Social', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for direccion field
            //
            $column = new TextViewColumn('direccion', 'Dirección', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for telefono field
            //
            $column = new TextViewColumn('telefono', 'Teléfono', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for UIT field
            //
            $column = new TextViewColumn('UIT', 'UIT', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for estado field
            //
            $column = new CheckboxViewColumn('estado', 'Notificado', $this->dataset);
            $column->SetOrderable(true);
            $column->setDisplayValues($this->RenderText('<span class="pg-row-checkbox checked"></span>'), $this->RenderText('<span class="pg-row-checkbox"></span>'));
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for adm_fechnotificado field
            //
            $column = new DateTimeViewColumn('adm_fechnotificado', 'Fecha de Notificado', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for montoresoluc field
            //
            $column = new NumberViewColumn('montoresoluc', 'Monto Resolución S/.', $this->dataset);
            $column->SetOrderable(true);
            $column->setNumberAfterDecimal(2);
            $column->setThousandsSeparator(',');
            $column->setDecimalSeparator('.');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for monto2 field
            //
            $column = new TextViewColumn('monto2', 'Monto Final S/.', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
        }
    
        protected function AddEditColumns(Grid $grid)
        {
    
        }
    
        protected function AddInsertColumns(Grid $grid)
        {
    
            if ($this->GetSecurityInfo()->HasAddGrant())
            {
                $grid->SetShowAddButton(false);
                $grid->SetShowInlineAddButton(false);
            }
            else
            {
                $grid->SetShowInlineAddButton(false);
                $grid->SetShowAddButton(false);
            }
        }
    
        protected function AddPrintColumns(Grid $grid)
        {
            //
            // View column for id_resoluc field
            //
            $column = new TextViewColumn('id_resoluc', 'Id Resolución', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for numresoluc field
            //
            $column = new TextViewColumn('numresoluc', 'Nro Resolución', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for fechresoluc field
            //
            $column = new DateTimeViewColumn('fechresoluc', 'Fecha Resolución', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for ruc field
            //
            $column = new TextViewColumn('ruc', 'RUC', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for razonsocial field
            //
            $column = new TextViewColumn('razonsocial', 'Razón Social', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for direccion field
            //
            $column = new TextViewColumn('direccion', 'Dirección', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for telefono field
            //
            $column = new TextViewColumn('telefono', 'Teléfono', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for UIT field
            //
            $column = new TextViewColumn('UIT', 'UIT', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for estado field
            //
            $column = new CheckboxViewColumn('estado', 'Notificado', $this->dataset);
            $column->SetOrderable(true);
            $column->setDisplayValues($this->RenderText('<span class="pg-row-checkbox checked"></span>'), $this->RenderText('<span class="pg-row-checkbox"></span>'));
            $grid->AddPrintColumn($column);
            
            //
            // View column for adm_fechnotificado field
            //
            $column = new DateTimeViewColumn('adm_fechnotificado', 'Fecha de Notificado', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for montoresoluc field
            //
            $column = new NumberViewColumn('montoresoluc', 'Monto Resolución S/.', $this->dataset);
            $column->SetOrderable(true);
            $column->setNumberAfterDecimal(2);
            $column->setThousandsSeparator(',');
            $column->setDecimalSeparator('.');
            $grid->AddPrintColumn($column);
            
            //
            // View column for monto2 field
            //
            $column = new TextViewColumn('monto2', 'Monto Final S/.', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
        }
    
        protected function AddExportColumns(Grid $grid)
        {
            //
            // View column for id_resoluc field
            //
            $column = new TextViewColumn('id_resoluc', 'Id Resolución', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for numresoluc field
            //
            $column = new TextViewColumn('numresoluc', 'Nro Resolución', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for fechresoluc field
            //
            $column = new DateTimeViewColumn('fechresoluc', 'Fecha Resolución', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for ruc field
            //
            $column = new TextViewColumn('ruc', 'RUC', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for razonsocial field
            //
            $column = new TextViewColumn('razonsocial', 'Razón Social', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for direccion field
            //
            $column = new TextViewColumn('direccion', 'Dirección', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for telefono field
            //
            $column = new TextViewColumn('telefono', 'Teléfono', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for UIT field
            //
            $column = new TextViewColumn('UIT', 'UIT', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for estado field
            //
            $column = new CheckboxViewColumn('estado', 'Notificado', $this->dataset);
            $column->SetOrderable(true);
            $column->setDisplayValues($this->RenderText('<span class="pg-row-checkbox checked"></span>'), $this->RenderText('<span class="pg-row-checkbox"></span>'));
            $grid->AddExportColumn($column);
            
            //
            // View column for adm_fechnotificado field
            //
            $column = new DateTimeViewColumn('adm_fechnotificado', 'Fecha de Notificado', $this->dataset);
            $column->SetDateTimeFormat('d-m-Y');
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for montoresoluc field
            //
            $column = new NumberViewColumn('montoresoluc', 'Monto Resolución S/.', $this->dataset);
            $column->SetOrderable(true);
            $column->setNumberAfterDecimal(2);
            $column->setThousandsSeparator(',');
            $column->setDecimalSeparator('.');
            $grid->AddExportColumn($column);
            
            //
            // View column for monto2 field
            //
            $column = new TextViewColumn('monto2', 'Monto Final S/.', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
        }
    
        public function GetPageDirection()
        {
            return null;
        }
    
        protected function ApplyCommonColumnEditProperties(CustomEditColumn $column)
        {
            $column->SetDisplaySetToNullCheckBox(false);
            $column->SetDisplaySetToDefaultCheckBox(false);
    		$column->SetVariableContainer($this->GetColumnVariableContainer());
        }
    
        function CreateMasterDetailRecordGridForcalendarioDetailEdit0resolucionGrid()
        {
            $result = new Grid($this, $this->dataset, 'MasterDetailRecordGridForcalendarioDetailEdit0resolucion');
            
            $this->AddFieldColumns($result, false);
            
            $result->SetAllowDeleteSelected(false);
            $result->SetShowFilterBuilder(false);
            $result->SetAdvancedSearchAvailable(false);
            $result->SetShowUpdateLink(false);
            $result->SetEnabledInlineEditing(false);
            $result->SetShowKeyColumnsImagesInHeader(false);
            $result->SetName('master_grid');
            $result->SetViewMode(ViewMode::TABLE);
            $result->setEnableRuntimeCustomization(false);
            $result->setTableBordered(false);
            $result->setTableCondensed(false);
            
            return $result;
        }
        
        function GetCustomClientScript()
        {
            return ;
        }
        
        function GetOnPageLoadedClientScript()
        {
            return ;
        }
    
        protected function CreateGrid()
        {
            $result = new Grid($this, $this->dataset, 'resolucionGrid');
            if ($this->GetSecurityInfo()->HasDeleteGrant())
               $result->SetAllowDeleteSelected(false);
            else
               $result->SetAllowDeleteSelected(false);   
            
            ApplyCommonPageSettings($this, $result);
            
            $result->SetUseImagesForActions(true);
            $defaultSortedColumns = array();
            $defaultSortedColumns[] = new SortColumn('id_resoluc', 'DESC');
            $result->setDefaultOrdering($defaultSortedColumns);
            $result->SetUseFixedHeader(false);
            $result->SetShowLineNumbers(false);
            $result->SetShowKeyColumnsImagesInHeader(false);
            $result->SetViewMode(ViewMode::TABLE);
            $result->setEnableRuntimeCustomization(true);
            $result->setTableBordered(false);
            $result->setTableCondensed(false);
            
            $result->SetHighlightRowAtHover(false);
            $result->SetWidth('');
            $this->CreateGridSearchControl($result);
            $this->CreateGridAdvancedSearchControl($result);
            $this->AddOperationsColumns($result);
            $this->AddFieldColumns($result);
            $this->AddSingleRecordViewColumns($result);
            $this->AddEditColumns($result);
            $this->AddInsertColumns($result);
            $this->AddPrintColumns($result);
            $this->AddExportColumns($result);
    
            $this->SetShowPageList(true);
            $this->SetSimpleSearchAvailable(true);
            $this->SetAdvancedSearchAvailable(false);
            $this->SetShowTopPageNavigator(true);
            $this->SetShowBottomPageNavigator(true);
            $this->setPrintListAvailable(true);
            $this->setPrintListRecordAvailable(false);
            $this->setPrintOneRecordAvailable(true);
            $this->setExportListAvailable(array('excel','word','xml','csv','pdf'));
            $this->setExportListRecordAvailable(array());
            $this->setExportOneRecordAvailable(array('excel','word','xml','csv','pdf'));
    
            //
            // Http Handlers
            //
            $pageView = new calendarioDetailView0resolucionPage($this, 'Calendario', 'Calendario', array('id_resoluc'), GetCurrentUserGrantForDataSource('resolucion.calendario'), 'UTF-8', 20, 'calendarioDetailEdit0resolucion_handler');
            
            $pageView->SetRecordPermission(GetCurrentUserRecordPermissionsForDataSource('resolucion.calendario'));
            $handler = new PageHTTPHandler('calendarioDetailView0resolucion_handler', $pageView);
            GetApplication()->RegisterHTTPHandler($handler);
            $pageEdit = new calendarioDetailEdit0resolucionPage($this, array('id_resoluc'), array('id_resoluc'), $this->GetForeingKeyFields(), $this->CreateMasterDetailRecordGridForcalendarioDetailEdit0resolucionGrid(), $this->dataset, GetCurrentUserGrantForDataSource('resolucion.calendario'), 'UTF-8');
            
            $pageEdit->SetRecordPermission(GetCurrentUserRecordPermissionsForDataSource('resolucion.calendario'));
            $pageEdit->SetTitle('Calendario');
            $pageEdit->SetMenuLabel('Calendario');
            $pageEdit->SetHeader(GetPagesHeader());
            $pageEdit->SetFooter(GetPagesFooter());
            $pageEdit->SetHttpHandlerName('calendarioDetailEdit0resolucion_handler');
            $handler = new PageHTTPHandler('calendarioDetailEdit0resolucion_handler', $pageEdit);
            GetApplication()->RegisterHTTPHandler($handler);
            return $result;
        }
        
        public function OpenAdvancedSearchByDefault()
        {
            return false;
        }
    
        protected function DoGetGridHeader()
        {
            return '';
        }
    }

    SetUpUserAuthorization(GetApplication());

    try
    {
        $Page = new resolucionPage("resolucion.php", "resolucion", GetCurrentUserGrantForDataSource("resolucion"), 'UTF-8');
        $Page->SetTitle('Resolucion');
        $Page->SetMenuLabel('Resolucion');
        $Page->SetHeader(GetPagesHeader());
        $Page->SetFooter(GetPagesFooter());
        $Page->SetRecordPermission(GetCurrentUserRecordPermissionsForDataSource("resolucion"));
        GetApplication()->SetEnableLessRunTimeCompile(GetEnableLessFilesRunTimeCompilation());
        GetApplication()->SetCanUserChangeOwnPassword(
            !function_exists('CanUserChangeOwnPassword') || CanUserChangeOwnPassword());
        GetApplication()->SetMainPage($Page);
        GetApplication()->Run();
    }
    catch(Exception $e)
    {
        ShowErrorPage($e->getMessage());
    }
	
