コード例 #1
0
    }//ENd getFilteredList_SelectionGroup method

    // ==============================================================================
    /// <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="FieldName">EdOrganisation.FieldNames enumerated list value</param>
    //  ------------------------------------------------------------------------------
    private void getQueryList_StaticOrgFilter (
      Evado.UniForm.Model.Group PageGroup,
      EdOrganisation.FieldNames FieldName )
    {
      this.LogMethod ( "getQueryList_StaticOrgFilter" );
      this.LogDebug ( "FieldName: {0}. ", FieldName );
      //
      // Initialise the methods variables and objects.
      //
      List<EvOption> optionList = new List<EvOption> ( );
      optionList.Add ( new EvOption ( ) );

      //
      // Select the field to be displayed.
      //
      switch ( FieldName )
      {
        case EdOrganisation.FieldNames.Address_Country:
          {
            optionList = this.AdapterObjects.GetOrganisationFilterList ( EdOrganisation.FieldNames.Address_Country, true );

            var field = PageGroup.createSelectionListField (
              FieldName,
              EdLabels.Organisation_Address_Country_Field_Label,
              this.Session.SelectedCountry,
              optionList );
            field.Layout = EuAdapter.DefaultFieldLayout;
            field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );
            break;
          }
        case EdOrganisation.FieldNames.Address_Post_Code:
          {
            optionList = this.AdapterObjects.GetOrganisationFilterList ( EdOrganisation.FieldNames.Address_Post_Code, true );

            var field = PageGroup.createSelectionListField (
              FieldName,
              EdLabels.Organisation_Address_PostCode_Field_Label,
              this.Session.SelectedPostCode,
              optionList );
            field.Layout = EuAdapter.DefaultFieldLayout;
            field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );
            break;
          }
        case EdOrganisation.FieldNames.Address_City:
          {
            optionList = this.AdapterObjects.GetOrganisationFilterList ( EdOrganisation.FieldNames.Address_City, true );

            var field = PageGroup.createSelectionListField (
              FieldName,
              EdLabels.Organisation_Address_City_Field_Label,
              this.Session.SelectedCity,
              optionList );
            field.Layout = EuAdapter.DefaultFieldLayout;
            field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );
            break;
          }
      }
      this.LogMethodEnd ( "getQueryList_StaticOrgFilter" );
    }
コード例 #2
0
    // ==============================================================================
    /// <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="FieldName">EdOrganisation.FieldNames enumerated list value</param>
    //  ------------------------------------------------------------------------------
    private void getQueryList_StaticUserFilter (
      Evado.UniForm.Model.Group PageGroup,
      EdUserProfile.FieldNames FieldName )
    {
      this.LogMethod ( "getQueryList_StaticUserFilter" );
      this.LogDebug ( "FieldName: {0}. ", FieldName );
      //
      // Initialise the methods variables and objects.
      //
      String userSelectionList = this.AdapterObjects.Settings.UserCategoryList;
      List<EvOption> optionList = new List<EvOption> ( );
      optionList.Add ( new EvOption ( ) );

      //
      // Select the field to be displayed.
      //
      switch ( FieldName )
      {
        case EdUserProfile.FieldNames.User_Category:
          {
            optionList = this.AdapterObjects.getSelectionOptions ( userSelectionList, String.Empty, true, true );

            var field = PageGroup.createSelectionListField (
              FieldName,
              EdLabels.UserProfile_User_Category_Field_Label,
              this.Session.SelectedUserCategory,
              optionList );
            field.Layout = EuAdapter.DefaultFieldLayout;
            field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );
            break;
          }
        case EdUserProfile.FieldNames.User_Type:
          {
            optionList = this.AdapterObjects.getSelectionOptions ( userSelectionList, String.Empty, false, true );

            var field = PageGroup.createSelectionListField (
              FieldName,
              EdLabels.UserProfile_User_Type_Field_Label,
              this.Session.SelectedUserType,
              optionList );
            field.Layout = EuAdapter.DefaultFieldLayout;
            field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );
            break;
          }
      }
      this.LogMethodEnd ( "getQueryList_StaticUserFilter" );
    }
