}//END getListObject method. // ============================================================================== /// <summary> /// This method creates the record view pageMenuGroup containing a list of commands to /// open the form record. /// </summary> /// <param name="Page">Evado.Model.Uniform.Page object to add the pageMenuGroup to.</param> // ------------------------------------------------------------------------------ private void getRecordExport_SelectionGroup ( Evado.UniForm.Model.Page Page ) { this.LogMethod ( "getRecordExport_SelectionGroup" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( ); Evado.UniForm.Model.Command command = new Evado.UniForm.Model.Command ( ); Evado.UniForm.Model.Field selectionField = new Evado.UniForm.Model.Field ( ); List<EvOption> optionList = new List<EvOption> ( ); // // If the issued form list is empty fill it with the currently issued form selection objects. // if ( this.Session.IssueFormList.Count == 0 ) { this.LogDebug ( "Issued Forms is empty so create list." ); EdRecordLayouts forms = new EdRecordLayouts ( this.ClassParameters ); this.Session.IssueFormList = forms.getList ( EdRecordTypes.Null, EdRecordObjectStates.Form_Issued, false ); } this.LogDebug ( "Issued Forms list count {0}.", this.Session.IssueFormList.Count ); // // Create the new pageMenuGroup for query selection. // pageGroup = Page.AddGroup ( EdLabels.Record_Selection_Group_Title, Evado.UniForm.Model.EditAccess.Enabled ); pageGroup.GroupType = Evado.UniForm.Model.GroupTypes.Default; pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; pageGroup.AddParameter ( Evado.UniForm.Model.GroupParameterList.Offline_Hide_Group, true ); // // Add the selection pageMenuGroup. // selectionField = pageGroup.createSelectionListField ( EdRecord.FieldNames.Layout_Id, EdLabels.Label_Form_Id, this.Session.Selected_EntityLayoutId, this.Session.IssueFormList ); selectionField.Layout = EuAdapter.DefaultFieldLayout; // // Define the include draft record selection option. // selectionField = pageGroup.createBooleanField ( EuEntities.CONST_INCLUDE_DRAFT_RECORDS, EdLabels.Record_Export_Include_Draft_Record_Field_Title, this.Session.FormRecords_IncludeDraftRecords ); selectionField.Layout = EuAdapter.DefaultFieldLayout; // // Define the include free text ResultData selection option. // selectionField = pageGroup.createBooleanField ( EuEntities.CONST_INCLUDE_FREE_TEXT_DATA, EdLabels.Record_Export_Include_FreeText_data_Field_Title, this.Session.FormRecords_IncludeFreeTextData ); selectionField.Layout = EuAdapter.DefaultFieldLayout; // // Add the selection groupCommand // command = pageGroup.addCommand ( EdLabels.Record_Export_Selection_Group_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Custom_Method ); command.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); }//END getRecordExport_ListObject method
}//END getEntity_Summary_ListGroup method // ============================================================================== /// <summary> /// This method appends the milestone groupCommand to the page milestone list pageMenuGroup /// </summary> /// <param name="Entity">EvForm object</param> /// <param name="PageGroup"> Evado.UniForm.Model.Group</param> // ----------------------------------------------------------------------------- private void getGroupSummaryListGroup ( EdRecord Entity, Evado.UniForm.Model.Page PageObject ) { this.LogMethod ( "getGroupSummaryListGroup" ); this.LogDebug ( "Entity.EntityId: " + Entity.EntityId ); this.LogDebug ( "LinkContentSetting: " + Entity.Design.LinkContentSetting ); this.LogDebug ( "DefaultPageLayout: " + Entity.Design.DefaultPageLayout ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( ); Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field ( ); Evado.UniForm.Model.Command groupCommand = new Evado.UniForm.Model.Command ( ); // // Create the record display pageMenuGroup. // pageGroup = PageObject.AddGroup ( String.Empty ); pageGroup.CmdLayout = Evado.UniForm.Model.GroupCommandListLayouts.Horizontal_Orientation; pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Dynamic; pageGroup.AddParameter ( Evado.UniForm.Model.GroupParameterList.Percent_Width, 25 ); foreach ( EdRecordField field in Entity.Fields ) { this.LogDebug ( "fid {0} - {1} V: {2}. ", field.FieldId, field.TypeId, field.ItemValue ); if ( field.Design.IsSummaryField == false && field.TypeId != EvDataTypes.Image && field.TypeId != EvDataTypes.Text && field.TypeId != EvDataTypes.Numeric && field.TypeId != EvDataTypes.Telephone_Number && field.TypeId != EvDataTypes.Selection_List && field.TypeId != EvDataTypes.Radio_Button_List && field.TypeId != EvDataTypes.Check_Box_List && field.TypeId != EvDataTypes.External_Selection_List && field.TypeId != EvDataTypes.External_RadioButton_List && field.TypeId != EvDataTypes.External_CheckBox_List ) { continue; } // // skip all empty items. // if ( field.ItemValue == String.Empty || field.ItemValue.Contains ( "E+37" ) == true || field.ItemValue.Contains ( "E-35" ) == true ) { continue; } this.LogDebug ( "FieldId {0}, value {1} ", field.FieldId, field.ItemValue ); // // Define the layout. // Evado.UniForm.Model.FieldLayoutCodes layout = Evado.UniForm.Model.FieldLayoutCodes.Left_Justified; switch ( field.TypeId ) { case EvDataTypes.Image: { groupField = pageGroup.createImageField ( String.Empty, field.Title, field.ItemValue, 125, 0 ); groupField.EditAccess = Evado.UniForm.Model.EditAccess.Disabled; groupField.Layout = layout; continue; } case EvDataTypes.Selection_List: case EvDataTypes.Check_Box_List: case EvDataTypes.Radio_Button_List: case EvDataTypes.Horizontal_Radio_Buttons: case EvDataTypes.External_Selection_List: case EvDataTypes.External_RadioButton_List: case EvDataTypes.External_CheckBox_List: { var value = this.getSelectionDescription ( field, field.ItemValue ); groupField = pageGroup.createReadOnlyTextField ( String.Empty, field.Title, value ); groupField.EditAccess = Evado.UniForm.Model.EditAccess.Disabled; groupField.Layout = layout; continue; } default: { groupField = pageGroup.createReadOnlyTextField ( String.Empty, field.Title, field.ItemValue ); groupField.EditAccess = Evado.UniForm.Model.EditAccess.Disabled; groupField.Layout = layout; continue; } }//END type switch statement. }//END field iteration loop // // Define the pageMenuGroup groupCommand. // groupCommand = pageGroup.addCommand ( Entity.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities, Evado.UniForm.Model.ApplicationMethods.Get_Object ); groupCommand.Id = Entity.Guid; groupCommand.SetGuid ( Entity.Guid ); // // Define the link groupCommand. // EdRecordField commandField = Entity.getFirstHttpLinkField ( ); if ( commandField != null ) { this.LogDebug ( "FieldId {0}, value {1} ", commandField.FieldId, commandField.ItemValue ); if ( commandField.ItemValue != String.Empty ) { string title = commandField.Title; string url = commandField.ItemValue; if ( url.Contains ( "^" ) == true ) { string [ ] arValue = commandField.ItemValue.Split ( '^' ); url = arValue [ 0 ]; title = arValue [ 1 ]; } groupCommand = pageGroup.addCommand ( title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities, Evado.UniForm.Model.ApplicationMethods.Get_Object ); groupCommand.Type = Evado.UniForm.Model.CommandTypes.Http_Link; groupCommand.AddParameter ( Evado.UniForm.Model.CommandParameters.Link_Url, url ); } } this.LogMethodEnd ( "getGroupSummaryListGroup" ); }//END getGroupListCommand method
}//END getListObject method. // ============================================================================== /// <summary> /// This method creates the record view pageMenuGroup containing a list of commands to /// open the form record. /// </summary> /// <param name="PageObject">Evado.Model.Uniform.Page object to add the pageMenuGroup to.</param> // ------------------------------------------------------------------------------ private void getList_SelectionGroup ( Evado.UniForm.Model.Page PageObject ) { this.LogMethod ( "getList_SelectionGroup" ); this.LogDebug ( "IssuedEntityLayouts.Count {0}. ", this.AdapterObjects.IssuedEntityLayouts.Count ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( ); List<EvOption> optionList; Evado.UniForm.Model.Field selectionField; if ( this._HideSelectionGroup == true ) { this.LogMethodEnd ( "getList_SelectionGroup" ); return; } // // Create the new pageMenuGroup for record selection. // pageGroup = PageObject.AddGroup ( EdLabels.Entities_Selection_Group_Title, Evado.UniForm.Model.EditAccess.Enabled ); pageGroup.GroupType = Evado.UniForm.Model.GroupTypes.Default; pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; pageGroup.AddParameter ( Evado.UniForm.Model.GroupParameterList.Offline_Hide_Group, true ); // // Add the record state selection option // optionList = new List<EvOption> ( ); optionList.Add ( new EvOption ( ) ); foreach ( EdRecord layout in this.AdapterObjects.IssuedEntityLayouts ) { optionList.Add ( new EvOption ( layout.LayoutId, String.Format ( "{0} - {1}", layout.LayoutId, layout.Title ) ) ); } selectionField = pageGroup.createSelectionListField ( EdRecord.FieldNames.Layout_Id, EdLabels.Label_Form_Id, this.Session.Selected_EntityLayoutId, optionList ); selectionField.Layout = EuAdapter.DefaultFieldLayout; selectionField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); // // Add the record state selection option // optionList = EdRecord.getRecordStates ( false ); selectionField = pageGroup.createSelectionListField ( EdRecord.FieldNames.Status.ToString ( ), EdLabels.Record_State_Selection, this.Session.EntityStateSelection, optionList ); selectionField.Layout = EuAdapter.DefaultFieldLayout; selectionField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); // // Add the selection groupCommand // Evado.UniForm.Model.Command selectionCommand = pageGroup.addCommand ( EdLabels.Select_Records_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Custom_Method ); selectionCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); }//ENd getList_SelectionGroup method
// ============================================================================== /// <summary> /// This method creates the record view pageMenuGroup containing a list of commands to /// open the form record. /// </summary> /// <param name="PageObject">Evado.Model.Uniform.Page object to add the pageMenuGroup to.</param> /// <param name="subjects">EvSubjects subjects to add to selection groups</param> /// <param name="subjectVisits">EvSubjectMilestones visits for each subject</param> /// <param name="QueryParameters">EvQueryParameters: conting the query parameters</param> /// <param name="ApplicationObject">Adapter.ApplicationObjects object.</param> // ------------------------------------------------------------------------------ private void getFilteredList_SelectionGroup ( Evado.UniForm.Model.Page PageObject ) { this.LogMethod ( "getFilteredList_SelectionGroup" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Group pageGroup = null; Evado.UniForm.Model.Command selectionCommand = null; List<EvOption> optionList; Evado.UniForm.Model.Field groupField; // // if hide selection group is enabled exit // if ( this._HideSelectionGroup == true ) { return; } // // Create the new pageMenuGroup for record selection. // pageGroup = PageObject.AddGroup ( EdLabels.Entities_Selection_Group_Title, Evado.UniForm.Model.EditAccess.Enabled ); pageGroup.GroupType = Evado.UniForm.Model.GroupTypes.Default; pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; pageGroup.AddParameter ( Evado.UniForm.Model.GroupParameterList.Offline_Hide_Group, true ); // // if the entity is not selected display an entity selection field. // if ( this.Session.Selected_EntityLayoutId == String.Empty ) { // // Add the record state selection option // optionList = new List<EvOption> ( ); optionList.Add ( new EvOption ( ) ); foreach ( EdRecord layout in this.AdapterObjects.IssuedEntityLayouts ) { optionList.Add ( layout.SelectionOption ); } groupField = pageGroup.createSelectionListField ( EdRecord.FieldNames.Layout_Id, EdLabels.Label_Form_Id, this.Session.Selected_EntityLayoutId, optionList ); groupField.Layout = EuAdapter.DefaultFieldLayout; groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); // // Add the selection groupCommand // selectionCommand = pageGroup.addCommand ( EdLabels.Entities_Selection_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Custom_Method ); selectionCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); selectionCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.Entity_Filter_View ); this.LogDebug ( "Group Command Count {0}. ", pageGroup.CommandList.Count ); this.LogMethodEnd ( "getFilteredList_SelectionGroup" ); return; }//END layoutId selection // // if the entity layout id has been defined display the entity selection fields. // // // retrieve the selected entity layout object // this.queryLayout = this.AdapterObjects.GetEntityLayout ( this.Session.Selected_EntityLayoutId ); this.LogDebug ( "E: {0} S: {1}.", queryLayout.LayoutId, queryLayout.State ); this.LogDebug ( "Entity {0}. ", queryLayout.CommandTitle ); this.LogDebug ( "StaticQueryFilterOptions {0}. ", this.AdapterObjects.Settings.StaticQueryFilterOptions ); // // Insert the static filter selection for organisation city. // if ( this.AdapterObjects.Settings.StaticQueryFilterOptions.Contains ( EdOrganisation.FieldNames.Address_Country.ToString ( ) ) == true ) { this.getQueryList_StaticOrgFilter ( pageGroup, EdOrganisation.FieldNames.Address_Country ); } if ( this.AdapterObjects.Settings.StaticQueryFilterOptions.Contains ( EdOrganisation.FieldNames.Address_City.ToString ( ) ) == true ) { this.getQueryList_StaticOrgFilter ( pageGroup, EdOrganisation.FieldNames.Address_City ); } if ( this.AdapterObjects.Settings.StaticQueryFilterOptions.Contains ( EdOrganisation.FieldNames.Address_Post_Code.ToString ( ) ) == true ) { this.getQueryList_StaticOrgFilter ( pageGroup, EdOrganisation.FieldNames.Address_Post_Code ); } // // iterate through the filter field ids and display the filter field in the selection group. // for ( int filterIndex = 0; filterIndex < queryLayout.FilterFieldIds.Length; filterIndex++ ) { string fieldId = queryLayout.FilterFieldIds [ filterIndex ]; if ( fieldId == String.Empty ) { continue; } this.LogDebug ( "fieldId {0}. ", fieldId ); // // retrieve the matching field object. // EdRecordField field = queryLayout.GetFieldObject ( fieldId ); if ( field == null ) { continue; } this.LogDebug ( "field.FieldId {0} - {1}. ", field.FieldId, field.Title ); // // retrieve the current selection filter value. // string selectionFilter = this.Session.EntitySelectionFilters [ filterIndex ]; this.LogDebug ( "selectionFilter {0}. ", selectionFilter ); // // create the selection field object for the selected field. // this.getFilteredList_SelectionField ( pageGroup, filterIndex, selectionFilter, field ); }//END of the Selection filter iteration loop. // // Add the selection groupCommand // selectionCommand = pageGroup.addCommand ( EdLabels.Entities_Selection_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Custom_Method ); selectionCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); selectionCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.Entity_Filter_View ); ; this.LogDebug ( "Group Command Count {0}. ", pageGroup.CommandList.Count ); this.LogMethodEnd ( "getFilteredList_SelectionGroup" ); }//ENd getFilteredList_SelectionGroup method