protected function AddInsertColumns(Grid $grid) { // // Edit column for lis-codart field // $editor = new AutocomleteComboBox('lis-codart_edit', $this->CreateLinkBuilder()); $editor->SetSize('350px'); $editor->setAllowClear(true); $editor->setMinimumInputLength(0); $lookupDataset = new TableDataset(new MyPDOConnectionFactory(), GetConnectionOptions(), '`elenco_articoli_view`'); $field = new StringField('art-codart'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('descrizione'); $lookupDataset->AddField($field, false); $lookupDataset->setOrderByField('descrizione', GetOrderTypeAsSQL(otAscending)); $editColumn = new DynamicLookupEditColumn('Codice Articolo', 'lis-codart', 'lis-codart_descrizione', 'insert_lis-codart_descrizione_search', $editor, $this->dataset, $lookupDataset, 'art-codart', 'descrizione', ''); $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 lisdesc field // $editor = new TextEdit('lisdesc_edit'); $editor->SetSize(100); $editColumn = new CustomEditColumn('Descrizione', 'lisdesc', $editor, $this->dataset); $editColumn->SetReadOnly(true); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for lis-unimis field // $editor = new ComboBox('lis-unimis_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $editor->AddValue('N', $this->RenderText('Nessuna')); $editor->AddValue('LT', $this->RenderText('Litri')); $editor->AddValue('KG', $this->RenderText('Chili')); $editor->AddValue('CF', $this->RenderText('Confezione')); $editor->AddValue('MC', $this->RenderText('Metri cubi')); $editor->AddValue('MT', $this->RenderText('Metri')); $editColumn = new CustomEditColumn('Unità misura', 'lis-unimis', $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 lis-przacq field // $editor = new TextEdit('lis-przacq_edit'); $editColumn = new CustomEditColumn('Prezzo acquisto', 'lis-przacq', $editor, $this->dataset); $editColumn->SetInsertDefaultValue($this->RenderText('0')); $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 lis-moltipl field // $editor = new TextEdit('lis-moltipl_edit'); $editColumn = new CustomEditColumn('Moltiplicatore', 'lis-moltipl', $editor, $this->dataset); $editColumn->SetReadOnly(true); $editColumn->SetInsertDefaultValue($this->RenderText('5')); $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 lis-oneriacc field // $editor = new TextEdit('lis-oneriacc_edit'); $editor->SetSuffix($this->RenderText('%')); $editColumn = new CustomEditColumn('Oneri e accessori', 'lis-oneriacc', $editor, $this->dataset); $editColumn->SetInsertDefaultValue($this->RenderText('0')); $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 lis-scarto field // $editor = new TextEdit('lis-scarto_edit'); $editor->SetSuffix($this->RenderText('%')); $editColumn = new CustomEditColumn('Scarto', 'lis-scarto', $editor, $this->dataset); $editColumn->SetInsertDefaultValue($this->RenderText('0')); $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 lis-dataini field // $editor = new DateTimeEdit('lis-dataini_edit', false, 'd-m-Y', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Data inizio decorrenza', 'lis-dataini', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATETIME%')); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for lis-datafin field // $editor = new DateTimeEdit('lis-datafin_edit', false, 'd-m-Y', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Data fine decorrenza', 'lis-datafin', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $editColumn->SetInsertDefaultValue($this->RenderText('31-12-9999')); $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 CreateSecondEditorControl() { $controlName = StringUtils::ReplaceIllegalPostVariableNameChars($this->GetFieldName()) . '_secondvalue'; if (!$this->useComboBox) { $result = new AutocomleteComboBox($controlName, $this->linkBuilder); $result->SetHandlerName($this->handlerName); $result->SetSize('155px'); } else { $result = new ComboBox($controlName, $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $this->lookupDataset->Open(); while ($this->lookupDataset->Next()) { $result->AddValue($this->lookupDataset->GetFieldValueByName($this->idColumn), $this->lookupDataset->GetFieldValueByName($this->valueColumn)); } $this->lookupDataset->CLose(); } return $result; }
protected function AddInsertColumns(Grid $grid) { // // Edit column for Cliente field // $editor = new AutocomleteComboBox('cliente_edit', $this->CreateLinkBuilder()); $editor->SetSize('250px'); $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`clientes`'); $field = new IntegerField('idClientes', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new IntegerField('Tipo_Documento'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Num_Identificacion'); $lookupDataset->AddField($field, false); $field = new IntegerField('DV'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Primer_Apellido'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Segundo_Apellido'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Primer_Nombre'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Otros_Nombres'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('RazonSocial'); $lookupDataset->AddField($field, false); $field = new StringField('Direccion'); $lookupDataset->AddField($field, false); $field = new StringField('Cod_Dpto'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Cod_Mcipio'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Pais_Domicilio'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Telefono'); $lookupDataset->AddField($field, false); $field = new StringField('Ciudad'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Contacto'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('TelContacto'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Email'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('CIUU'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('empresa_id'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('codigo'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('regimen'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('estado'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('RazonSocial', GetOrderTypeAsSQL(otAscending)); $editColumn = new DynamicLookupEditColumn('Cliente', 'Cliente', 'Cliente_RazonSocial', 'insert_Cliente_RazonSocial_search', $editor, $this->dataset, $lookupDataset, 'idClientes', 'RazonSocial', ''); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Telefono field // $editor = new TextEdit('telefono_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Telefono', 'Telefono', $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 Contacto field // $editor = new TextEdit('contacto_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Contacto', 'Contacto', $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 TelContacto field // $editor = new TextEdit('telcontacto_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('TelContacto', 'TelContacto', $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 Saldo field // $editor = new TextEdit('saldo_edit'); $editColumn = new CustomEditColumn('Saldo', 'Saldo', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for FechaVencimiento field // $editor = new TextEdit('fechavencimiento_edit'); $editor->SetSize(20); $editor->SetMaxLength(20); $editColumn = new CustomEditColumn('FechaVencimiento', 'FechaVencimiento', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for DiasCartera field // $editor = new TextEdit('diascartera_edit'); $editColumn = new CustomEditColumn('DiasCartera', 'DiasCartera', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Observaciones field // $editor = new TextAreaEdit('observaciones_edit', 50, 8); $editColumn = new CustomEditColumn('Observaciones', 'Observaciones', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Facturas_idFacturas field // $editor = new TextEdit('facturas_idfacturas_edit'); $editColumn = new CustomEditColumn('Facturas IdFacturas', 'Facturas_idFacturas', $editor, $this->dataset); $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption()))); $editor->GetValidatorCollection()->AddValidator($validator); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); if ($this->GetSecurityInfo()->HasAddGrant()) { $grid->SetShowAddButton(true); $grid->SetShowInlineAddButton(false); } else { $grid->SetShowInlineAddButton(false); $grid->SetShowAddButton(false); } }
protected function AddInsertColumns(Grid $grid) { // // Edit column for project_id field // $editor = new ComboBox('project_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $editColumn = new CustomEditColumn('Project', 'project_id', $editor, $this->dataset); $editColumn->SetReadOnly(true); $editColumn->setEnabled(false); $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 task_name field // $editor = new AutocomleteComboBox('task_name_edit', $this->CreateLinkBuilder()); $editor->SetSize('250px'); $editor->setAllowClear(true); $editor->setMinimumInputLength(0); $editColumn = new CustomEditColumn('Task Name', 'task_name', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for notes field // $editor = new TextAreaEdit('notes_edit', 50, 8); $editColumn = new CustomEditColumn('Notes', 'notes', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for hrs field // $editor = new SpinEdit('hrs_edit'); $editColumn = new CustomEditColumn('Estimated Hours', 'hrs', $editor, $this->dataset); $editColumn->SetInsertDefaultValue($this->RenderText('21')); $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 assigned_to field // $editor = new ComboBox('assigned_to_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $editColumn = new CustomEditColumn('Assigned To', 'assigned_to', $editor, $this->dataset); $editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_USER_ID%')); $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 date_start field // $editor = new DateTimeEdit('date_start_edit', false, 'Y-m-d', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Date Start', 'date_start', $editor, $this->dataset); $editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATE%')); $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 date_end field // $editor = new DateTimeEdit('date_end_edit', false, 'Y-m-d', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Date End', 'date_end', $editor, $this->dataset); $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption()))); $editor->GetValidatorCollection()->AddValidator($validator); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); if ($this->GetSecurityInfo()->HasAddGrant()) { $grid->SetShowAddButton(true); $grid->SetShowInlineAddButton(false); } else { $grid->SetShowInlineAddButton(false); $grid->SetShowAddButton(false); } }
protected function AddInsertColumns(Grid $grid) { // // Edit column for Tipo_Documento field // $editor = new ComboBox('tipo_documento_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`cod_documentos`'); $field = new IntegerField('Codigo'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Descripcion'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('Descripcion', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn('Tipo Documento', 'Tipo_Documento', $editor, $this->dataset, 'Codigo', 'Descripcion', $lookupDataset); $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption()))); $editor->GetValidatorCollection()->AddValidator($validator); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Num_Identificacion field // $editor = new TextEdit('num_identificacion_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Num Identificacion', 'Num_Identificacion', $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 DV field // $editor = new TextEdit('dv_edit'); $editColumn = new CustomEditColumn('DV', 'DV', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Primer_Apellido field // $editor = new TextEdit('primer_apellido_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Primer Apellido', 'Primer_Apellido', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Segundo_Apellido field // $editor = new TextEdit('segundo_apellido_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Segundo Apellido', 'Segundo_Apellido', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Primer_Nombre field // $editor = new TextEdit('primer_nombre_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Primer Nombre', 'Primer_Nombre', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Otros_Nombres field // $editor = new TextEdit('otros_nombres_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Otros Nombres', 'Otros_Nombres', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for RazonSocial field // $editor = new TextEdit('razonsocial_edit'); $editor->SetSize(100); $editor->SetMaxLength(100); $editColumn = new CustomEditColumn('RazonSocial', 'RazonSocial', $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 Direccion field // $editor = new TextEdit('direccion_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Direccion', 'Direccion', $editor, $this->dataset); $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption()))); $editor->GetValidatorCollection()->AddValidator($validator); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Cod_Dpto field // $editor = new AutocomleteComboBox('cod_dpto_edit', $this->CreateLinkBuilder()); $editor->SetSize('250px'); $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`cod_departamentos`'); $field = new IntegerField('Cod_dpto'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('Nombre'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('Nombre', GetOrderTypeAsSQL(otAscending)); $editColumn = new DynamicLookupEditColumn('Cod Dpto', 'Cod_Dpto', 'Cod_Dpto_Nombre', 'insert_Cod_Dpto_Nombre_search', $editor, $this->dataset, $lookupDataset, 'Cod_dpto', 'Nombre', ''); $editColumn->SetInsertDefaultValue($this->RenderText('76')); $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption()))); $editor->GetValidatorCollection()->AddValidator($validator); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Cod_Mcipio field // $editor = new TextEdit('cod_mcipio_edit'); $editor->SetSize(10); $editor->SetMaxLength(10); $editColumn = new CustomEditColumn('Cod Mcipio', 'Cod_Mcipio', $editor, $this->dataset); $editColumn->SetInsertDefaultValue($this->RenderText('111')); $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 Pais_Domicilio field // $editor = new AutocomleteComboBox('pais_domicilio_edit', $this->CreateLinkBuilder()); $editor->SetSize('250px'); $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`cod_paises`'); $field = new IntegerField('Codigo'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('Pais'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('Pais', GetOrderTypeAsSQL(otAscending)); $editColumn = new DynamicLookupEditColumn('Pais Domicilio', 'Pais_Domicilio', 'Pais_Domicilio_Pais', 'insert_Pais_Domicilio_Pais_search', $editor, $this->dataset, $lookupDataset, 'Codigo', 'Pais', ''); $editColumn->SetInsertDefaultValue($this->RenderText('169')); $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 Telefono field // $editor = new TextEdit('telefono_edit'); $editor->SetSize(100); $editor->SetMaxLength(100); $editColumn = new CustomEditColumn('Telefono', 'Telefono', $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 Ciudad field // $editor = new TextEdit('ciudad_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Ciudad', 'Ciudad', $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 Contacto field // $editor = new TextEdit('contacto_edit'); $editor->SetSize(100); $editor->SetMaxLength(100); $editColumn = new CustomEditColumn('Contacto', 'Contacto', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for TelContacto field // $editor = new TextEdit('telcontacto_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('TelContacto', 'TelContacto', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Email field // $editor = new TextEdit('email_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Email', 'Email', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for empresa_id field // $editor = new ComboBox('empresa_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`empresa`'); $field = new IntegerField('id', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('habilitacion'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('nit'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('nombre'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('tipo'); $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 StringField('depto'); $lookupDataset->AddField($field, false); $field = new StringField('mupio'); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('nombre', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn('Empresa Id', 'empresa_id', $editor, $this->dataset, 'id', 'nombre', $lookupDataset); $editColumn->SetInsertDefaultValue($this->RenderText('1')); $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 codigo field // $editor = new TextEdit('codigo_edit'); $editor->SetSize(20); $editor->SetMaxLength(20); $editColumn = new CustomEditColumn('Codigo', 'codigo', $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 estado field // $editor = new ComboBox('estado_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $editor->AddValue('I', $this->RenderText('Inactivo')); $editor->AddValue('A', $this->RenderText('Activo')); $editColumn = new CustomEditColumn('Estado', 'estado', $editor, $this->dataset); $editColumn->SetInsertDefaultValue($this->RenderText('A')); $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 regimen field // $editor = new ComboBox('regimen_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $editor->AddValue('1', $this->RenderText('Contributivo')); $editor->AddValue('2', $this->RenderText('Subsidiado')); $editor->AddValue('3', $this->RenderText('Vinculado')); $editor->AddValue('4', $this->RenderText('Particular')); $editor->AddValue('5', $this->RenderText('Otro')); $editColumn = new CustomEditColumn('Regimen', 'regimen', $editor, $this->dataset); $editColumn->SetInsertDefaultValue($this->RenderText('1')); $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption()))); $editor->GetValidatorCollection()->AddValidator($validator); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); if ($this->GetSecurityInfo()->HasAddGrant()) { $grid->SetShowAddButton(true); $grid->SetShowInlineAddButton(false); } else { $grid->SetShowInlineAddButton(false); $grid->SetShowAddButton(false); } }
protected function AddInsertColumns(Grid $grid) { // // Edit column for ivo-codart field // $editor = new AutocomleteComboBox('ivo-codart_edit', $this->CreateLinkBuilder()); $editor->SetSize('250px'); $editor->setAllowClear(true); $editor->setMinimumInputLength(0); $lookupDataset = new TableDataset(new MyPDOConnectionFactory(), GetConnectionOptions(), '`elenco_articoli_view`'); $field = new StringField('art-codart'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('descrizione'); $lookupDataset->AddField($field, false); $lookupDataset->setOrderByField('descrizione', GetOrderTypeAsSQL(otAscending)); $editColumn = new DynamicLookupEditColumn('Codice Articolo', 'ivo-codart', 'ivo-codart_descrizione', 'insert_ivo-codart_descrizione_search', $editor, $this->dataset, $lookupDataset, 'art-codart', 'descrizione', ''); $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 ivo-codvoc field // $editor = new ComboBox('ivo-codvoc_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset(new MyPDOConnectionFactory(), GetConnectionOptions(), '`voci_costo`'); $field = new IntegerField('id', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new IntegerField('voc-codvoce'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('voc-descriz'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('voc-semanual'); $lookupDataset->AddField($field, false); $field = new IntegerField('voc-formula'); $lookupDataset->AddField($field, false); $field = new StringField('voc-flagart'); $lookupDataset->AddField($field, false); $field = new IntegerField('voc-przunit'); $lookupDataset->AddField($field, false); $field = new DateTimeField('datains'); $lookupDataset->AddField($field, false); $field = new DateTimeField('datamod'); $lookupDataset->AddField($field, false); $lookupDataset->setOrderByField('voc-descriz', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn('Codice Tipo Voce', 'ivo-codvoc', $editor, $this->dataset, 'voc-codvoce', 'voc-descriz', $lookupDataset); $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption()))); $editor->GetValidatorCollection()->AddValidator($validator); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ivo-przunit field // $editor = new TextEdit('ivo-przunit_edit'); $editColumn = new CustomEditColumn('Prezzo unitario', 'ivo-przunit', $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 ivo-flagart field // $editor = new CheckBox('ivo-flagart_edit'); $editColumn = new CustomEditColumn('Altro articolo', 'ivo-flagart', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ivo-flagsmu field // $editor = new CheckBox('ivo-flagsmu_edit'); $editColumn = new CustomEditColumn('Prevede smusso', 'ivo-flagsmu', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ivo-dataini field // $editor = new DateTimeEdit('ivo-dataini_edit', false, 'd-m-Y', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Data decorrenza listino', 'ivo-dataini', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ivo-datafin field // $editor = new DateTimeEdit('ivo-datafin_edit', false, 'd-m-Y', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Data fine decorrenza listino', 'ivo-datafin', $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 AddInsertColumns(Grid $grid) { // // Edit column for Fecha field // $editor = new TextEdit('fecha_edit'); $editColumn = new CustomEditColumn('Fecha', 'Fecha', $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 Tipo_Documento_Intero field // $editor = new TextEdit('tipo_documento_intero_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Tipo Documento Intero', 'Tipo_Documento_Intero', $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 Num_Documento_Interno field // $editor = new TextEdit('num_documento_interno_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Num Documento Interno', 'Num_Documento_Interno', $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 Tercero_Tipo_Documento field // $editor = new AutocomleteComboBox('tercero_tipo_documento_edit', $this->CreateLinkBuilder()); $editor->SetSize('250px'); $editColumn = new CustomEditColumn('Tercero Tipo Documento', 'Tercero_Tipo_Documento', $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 Tercero_Identificacion field // $editor = new TextEdit('tercero_identificacion_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Tercero Identificacion', 'Tercero_Identificacion', $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 Tercero_DV field // $editor = new TextEdit('tercero_dv_edit'); $editor->SetSize(3); $editor->SetMaxLength(3); $editColumn = new CustomEditColumn('Tercero DV', 'Tercero_DV', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Tercero_Primer_Apellido field // $editor = new TextEdit('tercero_primer_apellido_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Tercero Primer Apellido', 'Tercero_Primer_Apellido', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Tercero_Segundo_Apellido field // $editor = new TextEdit('tercero_segundo_apellido_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Tercero Segundo Apellido', 'Tercero_Segundo_Apellido', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Tercero_Primer_Nombre field // $editor = new TextEdit('tercero_primer_nombre_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Tercero Primer Nombre', 'Tercero_Primer_Nombre', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Tercero_Otros_Nombres field // $editor = new TextEdit('tercero_otros_nombres_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Tercero Otros Nombres', 'Tercero_Otros_Nombres', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Tercero_Razon_Social field // $editor = new TextEdit('tercero_razon_social_edit'); $editor->SetSize(100); $editor->SetMaxLength(100); $editColumn = new CustomEditColumn('Tercero Razon Social', 'Tercero_Razon_Social', $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 Tercero_Direccion field // $editor = new TextEdit('tercero_direccion_edit'); $editor->SetSize(100); $editor->SetMaxLength(100); $editColumn = new CustomEditColumn('Tercero Direccion', 'Tercero_Direccion', $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 Tercero_Cod_Dpto field // $editor = new TextEdit('tercero_cod_dpto_edit'); $editColumn = new CustomEditColumn('Tercero Cod Dpto', 'Tercero_Cod_Dpto', $editor, $this->dataset); $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption()))); $editor->GetValidatorCollection()->AddValidator($validator); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Tercero_Cod_Mcipio field // $editor = new TextEdit('tercero_cod_mcipio_edit'); $editor->SetSize(10); $editor->SetMaxLength(10); $editColumn = new CustomEditColumn('Tercero Cod Mcipio', 'Tercero_Cod_Mcipio', $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 Tercero_Pais_Domicilio field // $editor = new TextEdit('tercero_pais_domicilio_edit'); $editor->SetSize(10); $editor->SetMaxLength(10); $editColumn = new CustomEditColumn('Tercero Pais Domicilio', 'Tercero_Pais_Domicilio', $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 Concepto field // $editor = new TextAreaEdit('concepto_edit', 50, 8); $editColumn = new CustomEditColumn('Concepto', 'Concepto', $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 CuentaPUC field // $editor = new TextEdit('cuentapuc_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('CuentaPUC', 'CuentaPUC', $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 NombreCuenta field // $editor = new TextEdit('nombrecuenta_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('NombreCuenta', 'NombreCuenta', $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 Detalle field // $editor = new TextEdit('detalle_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Detalle', 'Detalle', $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 Debito field // $editor = new TextEdit('debito_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Debito', 'Debito', $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 Credito field // $editor = new TextEdit('credito_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Credito', 'Credito', $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 Neto field // $editor = new TextEdit('neto_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Neto', 'Neto', $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 Mayor field // $editor = new ComboBox('mayor_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $editor->AddValue('NO', $this->RenderText('NO')); $editor->AddValue('SI', $this->RenderText('SI')); $editColumn = new CustomEditColumn('Mayor', 'Mayor', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $editColumn->SetInsertDefaultValue($this->RenderText('NO')); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for servicio_id field // $editor = new ComboBox('servicio_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`servicio`'); $field = new IntegerField('id', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new IntegerField('empresa_id'); $lookupDataset->AddField($field, false); $field = new StringField('nombre'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('estado'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('nombre', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn('Servicio Id', 'servicio_id', $editor, $this->dataset, 'id', 'nombre', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for empresa_id field // $editor = new TextEdit('empresa_id_edit'); $editColumn = new CustomEditColumn('Empresa Id', 'empresa_id', $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 AddInsertColumns(Grid $grid) { // // Edit column for project_id field // $editor = new ComboBox('project_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`project`'); $field = new IntegerField('project_id', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new IntegerField('programm_id'); $lookupDataset->AddField($field, false); $field = new StringField('project_name'); $lookupDataset->AddField($field, false); $field = new DateField('date_start'); $lookupDataset->AddField($field, false); $field = new DateField('date_end'); $lookupDataset->AddField($field, false); $field = new IntegerField('approved_budget'); $lookupDataset->AddField($field, false); $field = new StringField('notes'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('priority'); $lookupDataset->AddField($field, false); $field = new StringField('lead'); $lookupDataset->AddField($field, false); $field = new StringField('level_of_service'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('multi_year'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('public_engagement'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('year'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('approved'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('progress'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('staff_id'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('dept_id'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('budget_spent'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('admin_flag'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('project_name', GetOrderTypeAsSQL(otAscending)); $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), '%CURRENT_USER_ID% = 1 OR project.lead=%CURRENT_USER_ID%')); $editColumn = new LookUpEditColumn('Project', 'project_id', $editor, $this->dataset, 'project_id', 'project_name', $lookupDataset); $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption()))); $editor->GetValidatorCollection()->AddValidator($validator); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for task_name field // $editor = new AutocomleteComboBox('task_name_edit', $this->CreateLinkBuilder()); $editor->SetSize('250px'); $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`task_names`'); $field = new IntegerField('id', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('Name'); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('Name', GetOrderTypeAsSQL(otAscending)); $editColumn = new DynamicLookupEditColumn('Name', 'task_name', 'task_name_Name', 'insert_task_name_Name_search', $editor, $this->dataset, $lookupDataset, 'Name', 'Name', ''); $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 notes field // $editor = new TextAreaEdit('notes_edit', 50, 8); $editColumn = new CustomEditColumn('Notes', 'notes', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for hrs field // $editor = new SpinEdit('hrs_edit'); $editColumn = new CustomEditColumn('Allocated Hours', 'hrs', $editor, $this->dataset); $editColumn->SetInsertDefaultValue($this->RenderText('21')); $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption()))); $editor->GetValidatorCollection()->AddValidator($validator); $validator = new NumberValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('NumberValidationMessage'), $this->RenderText($editColumn->GetCaption()))); $editor->GetValidatorCollection()->AddValidator($validator); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for assigned_to field // $editor = new ComboBox('assigned_to_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`staff`'); $field = new IntegerField('staff_id', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('username'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('email'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('picture'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('password'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('dept_id'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('position'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('emp_number'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('username', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn('Assigned To', 'assigned_to', $editor, $this->dataset, 'staff_id', 'username', $lookupDataset); $editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_USER_ID%')); $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 date_start field // $editor = new DateTimeEdit('date_start_edit', false, 'Y-m-d', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Date Start', 'date_start', $editor, $this->dataset); $editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATE%')); $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 date_end field // $editor = new DateTimeEdit('date_end_edit', true, 'Y-m-d', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Date End', 'date_end', $editor, $this->dataset); $editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATE%')); $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption()))); $editor->GetValidatorCollection()->AddValidator($validator); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); if ($this->GetSecurityInfo()->HasAddGrant()) { $grid->SetShowAddButton(true); $grid->SetShowInlineAddButton(false); } else { $grid->SetShowInlineAddButton(false); $grid->SetShowAddButton(false); } }
protected function AddInsertColumns(Grid $grid) { // // Edit column for sco-codcli field // $editor = new AutocomleteComboBox('sco-codcli_edit', $this->CreateLinkBuilder()); $editor->SetSize('250px'); $editor->setAllowClear(true); $editor->setMinimumInputLength(0); $lookupDataset = new TableDataset(new MyPDOConnectionFactory(), GetConnectionOptions(), '`clienti`'); $field = new IntegerField('id', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('cli-codcli'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('cli-ragsoc'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('cli-codlis'); $lookupDataset->AddField($field, false); $field = new DateTimeField('datains'); $lookupDataset->AddField($field, false); $field = new DateTimeField('datamod'); $lookupDataset->AddField($field, false); $lookupDataset->setOrderByField('cli-ragsoc', GetOrderTypeAsSQL(otAscending)); $editColumn = new DynamicLookupEditColumn('Codice cliente', 'sco-codcli', 'sco-codcli_cli-ragsoc', 'insert_sco-codcli_cli-ragsoc_search', $editor, $this->dataset, $lookupDataset, 'cli-codcli', 'cli-ragsoc', ''); $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 sco-codart field // $editor = new AutocomleteComboBox('sco-codart_edit', $this->CreateLinkBuilder()); $editor->SetSize('250px'); $editor->setAllowClear(true); $editor->setMinimumInputLength(0); $lookupDataset = new TableDataset(new MyPDOConnectionFactory(), GetConnectionOptions(), '`elenco_articoli_view`'); $field = new StringField('art-codart'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('descrizione'); $lookupDataset->AddField($field, false); $lookupDataset->setOrderByField('descrizione', GetOrderTypeAsSQL(otAscending)); $editColumn = new DynamicLookupEditColumn('Codice articolo', 'sco-codart', 'sco-codart_descrizione', 'insert_sco-codart_descrizione_search', $editor, $this->dataset, $lookupDataset, 'art-codart', 'descrizione', ''); $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 sco-codvoc field // $editor = new ComboBox('sco-codvoc_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $editColumn = new CustomEditColumn('Codice tipo voce', 'sco-codvoc', $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 sco-sconto field // $editor = new TextEdit('sco-sconto_edit'); $editColumn = new CustomEditColumn('Sconto', 'sco-sconto', $editor, $this->dataset); $editColumn->SetInsertDefaultValue($this->RenderText('0')); $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption()))); $editor->GetValidatorCollection()->AddValidator($validator); $validator = new NumberValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('NumberValidationMessage'), $this->RenderText($editColumn->GetCaption()))); $editor->GetValidatorCollection()->AddValidator($validator); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); if ($this->GetSecurityInfo()->HasAddGrant()) { $grid->SetShowAddButton(true); $grid->SetShowInlineAddButton(false); } else { $grid->SetShowInlineAddButton(false); $grid->SetShowAddButton(false); } }