コード例 #3
0
    }//END getOrganisationList method.

    // ==================================================================================
    /// <summary>
    /// This methods returns a pageMenuGroup object contains a selection of organisations.
    /// </summary>
    /// <param name="PageObject">Application</param>
    /// <returns>Evado.UniForm.Model.Group object</returns>
    //  ---------------------------------------------------------------------------------
    public void getOrganisationSelection (
      Evado.UniForm.Model.Page PageObject )
    {
      this.LogMethod ( "getOrganisationSelection" );

      // 
      // initialise the methods variables and objects.
      // 
      List<Evado.Model.EvOption> optionList = new List<Evado.Model.EvOption> ( );
      Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field ( );

      Evado.UniForm.Model.Group pageGroup = PageObject.AddGroup (
        EdLabels.Organisation_List_Selection_Group,
        Evado.UniForm.Model.EditAccess.Enabled );
      pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;

      //
      // get the list of organisations.
      //
      optionList = this.AdapterObjects.Settings.GetOrgTypeList ( true );

      // 
      // Set the selection to the current site org id.
      // 
      groupField = pageGroup.createSelectionListField (
        EdOrganisation.FieldNames.Org_Type,
        EdLabels.Config_OrgType_List_Field_Label,
        this.Session.SelectedOrganisationType.ToString ( ),
        optionList );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );

      // 
      // Create a custom groupCommand to process the selection.
      // 
      Evado.UniForm.Model.Command customCommand = pageGroup.addCommand (
        EdLabels.Organisation_Selection_Command_Title,
        EuAdapter.ADAPTER_ID,
        EuAdapterClasses.Organisations.ToString ( ),
        Evado.UniForm.Model.ApplicationMethods.Custom_Method );

      // 
      // Set the custom groupCommand parameter.
      // 
      customCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.List_of_Objects );


      this.LogMethodEnd ( "getOrganisationSelection" );

    }//END getOrganisationSelection method
