// ==============================================================================
    /// <summary>
    /// This method creates an entity filter selection field object.
    /// </summary>
    /// <param name="PageGroup">Evado.Model.Uniform.Group object to add the pageGroup .</param>
    /// <param name="FilterIndex">Integer: filter index</param>
    /// <param name="SelectionFilter">String: filter value </param>
    /// <param name="Field">EdRecordField object.</param>
    //  ------------------------------------------------------------------------------
    private void getFilteredList_SelectionField (
      Evado.UniForm.Model.Group PageGroup,
      int FilterIndex,
      String SelectionFilter,
      EdRecordField Field )
    {
      this.LogMethod ( "getFilteredList_SelectionField" );

      this.LogDebug ( "FilterIndex: {0}, SelectionFilter: {1}. ", FilterIndex, SelectionFilter );
      //this.LogDebug ( "F: {0}, T: {1}, Type {2}. ", Field.FieldId, Field.Title, Field.TypeId );

      List<EvOption> optionList = Evado.UniForm.Model.EuStatics.getStringAsOptionList (
        Field.Design.Options );

      optionList.Sort ( ( n1, n2 ) => n1.Description.CompareTo ( n2.Description ) );

      List<EvOption> selectionOptionList = new List<EvOption> ( );
      selectionOptionList.Add ( new EvOption ( ) );
      foreach ( EvOption opt in optionList )
      {
        selectionOptionList.Add ( opt );
      }

      //
      // user the switch to select the selection data types.
      //
      switch ( Field.TypeId )
      {
        case EvDataTypes.Check_Box_List:
          {
            var field = PageGroup.createCheckBoxListField (
              EuEntities.CONST_SELECTION_FIELD + FilterIndex,
              Field.Title,
              SelectionFilter,
              optionList );
            field.Layout = EuAdapter.DefaultFieldLayout;
            field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );

            break;
          }
        case EvDataTypes.Yes_No:
        case EvDataTypes.Boolean:
          {
            var field = PageGroup.createBooleanField (
              EuEntities.CONST_SELECTION_FIELD + FilterIndex,
              Field.Title,
              EvStatics.getBool ( SelectionFilter ) );
            field.Layout = EuAdapter.DefaultFieldLayout;
            field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );

            break;
          }
        case EvDataTypes.Selection_List:
        case EvDataTypes.Radio_Button_List:
          {
            var field = PageGroup.createSelectionListField (
              EuEntities.CONST_SELECTION_FIELD + FilterIndex,
              Field.Title,
              SelectionFilter,
              selectionOptionList );
            field.Layout = EuAdapter.DefaultFieldLayout;
            field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );

            break;
          }
        case EvDataTypes.External_Selection_List:
        case EvDataTypes.External_RadioButton_List:
          {
            this.LogDebug ( "External_Selection_List filter" );
            selectionOptionList = this.getFilteredList_SelectionOptions ( Field, true );

            if ( selectionOptionList.Count <= 1 )
            {
              this.LogDebug ( "No Selection list options" );
              break;
            }

            var field = PageGroup.createSelectionListField (
              EuEntities.CONST_SELECTION_FIELD + FilterIndex,
              Field.Title,
              SelectionFilter,
              selectionOptionList );
            field.Layout = EuAdapter.DefaultFieldLayout;
            field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );
            break;
          }
        case EvDataTypes.External_CheckBox_List:
          {
            this.LogDebug ( "External_CheckBox_List filter" );
            selectionOptionList = this.getFilteredList_SelectionOptions ( Field, false );

            if ( selectionOptionList.Count == 0 )
            {
              this.LogDebug ( "No CheckBox list options" );
              break;
            }


            var field = PageGroup.createCheckBoxListField (
              EuEntities.CONST_SELECTION_FIELD + FilterIndex,
              Field.Title,
              SelectionFilter,
              selectionOptionList );
            field.Layout = EuAdapter.DefaultFieldLayout;
            field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );

            break;
          }
      }//END switch statment

      this.LogMethodEnd ( "getFilteredList_SelectionField" );
    }//END getFilteredList_SelectionField Query