コード例 #4
0
    }//END getDataObject_GroupCommands Method

    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="PageObject">Evado.UniForm.Model.AppData object.</param>
    /// <returns>ClientApplicationData object</returns>
    //  ------------------------------------------------------------------------------
    private void getDataObject_DetailsGroup (
      Evado.UniForm.Model.Page PageObject )
    {
      this.LogMethod ( "getDataObject_DetailsGroup" );
      // 
      // Initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.Field pageField = new Evado.UniForm.Model.Field ( );
      List<EvOption> optionList = new List<EvOption> ( );
      Evado.UniForm.Model.EditAccess adminAccess = Evado.UniForm.Model.EditAccess.Disabled;

      if ( this.Session.UserProfile.hasAdministrationAccess == true )
      {
        adminAccess = Evado.UniForm.Model.EditAccess.Enabled;
      }

      // 
      // create the page pageMenuGroup
      // 
      Evado.UniForm.Model.Group pageGroup = PageObject.AddGroup (
        String.Empty );
      pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;
      pageGroup.EditAccess = Evado.UniForm.Model.EditAccess.Enabled;

      //
      // Add the group commands
      //
      this.getDataObject_GroupCommands ( pageGroup );

      // 
      // Create the customer id object
      // 
      pageField = pageGroup.createTextField (
        EdOrganisation.FieldNames.OrgId.ToString ( ),
        EdLabels.Label_Organisation_Id,
        String.Empty,
        this.Session.AdminOrganisation.OrgId, 10 );
      pageField.EditAccess = Evado.UniForm.Model.EditAccess.Disabled;
      pageField.Layout = EuAdapter.DefaultFieldLayout;
      pageField.EditAccess = adminAccess;

      //
      // get the org type selection list.
      //
      optionList = this.AdapterObjects.Settings.GetOrgTypeList ( true );

      //
      // Generate the organisation type radio button list field object.
      //
      pageField = pageGroup.createSelectionListField (
        EdOrganisation.FieldNames.Org_Type.ToString ( ),
        EdLabels.Organisation_Type_Field_Label,
        EdLabels.Organisation_Type_Field_Description,
        this.Session.AdminOrganisation.OrgType,
        optionList );
      pageField.Layout = EuAdapter.DefaultFieldLayout;
      pageField.Mandatory = true;
      pageField.EditAccess = adminAccess;

      if ( this.Session.AdminOrganisation.OrgType == String.Empty )
      {
        pageField.setBackgroundColor (
          Evado.UniForm.Model.FieldParameterList.BG_Mandatory,
          Evado.UniForm.Model.Background_Colours.Red );
      }

      // 
      // Create the customer name object
      // 
      pageField = pageGroup.createTextField (
        EdOrganisation.FieldNames.Name.ToString ( ),
        EdLabels.Organisation_Name_Field_Label,
        this.Session.AdminOrganisation.Name,
        50 );
      pageField.Layout = EuAdapter.DefaultFieldLayout;
      pageField.Mandatory = true;

      pageField.setBackgroundColor (
        Evado.UniForm.Model.FieldParameterList.BG_Mandatory,
        Evado.UniForm.Model.Background_Colours.Red );

      // 
      // Create the customer name object
      //
      if ( this.AdapterObjects.Settings.hasHiddenOrganisationField ( EdOrganisation.FieldNames.Image_File_Name ) == false )
      {
        pageField = pageGroup.createImageField (
          EdOrganisation.FieldNames.Image_File_Name.ToString ( ),
          EdLabels.Organisation_ImageFileame_Field_Label,
          this.Session.AdminOrganisation.ImageFileName,
          300, 200 );
        pageField.Layout = EuAdapter.DefaultFieldLayout;

        try
        {
          String stTargetPath = this.UniForm_BinaryFilePath + this.Session.AdminOrganisation.ImageFileName;
          String stImagePath = this.UniForm_ImageFilePath + this.Session.AdminOrganisation.ImageFileName;

          this.LogDebug ( "Target path {0}.", stTargetPath );
          this.LogDebug ( "Image path {0}.", stImagePath );

          //
          // copy the file into the image directory.
          //
          System.IO.File.Copy ( stImagePath, stTargetPath, true );
        }
        catch { }
      }
      else
      {
        this.Session.Organisation.ImageFileName = String.Empty;
      }

      // 
      // Create the street address 1
      //
      if ( this.AdapterObjects.Settings.hasHiddenOrganisationField (
        EdOrganisation.FieldNames.Address_1 ) == false )
      {
        pageField = pageGroup.createTextField (
          EdOrganisation.FieldNames.Address_1,
          EdLabels.Organisation_Address_Street_Field_Label,
          this.Session.AdminOrganisation.AddressStreet_1, 50 );
        pageField.Layout = EuAdapter.DefaultFieldLayout;

        // 
        // Create the street address 2
        // 
        pageField = pageGroup.createTextField (
          EdOrganisation.FieldNames.Address_2,
          EdLabels.Organisation_Address_Street_Field_Label,
          this.Session.AdminOrganisation.AddressStreet_2, 50 );
        pageField.Layout = EuAdapter.DefaultFieldLayout;
      }

      // 
      // Create the street address city
      // 
      if ( this.AdapterObjects.Settings.hasHiddenOrganisationField (
        EdOrganisation.FieldNames.Address_City ) == false )
      {
        pageField = pageGroup.createTextField (
          EdOrganisation.FieldNames.Address_City,
          EdLabels.Organisation_Address_City_Field_Label,
          this.Session.AdminOrganisation.AddressCity, 50 );
        pageField.Layout = EuAdapter.DefaultFieldLayout;
      }

      // 
      // Create the street address state
      // 
      if ( this.AdapterObjects.Settings.hasHiddenOrganisationField (
        EdOrganisation.FieldNames.Address_State ) == false )
      {
        pageField = pageGroup.createTextField (
          EdOrganisation.FieldNames.Address_State,
          EdLabels.Organisation_Address_State_Field_Label,
          this.Session.AdminOrganisation.AddressState, 10 );
        pageField.Layout = EuAdapter.DefaultFieldLayout;
      }

      // 
      // Create the street address 1
      // 
      if ( this.AdapterObjects.Settings.hasHiddenOrganisationField (
        EdOrganisation.FieldNames.Address_Post_Code ) == false )
      {
        pageField = pageGroup.createTextField (
          EdOrganisation.FieldNames.Address_Post_Code,
          EdLabels.Organisation_Address_City_Field_Label,
          this.Session.AdminOrganisation.AddressPostCode, 50 );
        pageField.Layout = EuAdapter.DefaultFieldLayout;
      }

      // 
      // Create the street address 1
      // 
      if ( this.AdapterObjects.Settings.hasHiddenOrganisationField (
        EdOrganisation.FieldNames.Address_Country ) == false )
      {
        pageField = pageGroup.createTextField (
          EdOrganisation.FieldNames.Address_Country,
          EdLabels.Organisation_Address_Country_Field_Label,
          this.Session.AdminOrganisation.AddressCountry, 50 );
        pageField.Layout = EuAdapter.DefaultFieldLayout;
      }

      // 
      // Create the organisation telephone number object
      // 
      if ( this.AdapterObjects.Settings.hasHiddenOrganisationField (
        EdOrganisation.FieldNames.Telephone ) == false )
      {
        pageField = pageGroup.createTelephoneNumberField (
          EdOrganisation.FieldNames.Telephone.ToString ( ),
          EdLabels.Organisation_Telephone_Field_Label,
          this.Session.AdminOrganisation.Telephone );
        pageField.Layout = EuAdapter.DefaultFieldLayout;
      }

      // 
      // Create the organisation fax number object
      // 
      if ( this.AdapterObjects.Settings.hasHiddenOrganisationField (
        EdOrganisation.FieldNames.Email_Address ) == false )
      {
        pageField = pageGroup.createEmailAddressField (
          EdOrganisation.FieldNames.Email_Address.ToString ( ),
          EdLabels.Organisation_Email_Field_Label,
          this.Session.AdminOrganisation.EmailAddress );
        pageField.Layout = EuAdapter.DefaultFieldLayout;
      }

      this.LogMethodEnd ( "getDataObject_DetailsGroup" );

    }//END getDataObject_DetailsGroup Method
コード例 #5
0
    }//END method

    // ==================================================================================
    /// <summary>
    /// This methods returns a pageMenuGroup object contains a selection of applicationEvents.
    /// </summary>
    /// <param name="PageObject">Evado.UniForm.Model.Page object</param>
    /// <returns>Evado.UniForm.Model.Group object</returns>
    //  ---------------------------------------------------------------------------------
    public void getSelectionGroup (
      Evado.UniForm.Model.Page PageObject )
    {
      this.LogMethod ( "getSelectionGroup" );

      this.LogValue ( "EventStartDate: " + this.Session.EventStartDate );
      this.LogValue ( "EventFinishDate: " + this.Session.EventFinishDate );

      // 
      // initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field ( );
      DateTime rangeStartDate = EvStatics.getDateTime ( "1 jan 2020" );
      DateTime rangeFinishDate = DateTime.Now.AddDays ( 1 );

      //
      // create the selection group.
      //
      Evado.UniForm.Model.Group selectionGroup = PageObject.AddGroup (
        EdLabels.ApplicationEvent_Selection_Group_Title,
        Evado.UniForm.Model.EditAccess.Enabled );
      selectionGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;

      // 
      // Set the selection to the start date
      // 
      groupField = selectionGroup.createDateField (
        EuApplicationEvents.CONST_START_DATE_FIELD_ID,
        EdLabels.ApplicationEvent_Start_Date_Selection_Field_Label,
        this.Session.EventStartDate,
        rangeStartDate, rangeFinishDate );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );

      // 
      // Set the selection to the start date
      // 
      groupField = selectionGroup.createDateField (
        EuApplicationEvents.CONST_FINISH_DATE_FIELD_ID,
        EdLabels.ApplicationEvent_Finish_Date_Selection_Field_Label,
        this.Session.EventFinishDate,
        rangeStartDate, rangeFinishDate );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );

      //
      // get the list of event codes.
      //
      if ( this.AdapterObjects.EventCodeSelectionList.Count == 0 )
      {
        this.AdapterObjects.EventCodeSelectionList = Evado.Model.EvStatics.getOptionsFromEnum ( typeof ( EvEventCodes ), true );

        Evado.Digital.Model.EvcStatics.sortOptionListValues ( this.AdapterObjects.EventCodeSelectionList );
      }

      // 
      // Set the selection to the event id
      // 
      groupField = selectionGroup.createSelectionListField (
        EuApplicationEvents.CONST_EVENT_FIELD_ID,
        EdLabels.ApplicationEvent_Event_Id_Selection_Field_Label,
        this.Session.EventId.ToString ( ),
        this.AdapterObjects.EventCodeSelectionList );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );


      //
      // get the list of event ids.
      //
      List<EvOption> optionList = Evado.Model.EvStatics.getOptionsFromEnum ( typeof ( EvApplicationEvent.EventType ), true );
      // 
      // Set the selection to the type id
      // 
      groupField = selectionGroup.createSelectionListField (
        EuApplicationEvents.CONST_TYPE_FIELD_ID,
        EdLabels.ApplicationEvent_Type_Selection_Field_Label,
        this.Session.EventType,
        optionList );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );

      // 
      // Set the selection to the USER Name
      // 
      Evado.Digital.Model.EvcStatics.sortOptionListValues ( this.Session.EventUserSelectionList );

      groupField = selectionGroup.createSelectionListField (
        EuApplicationEvents.CONST_USER_FIELD_ID,
        EdLabels.ApplicationEvent_UserName_Selection_Field_Label,
        this.Session.EventUserName,
        this.Session.EventUserSelectionList );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );


      // 
      // Create a custom groupCommand to process the selection.
      // 
      Evado.UniForm.Model.Command customCommand = selectionGroup.addCommand (
        EdLabels.ApplicationEvent_Selection_Command_Title,
        EuAdapter.ADAPTER_ID,
        EuAdapterClasses.Events.ToString ( ),
        Evado.UniForm.Model.ApplicationMethods.Custom_Method );

      // 
      // Set the custom groupCommand parameter.
      // 
      customCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.List_of_Objects );

    }//END getSelectionGroup method