Пример #2
0
    }//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 getProperties_GeneralPageGroup Method

    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="Page">Evado.UniForm.Model.Page object.</param>
    //  ------------------------------------------------------------------------------
    private void getPropertiesPage_SettingGroup (
      Evado.UniForm.Model.Page Page )
    {
      this.LogMethod ( "getPropertiesPage_SettingGroup" );
      // 
      // Initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( );
      Evado.UniForm.Model.Command pageCommand = new Evado.UniForm.Model.Command ( );
      Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field ( );
      Evado.UniForm.Model.Parameter parameter = new Evado.UniForm.Model.Parameter ( );
      List<EvOption> optionList = new List<EvOption> ( );

      //
      // Define the general properties pageMenuGroup..
      //
      pageGroup = Page.AddGroup (
        EdLabels.Form_Properties_Settings_Group_Title );
      pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;

      pageGroup.SetCommandBackBroundColor (
        Evado.UniForm.Model.GroupParameterList.BG_Mandatory,
        Evado.UniForm.Model.Background_Colours.Red );

      this.GetDataObject_GroupCommands ( pageGroup );

      //
      // Layout field readonly display format settings
      //
      optionList = EvStatics.getOptionsFromEnum ( typeof ( EdRecord.FieldReadonlyDisplayFormats ), false );


      groupField = pageGroup.createSelectionListField (
        EdRecord.FieldNames.FieldReadonlyDisplayFormat.ToString ( ),
        EdLabels.EntityLayout_FieldDisplayFormat_Field_Title,
        this.Session.EntityLayout.Design.FieldReadonlyDisplayFormat,
        optionList );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      //
      // Form Update reason
      //
      optionList = this.AdapterObjects.Settings.GetRoleOptionList ( false );

      groupField = pageGroup.createCheckBoxListField (
        EdRecord.FieldNames.ReadAccessRoles.ToString ( ),
        EdLabels.Record_Layout_AccessRole_Field_Label,
        this.Session.EntityLayout.Design.EditAccessRoles,
        optionList );

      groupField.Layout = EuAdapter.DefaultFieldLayout;
      groupField.EditAccess = this._DesignAccess;


      groupField = pageGroup.createCheckBoxListField (
        EdRecord.FieldNames.EditAccessRoles.ToString ( ),
        EdLabels.Record_Layout_EditRole_Field_Label,
        this.Session.EntityLayout.Design.ReadAccessRoles,
        optionList );

      groupField.Layout = EuAdapter.DefaultFieldLayout;
      groupField.EditAccess = this._DesignAccess;

      //
      // Layout author only draft record access
      //
      optionList = EvStatics.getOptionsFromEnum ( typeof ( EdRecord.AuthorAccessList ), false );

      this.LogDebug ( "Author Access option list length: ", optionList );
      this.LogDebug ( "RecordLayout.Design.AuthorAccess: ", this.Session.EntityLayout.Design.AuthorAccess );

      groupField = pageGroup.createSelectionListField (
        EdRecord.FieldNames.AuthorAccess.ToString ( ),
        EdLabels.Record_Layout_Author_Access_Setting_Field_Title,
        this.Session.EntityLayout.Design.AuthorAccess,
        optionList );
      groupField.Layout = EuAdapter.DefaultFieldLayout;
      groupField.EditAccess = this._DesignAccess;

      //
      // Enable display if chiled entities.
      //
      groupField = pageGroup.createBooleanField (
        EdRecord.FieldNames.DisplayRelatedEntities.ToString ( ),
        EdLabels.EntityLayout_Display_Related_Entities_Field_Title,
        this.Session.EntityLayout.Design.DisplayRelatedEntities );

      groupField.Layout = EuAdapter.DefaultFieldLayout;

      //
      // Layout author only edit record access
      //
      optionList = EvStatics.getOptionsFromEnum ( typeof ( EdRecord.ParentTypeList ), true );

      groupField = pageGroup.createSelectionListField (
        EdRecord.FieldNames.ParentType.ToString ( ),
        EdLabels.Record_Layout_Parent_Object_Type_Field_Title,
        this.Session.EntityLayout.Design.ParentType,
        optionList );
      groupField.Layout = EuAdapter.DefaultFieldLayout;
      groupField.EditAccess = this._DesignAccess;

      //
      // Select the hierachical entities this entity can be referenced to.
      //

      if ( this.Session.EntityLayout.Design.ParentType == EdRecord.ParentTypeList.Entity )
      {
        optionList = this.AdapterObjects.GetIssuedEntityOptions ( false );

        groupField = pageGroup.createCheckBoxListField (
          EdRecord.FieldNames.ParentEntities.ToString ( ),
          EdLabels.Record_Layout_Parent_Entity_Selection_Field_Title,
          this.Session.EntityLayout.Design.ParentEntities,
          optionList );
        groupField.Layout = EuAdapter.DefaultFieldLayout;
      }
      //
      // Default field layout 
      //
      optionList = EvStatics.getOptionsFromEnum ( typeof ( Evado.UniForm.Model.FieldLayoutCodes ), false );

      if ( this.Session.EntityLayout.Design.DefaultPageLayout == null )
      {
        this.Session.EntityLayout.Design.DefaultPageLayout = EuAdapter.DefaultFieldLayout.ToString ( );
      }

      groupField = pageGroup.createSelectionListField (
        EdRecord.FieldNames.DefaultPageLayout.ToString ( ),
        EdLabels.Form_Llink_Default_Layout_Field_Title,
        this.Session.EntityLayout.Design.DefaultPageLayout,
        optionList );

      groupField.Layout = EuAdapter.DefaultFieldLayout;

      //
      // Record LLnk content setting
      //
      optionList = EvStatics.getOptionsFromEnum ( typeof ( EdRecord.LinkContentSetting ), false );

      if ( this.Session.EntityLayout.Design.LinkContentSetting == EdRecord.LinkContentSetting.Null )
      {
        this.Session.EntityLayout.Design.LinkContentSetting = EdRecord.LinkContentSetting.Default;
      }

      groupField = pageGroup.createSelectionListField (
        EdRecord.FieldNames.LinkContentSetting,
        EdLabels.Record_Link_Content_Setting_Field_Title,
        this.Session.EntityLayout.Design.LinkContentSetting,
        optionList );

      groupField.Layout = EuAdapter.DefaultFieldLayout;

      //
      // Record header layout settings
      //
      optionList = EvStatics.getOptionsFromEnum ( typeof ( EdRecord.HeaderFormat ), false );

      if ( this.Session.EntityLayout.Design.HeaderFormat == EdRecord.HeaderFormat.Null )
      {
        this.Session.EntityLayout.Design.HeaderFormat = EdRecord.HeaderFormat.Default;
      }

      groupField = pageGroup.createSelectionListField (
        EdRecord.FieldNames.HeaderFormat,
        EdLabels.RecordLayout_Header_Format_Field_Title,
        this.Session.EntityLayout.Design.HeaderFormat,
        optionList );

      groupField.Layout = EuAdapter.DefaultFieldLayout;

      //
      // Record footer layout settings
      //
      optionList = EvStatics.getOptionsFromEnum ( typeof ( EdRecord.FooterFormat ), false );

      if ( this.Session.EntityLayout.Design.FooterFormat == EdRecord.FooterFormat.Null )
      {
        this.Session.EntityLayout.Design.FooterFormat = EdRecord.FooterFormat.Default;
      }

      groupField = pageGroup.createSelectionListField (
        EdRecord.FieldNames.FooterFormat,
        EdLabels.RecordLayout_Footer_Format_Field_Title,
        this.Session.EntityLayout.Design.FooterFormat,
        optionList );

      groupField.Layout = EuAdapter.DefaultFieldLayout;

      //
      // Form CS Script
      //
      groupField = pageGroup.createBooleanField (
        EdRecord.FieldNames.HasCsScript.ToString ( ),
        EdLabels.Form_Cs_Script_Field_Title,
        this.Session.EntityLayout.Design.hasCsScript );

      groupField.Layout = EuAdapter.DefaultFieldLayout;
      groupField.EditAccess = this._DesignAccess;

      this.LogMethodEnd ( "getPropertiesPage_SettingGroup" );
    }//END getProperties_GeneralPageGroup Method