コード例 #6
0
    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="ClientDataObject">Evado.UniForm.Model.AppData object.</param>
    /// <returns>ClientApplicationData object</returns>
    //  ------------------------------------------------------------------------------
    private void getClientData (
      Evado.UniForm.Model.AppData ClientDataObject )
    {
      this.LogMethod ( "getDataObject" );
      // 
      // Initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.Command pageCommand = new Evado.UniForm.Model.Command ( );
      Evado.UniForm.Model.Field pageField = new Evado.UniForm.Model.Field ( );
      List<EvOption> optionList = new List<EvOption> ( );
      EvOption option = new EvOption ( );

      ClientDataObject.Id = this.Session.MenuItem.Guid;
      ClientDataObject.Title = EdLabels.Menu_Item;

      ClientDataObject.Page.Id = ClientDataObject.Id;
      ClientDataObject.Page.Title = ClientDataObject.Title;
      ClientDataObject.Page.EditAccess = Evado.UniForm.Model.EditAccess.Enabled;

      // 
      // create the page pageMenuGroup
      // 
      Evado.UniForm.Model.Group pageGroup = ClientDataObject.Page.AddGroup (
        EdLabels.Menu_General_Group_Title,
        Evado.UniForm.Model.EditAccess.Inherited );
      pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;

      //
      // Add the platform selection list
      //

      optionList.Add ( new EvOption (
        EuMenus.CONST_ADMIN_APPLICATION_IDENTIFIER,
        EdLabels.Menu_Admin_Platform_Option_Description ) );

      optionList.Add ( new EvOption (
        EuMenus.CONST_PRODUCTION_APPLICATION_IDENTIFIER,
        EdLabels.Menu_Production_Platform_Option_Description ) );

      pageField = pageGroup.createSelectionListField (
        String.Empty,
        EdLabels.Menu_Platform_Field_Label,
        this.Session.MenuPlatformId,
        optionList );
      pageField.EditAccess = Evado.UniForm.Model.EditAccess.Disabled;

      // 
      // Create the customer id object
      // 
      optionList = this.AdapterObjects.PageIdentifiers;

      Evado.Digital.Model.EvcStatics.sortOptionListValues ( optionList );

      pageField = pageGroup.createSelectionListField (
        EvMenuItem.MenuFieldNames.Page_Id.ToString ( ),
        EdLabels.Menu_Page_Id_Field_Label,
        this.Session.MenuItem.PageId.ToString ( ),
        optionList );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create the customer name object
      // 
      pageField = pageGroup.createTextField (
        EvMenuItem.MenuFieldNames.Title.ToString ( ),
        EdLabels.Menu_Title_Field_Label,
        String.Empty,
        this.Session.MenuItem.Title,
        20 );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create the customer name object
      // 
      pageField = pageGroup.createNumericField (
        EvMenuItem.MenuFieldNames.Order.ToString ( ),
        EdLabels.Menu_Order_Field_Label,
        this.Session.MenuItem.Order,
        0,
        200 );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create the customer name object
      // 
      optionList = this.AdapterObjects.Settings.GetRoleOptionList ( false );
      string roles = this.Session.MenuItem.RoleList;

      pageField = pageGroup.createCheckBoxListField (
        EvMenuItem.MenuFieldNames.Role_List.ToString ( ),
        EdLabels.Menu_Role_List_Field_Label,
        roles,
        optionList );

      pageField.Layout = EuAdapter.DefaultFieldLayout;

      pageField.Description = EdLabels.Menu_Role_List_Field_Description;

      // 
      // Create the customer name object
      // 
      pageField = pageGroup.createTextField (
        EvMenuItem.MenuFieldNames.Parameters.ToString ( ),
        EdLabels.Menu_Parameters_Field_Label,
        String.Empty,
        this.Session.MenuItem.Parameters,
        20 );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Add the save groupCommand
      // 
      pageCommand = pageGroup.addCommand (
        EdLabels.Menu_Save_Command_Title,
        EuAdapter.ADAPTER_ID,
        EuAdapterClasses.Menu.ToString ( ),
        Evado.UniForm.Model.ApplicationMethods.Save_Object );

      // 
      // Define the save and delete groupCommand parameters
      // 
      pageCommand.SetGuid ( ClientDataObject.Id );

      //
      // Add the delete groupCommand object.
      //
      pageCommand = pageGroup.addCommand (
         EdLabels.Menu_Delete_Command_Title,
         EuAdapter.ADAPTER_ID,
         EuAdapterClasses.Menu.ToString ( ),
         Evado.UniForm.Model.ApplicationMethods.Save_Object );

      // 
      // Define the save and delete groupCommand parameters
      // 
      pageCommand.SetGuid ( ClientDataObject.Id );

      pageCommand.AddParameter ( Evado.Digital.Model.EvcStatics.CONST_SAVE_ACTION, EuMenus.CONST_DELETE_ACTION );

    }//END Method
コード例 #7
0
    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="PageObject">Evado.UniForm.Model.Page object.</param>
    /// <returns>ClientApplicationData object</returns>
    //  ------------------------------------------------------------------------------
    private void getSelectionListGroup ( Evado.UniForm.Model.Page PageObject )
    {
      this.LogMethod ( "getSelectionListGroup" );
      // 
      // Initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.Field pageField = new Evado.UniForm.Model.Field ( );
      List<EvOption> optionList = new List<EvOption> ( );
      EvOption option = new EvOption ( );

      //
      // Define the selection group object.
      //
      Evado.UniForm.Model.Group pageGroup = PageObject.AddGroup (
        EdLabels.Menu_Selection,
        Evado.UniForm.Model.EditAccess.Enabled );
      pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;

      //
      // Add the platform selection list
      //
      optionList.Add ( new EvOption (
        EuMenus.CONST_ADMIN_APPLICATION_IDENTIFIER,
        EdLabels.Menu_Admin_Platform_Option_Description ) );

      optionList.Add ( new EvOption (
        EuMenus.CONST_PRODUCTION_APPLICATION_IDENTIFIER,
        EdLabels.Menu_Production_Platform_Option_Description ) );

      pageField = pageGroup.createSelectionListField (
        EvMenuItem.MenuFieldNames.Platform.ToString ( ),
        EdLabels.Menu_Platform_Field_Label,
        this.Session.MenuPlatformId,
        optionList );
      pageField.Layout = EuAdapter.DefaultFieldLayout;
      pageField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );

      // 
      // Create the pageMenuGroup selection list.
      // 
      List<Evado.Model.EvOption> groupList = this.GetGroupList ( );

      if ( groupList.Count > 1 )
      {
        pageField = pageGroup.createSelectionListField (
          EuSession.CONST_MENU_GROUP_ID,
          EdLabels.Menu_Group_ID,
          this.Session.MenuGroupIdentifier,
          groupList );
        pageField.Layout = EuAdapter.DefaultFieldLayout;
        pageField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );
      }

      //
      // Add the selection command
      //
      Evado.UniForm.Model.Command selectionCommand = pageGroup.addCommand (
        EdLabels.Menu_Selection_Menu,
        EuAdapter.ADAPTER_ID,
        EuAdapterClasses.Menu.ToString ( ),
        Evado.UniForm.Model.ApplicationMethods.Custom_Method );

      // 
      // Set the custom groupCommand parametet.
      // 
      selectionCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.List_of_Objects );

    }
コード例 #8
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
コード例 #9
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="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
コード例 #10
0
    // ==============================================================================
    /// <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
コード例 #11
0
    // ==============================================================================
    /// <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
コード例 #12
0
    }//END getFormPropertiesObject method

    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="ClientDataObject">Evado.UniForm.Model.AppData object.</param>
    //  ------------------------------------------------------------------------------
    private void getPropertiesSectionDataObject (
      Evado.UniForm.Model.AppData ClientDataObject )
    {
      this.LogMethod ( "getPropertiesSectionDataObject" );
      this.LogDebug ( "FormSection.No: " + this.Session.FormSection.No );
      this.LogDebug ( "FormSection.Title: " + this.Session.FormSection.Title );
      this.LogDebug ( "FormSection.DisplayRoles: " + this.Session.FormSection.ReadAccessRoles );
      this.LogDebug ( "FormSection.EditRoles: " + this.Session.FormSection.EditAccessRoles );
      this.LogDebug ( "HasConfigrationEditAccess: " + this.Session.UserProfile.hasManagementAccess );
      // 
      // 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 pageField = new Evado.UniForm.Model.Field ( );
      Evado.UniForm.Model.Parameter parameter = new Evado.UniForm.Model.Parameter ( );
      List<EvOption> optionList = new List<EvOption> ( );
      optionList.Add ( new EvOption ( ) );

      foreach ( EdRecordField field in this.Session.EntityLayout.Fields )
      {
        optionList.Add ( new EvOption (
          field.FieldId,
          field.FieldId
          + EdLabels.Space_Hypen
          + field.Title ) );
      }

      // 
      // Initialise the client ResultData object.
      // 
      if ( this.Session.EntityLayout.Guid != Guid.Empty )
      {
        ClientDataObject.Id = Guid.NewGuid ( );
        ClientDataObject.Title =
          String.Format (
          EdLabels.FormProperties_Section_Page_Title,
          this.Session.EntityLayout.LayoutId,
          this.Session.EntityLayout.Title,
          this.Session.FormSection.LinkText );
        ClientDataObject.Page.Id = ClientDataObject.Id;
        ClientDataObject.Page.PageDataGuid = ClientDataObject.Id;
        ClientDataObject.Page.PageId = this.Session.EntityLayout.LayoutId;
      }
      else
      {
        ClientDataObject.Id = Guid.NewGuid ( );
        ClientDataObject.Title = EdLabels.Form_Page_New_Form_Title;
        ClientDataObject.Page.Id = ClientDataObject.Id;
        ClientDataObject.Page.PageDataGuid = ClientDataObject.Id;
      }
      ClientDataObject.Page.EditAccess = Evado.UniForm.Model.EditAccess.Enabled;

      if ( this.Session.UserProfile.hasManagementAccess == true )
      {
        ClientDataObject.Page.EditAccess = Evado.UniForm.Model.EditAccess.Enabled;
      }

      if ( this.Session.EntityLayout.State != EdRecordObjectStates.Form_Issued
        && this.Session.EntityLayout.State != EdRecordObjectStates.Withdrawn )
      {
        ClientDataObject.Page.EditAccess = Evado.UniForm.Model.EditAccess.Disabled;
      }

      //
      // Set the user's edit access if they have configuration edit access.
      //


      if ( this.Session.UserProfile.hasManagementAccess == true )
      {
        ClientDataObject.Page.EditAccess = Evado.UniForm.Model.EditAccess.Enabled;
      }

      pageGroup = ClientDataObject.Page.AddGroup (
        EdLabels.FormProperties_Section_Group_Text,
        Evado.UniForm.Model.EditAccess.Inherited );
      pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;

      //
      // Form No
      //
      pageField = pageGroup.createTextField (
        EdRecordSection.FormSectionClassFieldNames.Sectn_No.ToString ( ),
        EdLabels.Form_Section_No_Field_Label,
        this.Session.FormSection.No.ToString ( ),
        50 );
      pageField.Layout = EuAdapter.DefaultFieldLayout;
      pageField.EditAccess = Evado.UniForm.Model.EditAccess.Enabled;

      //
      // Form title
      //
      pageField = pageGroup.createTextField (
        EdRecordSection.FormSectionClassFieldNames.Sectn_Title.ToString ( ),
        EdLabels.Form_Section_Title_Field_Label,
        this.Session.FormSection.Title,
        50 );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      //
      // Form Instructions
      //
      pageField = pageGroup.createFreeTextField (
        EdRecordSection.FormSectionClassFieldNames.Sectn_Instructions.ToString ( ),
        EdLabels.Form_Section_Instructions_Field_Label,
        EdLabels.Form_Section_Instructions_Field_Description,
        this.Session.FormSection.Instructions,
        90, 5 );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      optionList = new List<EvOption> ( );

      this.LogDebug ( "FormSection.Order: " + this.Session.FormSection.Order );
      foreach ( EdRecordSection section in this.Session.EntityLayout.Design.FormSections )
      {
        if ( section.Order < this.Session.FormSection.Order )
        {
          this.LogDebug ( "secttion.Order: " + section.Order + " BEFORE SECTION" );

          var value = String.Format ( EdLabels.Form_Section_Order_Before_Text, section.Title );
          optionList.Add ( new EvOption ( ( section.Order - 1 ).ToString ( ), value ) );
        }
        if ( section.Order == this.Session.FormSection.Order )
        {
          this.LogDebug ( "secttion.Order: " + section.Order + " CURRENT" );
          optionList.Add ( new EvOption (
            this.Session.FormSection.Order.ToString ( ),
            this.Session.FormSection.Title ) );
        }
        if ( section.Order > this.Session.FormSection.Order )
        {
          this.LogDebug ( "secttion.Order: " + section.Order + " AFTER SECTION" );
          var value = String.Format ( EdLabels.Form_Section_Order_After_Text, section.Title );
          optionList.Add ( new EvOption ( ( section.Order + 1 ).ToString ( ), value ) );
        }
      }

      //
      // The form section order 
      //
      pageField = pageGroup.createSelectionListField (
        EdRecordSection.FormSectionClassFieldNames.Sectn_Order.ToString ( ),
        EdLabels.Form_Section_Order_Field_Label,
        this.Session.FormSection.Order.ToString ( ),
        optionList );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      /*
      //
      // The form section field id 
      //
      pageField = pageGroup.createSelectionListField (
        EvFormSection.FormSectionClassFieldNames.Sectn_Field_Id.ToString ( ),
        EdLabels.Form_Section_Field_ID_Field_Label,
        this.SessionObjects.FormSection.FieldId,
        optionList );
      pageField.Layout = EuPageGenerator.ApplicationFieldLayout;

      //
      // Form Field value
      //
      pageField = pageGroup.createTextField (
        EvFormSection.FormSectionClassFieldNames.Sectn_Field_Value.ToString ( ),
        EdLabels.Form_Section_Field_Value_Field_Label,
        this.SessionObjects.FormSection.FieldValue,
        50 );
      pageField.Layout = EuPageGenerator.ApplicationFieldLayout;
      pageField.EditAccess = Evado.UniForm.Model.EditAccess.Inherited;

      //
      // form secton on open display section.
      //
      pageField = pageGroup.createBooleanField (
        EvFormSection.FormSectionClassFieldNames.Sectn_On_Open_Visible.ToString ( ),
        EdLabels.Form_Section_Visible_On_Open_Field_Label,
        this.SessionObjects.FormSection.OnOpenVisible );
      pageField.Layout = EuPageGenerator.ApplicationFieldLayout;

      //
      // Form on field value match display field field
      //
      pageField = pageGroup.createBooleanField (
        EvFormSection.FormSectionClassFieldNames.Sectn_On_Match_Visible.ToString ( ),
        EdLabels.Form_Section_Visible_Field_Value_Matches_Field_Label,
        this.SessionObjects.FormSection.OnMatchVisible );
      pageField.Layout = EuPageGenerator.ApplicationFieldLayout;
      */
      //
      // get the list of display roles.
      //
      optionList = new List<EvOption> ( );

      optionList = this.AdapterObjects.Settings.GetRoleOptionList ( false );

      //
      // The form section user display roles 
      //
      pageField = pageGroup.createCheckBoxListField (
        EdRecordSection.FormSectionClassFieldNames.Sectn_Display_Roles.ToString ( ),
        EdLabels.Form_Section_User_Display_Roles_Field_Label,
        EdLabels.Form_Section_User_Display_Roles_Field_Description,
        this.Session.FormSection.ReadAccessRoles,
        optionList );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      //
      // get the list of edit roles.
      //
      pageField = pageGroup.createCheckBoxListField (
        EdRecordSection.FormSectionClassFieldNames.Sectn_Edit_Roles.ToString ( ),
        EdLabels.Form_Section_User_Edit_Roles_Field_Label,
        EdLabels.Form_Section_User_Edit_Roles_Field_Description,
        this.Session.FormSection.EditAccessRoles,
        optionList );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      //
      // Add the command to save the page content.
      //
      pageCommand = pageGroup.addCommand (
        EdLabels.Form_Properties_Section_Save_Command_Title,
        EuAdapter.ADAPTER_ID,
        EuAdapterClasses.Entity_Layouts.ToString ( ),
        Evado.UniForm.Model.ApplicationMethods.Custom_Method );

      pageCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.Form_Properties_Page );
      pageCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.Get_Object );
      pageCommand.SetGuid ( this.Session.EntityLayout.Guid );
      pageCommand.AddParameter ( EuRecordLayouts.CONST_UPDATE_SECTION_COMMAND_PARAMETER, "1" );


    }//END getPropertiesDataObject Method
コード例 #13
0
    }//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
コード例 #14
0
    }//END getPropertiesDataObject Method

    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="Page">Evado.UniForm.Model.Page object.</param>
    //  ------------------------------------------------------------------------------
    private void getPropertiesPage_GeneralGroup (
      Evado.UniForm.Model.Page Page )
    {
      this.LogMethod ( "getProperties_GeneralPageGroup" );
      // 
      // 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_General_Group_Title);
      pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;

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

      //
      // Define the form save commands.
      //
      this.GetDataObject_GroupCommands ( pageGroup );

      //
      // Define the page layout selection
      //
      this.GetDataObject_LayoutCommands ( pageGroup );

      //
      // Set the entity type
      //
      if ( this.Session.EntityLayout.Design.TypeId == EdRecordTypes.Null )
      {
        this.Session.EntityLayout.Design.TypeId = EdRecordTypes.Normal_Record;
      }

      //
      // Form title
      //
      groupField = pageGroup.createTextField (
        EdRecord.FieldNames.Layout_Id.ToString ( ),
        EdLabels.Label_Form_Id,
        this.Session.EntityLayout.LayoutId,
        10 );
      groupField.Layout = EuAdapter.DefaultFieldLayout;
      groupField.EditAccess = this._InitialAccess;

      //
      // Form title
      //
      groupField = pageGroup.createTextField (
        EdRecord.FieldNames.RecordPrefix,
        EdLabels.Record_Layout_Record_Prefix_Field_Label,
        this.Session.EntityLayout.Design.RecordPrefix,
        5 );
      groupField.Layout = EuAdapter.DefaultFieldLayout;
      groupField.EditAccess = this._InitialAccess;

      //
      // Form title
      //
      groupField = pageGroup.createTextField (
        EdRecord.FieldNames.Object_Title.ToString ( ),
        EdLabels.Form_Title_Field_Label,
        this.Session.EntityLayout.Design.Title,
        50 );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      //
      // Form reference
      //
      groupField = pageGroup.createTextField (
        EdRecord.FieldNames.Reference.ToString ( ),
        EdLabels.Form_Reference_Field_Label,
        this.Session.EntityLayout.Design.HttpReference,
        50 );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      //
      // Form Instructions
      //
      groupField = pageGroup.createFreeTextField (
        EdRecord.FieldNames.Instructions.ToString ( ),
        EdLabels.Form_Instructions_Field_Title,
        this.Session.EntityLayout.Design.Instructions,
        50, 4 );
      groupField.Layout = EuAdapter.DefaultFieldLayout;


      //
      // Form category
      //
      groupField = pageGroup.createTextField (
        EdRecord.FieldNames.FormCategory.ToString ( ),
        EdLabels.Form_Category_Field_Title,
        this.Session.EntityLayout.Design.RecordCategory,
        50 );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      //
      // Form Update reason
      //
      optionList = EvStatics.getOptionsFromEnum ( typeof ( EdRecord.UpdateReasonList ), false );

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

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

      //
      // Form Change description
      //
      groupField = pageGroup.createFreeTextField (
        EdRecord.FieldNames.Description.ToString ( ),
        EdLabels.Form_Description_Field_Title,
        this.Session.EntityLayout.Design.Description,
        90, 5 );

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


    }//END getProperties_GeneralPageGroup Method