}//END getObject method

    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="ClientDataObject">Evado.UniForm.Model.AppData object.</param>
    //  ------------------------------------------------------------------------------
    private void getDataObject_MUP_Page (
      Evado.UniForm.Model.AppData ClientDataObject )
    {
      this.LogMethod ( "getDataObject_MUP_Page" );
      // 
      // 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 ( );
      Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( );
      //
      // set the client ResultData object properties
      //
      ClientDataObject.Id = this.Session.UserProfile.Guid;
      ClientDataObject.Page.Id = this.Session.UserProfile.Guid;
      ClientDataObject.Title = EdLabels.User_Profile_Page_Title
        + this.Session.UserProfile.CommonName;

      ClientDataObject.Page.Title = ClientDataObject.Title;
      ClientDataObject.Page.PageId = Evado.Digital.Model.EdStaticPageIds.User_Profile_Page.ToString ( );
      ClientDataObject.Page.EditAccess = Evado.UniForm.Model.EditAccess.Enabled;

      this.LogDebug ( "clientDataObject status: " + ClientDataObject.Page.EditAccess );

      this.getDataObject_MUP_GeneralGroup ( ClientDataObject.Page );

      this.getDataObject_MUP_DetailsGroup ( ClientDataObject.Page );

      this.getDataObject_MUP_OrganisationGroup ( ClientDataObject.Page );

      this.getDataObject_MUP_PersonaliseGroup ( ClientDataObject.Page );

      this.LogMethodEnd ( "getDataObject_MUP_Page" );

    }//END getclientDataObject Method
    }//END getclientDataObject Method

    // ==============================================================================
    /// <summary>
    /// This method adds the user generation group.
    /// </summary>
    /// <param name="Page">Evado.UniForm.Model.Page object.</param>
    //  ------------------------------------------------------------------------------
    private void getDataObject_MUP_GeneralGroup (
      Evado.UniForm.Model.Page Page )
    {
      this.LogMethod ( "getDataObject_MUP_GeneralGroup" );
      // 
      // Initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field ( );
      Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( );
      Evado.UniForm.Model.Command groupCommand = new Evado.UniForm.Model.Command ( );
      List<EvOption> optionList = new List<EvOption> ( );

      // 
      // create the page pageMenuGroup
      // 
      pageGroup = Page.AddGroup (
        EdLabels.UserProfile_General_Field_Group_Title );
      pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;
      pageGroup.EditAccess = Evado.UniForm.Model.EditAccess.Disabled;

      // 
      // Create the user id object
      // 
      groupField = pageGroup.createTextField (
         String.Empty,
        EdLabels.User_Profile_Identifier_Field_Label,
        this.Session.UserProfile.UserId,
        80 );
      groupField.Layout = EuAdapter.DefaultFieldLayout;
      groupField.EditAccess = Evado.UniForm.Model.EditAccess.Enabled;


      this.LogMethodEnd ( "getDataObject_MUP_GeneralGroup" );

    }//END getDataObject_MUP_GeneralGroup Method
    }//END create_ResetPasswordEmail_Group Method

    // ==============================================================================
    /// <summary>
    /// This method creates the password change group objectt.
    /// </summary>
    /// <param name="PageObject">Evado.UniForm.Model.Page object.</param>
    //  ------------------------------------------------------------------------------
    private void create_PasswordChangeEmail_Group (
      Evado.UniForm.Model.Page PageObject )
    {
      this.LogMethod ( "create_PasswordChangeEmail_Group" );
      // 
      // 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 ( );

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

      //
      // Add the group comands
      //
      this.addGroupCommands ( pageGroup );

      if ( this._displayPage == true )
      {
        this.create_Display_Group ( pageGroup,
          this.AdapterObjects.ContentTemplates.PasswordConfirmationEmail_Title,
          this.AdapterObjects.ContentTemplates.PasswordConfirmationEmail_Body );

        return;
      }


      // 
      // Create the home page title
      // 
      pageField = pageGroup.createTextField (
        EvStaticContentTemplates.ClassFieldNames.Password_Confirmation_Email_Title,
        EdLabels.UserAdmin_Email_Title_Field_Label,
        this.AdapterObjects.ContentTemplates.PasswordConfirmationEmail_Title,
        80 );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create the home page title
      // 
      pageField = pageGroup.createFreeTextField (
        EvStaticContentTemplates.ClassFieldNames.Password_Confirmation_Email_Body,
        EdLabels.UserAdmin_Email_Body_Field_Label,
        this.AdapterObjects.ContentTemplates.PasswordConfirmationEmail_Body, 80, 20 );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      pageField.Description = 
        EdLabels.UserAdmin_PasswordChange_Body_Description_Field_Label ;

    }//END create_PasswordChangeEmail_Group Method
    }//END create_PasswordChangeEmail_Group Method

    // ==============================================================================
    /// <summary>
    /// This method creates the password change group objectt.
    /// </summary>
    /// <param name="PageObject">Evado.UniForm.Model.Page object.</param>
    //  ------------------------------------------------------------------------------
    private void create_DemonRegistration_Group (
      Evado.UniForm.Model.Page PageObject )
    {
      this.LogMethod ( "create_DemonRegistration_Group" );
      // 
      // 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 ( );

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

      //
      // Add the group comands
      //
      this.addGroupCommands ( pageGroup );

      // 
      // Create instructions field
      // 
      pageField = pageGroup.createFreeTextField (
        EvStaticContentTemplates.ClassFieldNames.DemoRegistrationInstuctions,
        EdLabels.UserAdmin_Demo_Registration_Instructions_Field_Label,
        this.AdapterObjects.ContentTemplates.DemoRegistrationInstuctions,
        80, 20 );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create instructions field
      // 
      pageField = pageGroup.createFreeTextField (
        EvStaticContentTemplates.ClassFieldNames.DemoRegistrationConfirmation,
        EdLabels.UserAdmin_Demo_Registration_Confirmation_Field_Label,
        this.AdapterObjects.ContentTemplates.DemoRegistrationConfirmation,
        80, 20 );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create instructions field
      // 
      pageField = pageGroup.createFreeTextField (
        EvStaticContentTemplates.ClassFieldNames.DemoRegistrationError,
        EdLabels.UserAdmin_Demo_Registration_Error_Field_Label,
        this.AdapterObjects.ContentTemplates.DemoRegistrationError,
        80, 20 );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

    }//END create_PasswordChangeEmail_Group Method
    }//END getProperties_GeneralPageGroup Method

    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="Page">Evado.UniForm.Model.AppData object.</param>
    //  ------------------------------------------------------------------------------
    private void getPropertiesPage_SectionsGroup (
      Evado.UniForm.Model.Page Page )
    {
      this.LogMethod ( "getProperties_SectionsPageGroup" );
      // 
      // Initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( );
      Evado.UniForm.Model.Command groupCommand = 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 ( );
      String stFieldList = String.Empty;

      //
      // Define the section properties pageMenuGroup..
      //
      pageGroup = Page.AddGroup (
        EdLabels.Form_Properties_Sections_Group_Title );
      pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;
      pageGroup.CmdLayout = Evado.UniForm.Model.GroupCommandListLayouts.Vertical_Orientation;

      //
      // Add the new form section object.

      groupCommand = pageGroup.addCommand ( EdLabels.Form_Section_New_Section_Command_Title,
        EuAdapter.ADAPTER_ID,
        EuAdapterClasses.Entity_Layouts.ToString ( ),
        Evado.UniForm.Model.ApplicationMethods.Get_Object );

      groupCommand.AddParameter ( EdRecordSection.FormSectionClassFieldNames.Sectn_No.ToString ( ), "-1" );
      groupCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.Form_Properties_Section_Page );
      groupCommand.SetBackgroundDefaultColour ( Evado.UniForm.Model.Background_Colours.Purple );

      this.LogValue ( "No of form sections: " + this.Session.EntityLayout.Design.FormSections.Count );

      //
      // Iterate through the sections.
      //
      foreach ( EdRecordSection formSection in this.Session.EntityLayout.Design.FormSections )
      {
        groupCommand = pageGroup.addCommand ( formSection.LinkText,
          EuAdapter.ADAPTER_ID,
          EuAdapterClasses.Entity_Layouts.ToString ( ),
          Evado.UniForm.Model.ApplicationMethods.Get_Object );

        groupCommand.AddParameter ( EdRecordSection.FormSectionClassFieldNames.Sectn_No.ToString ( ), formSection.No );
        groupCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.Form_Properties_Section_Page );
      }

      this.LogValue ( "After No of form sections: " + this.Session.EntityLayout.Design.FormSections.Count );

      this.LogMethodEnd ( "getProperties_SectionsPageGroup" );

    }//END getProperties_SectionsPageGroup Method
    }//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
    }//END getObject method

    // ==============================================================================
    /// <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 getDataObject ( 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 ( );

      ClientDataObject.Id = Guid.NewGuid ( );
      ClientDataObject.Title = EdLabels.UserAdmin_Page_Title;

      ClientDataObject.Page.Id = ClientDataObject.Id;
      ClientDataObject.Page.Title = ClientDataObject.Title;
      ClientDataObject.Page.EditAccess = Evado.UniForm.Model.EditAccess.Enabled;
      this.LogValue ( "Page.Status: " + ClientDataObject.Page.EditAccess );

      //
      // Add the page commands
      //
      //this.addPageCommands ( ClientDataObject.Page );

      //
      // Create the demo registration group..
      //
      this.create_DemonRegistration_Group ( ClientDataObject.Page );

      //
      // Create the introductory email Group.
      //
      this.create_IntroductoryEmail_Group ( ClientDataObject.Page );

      //
      // create the reset pssword email group.
      //
      this.create_ResetPasswordEmail_Group ( ClientDataObject.Page );

      //
      // Create the passsword update email group
      //
      this.create_UpdatePasswordEmail_Group ( ClientDataObject.Page );

      //
      // create the reset pssword email group.
      //
      this.create_PasswordChangeEmail_Group ( ClientDataObject.Page );

    }//END getDataObject Method
    }//END addPageCommands method

    // ==============================================================================
    /// <summary>
    /// This method creates the introductory email grop
    /// </summary>
    /// <param name="PageObject">Evado.UniForm.Model.Page object.</param>
    //  ------------------------------------------------------------------------------
    private void create_Display_Group (
      Evado.UniForm.Model.Group PageGroup,
      String Title,
      String Body )
    {
      this.LogMethod ( "create_Display_Group" );
      // 
      // Initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.Field pageField = new Evado.UniForm.Model.Field ( );

      Title = Title.Replace ( "\r\n\r\n", "\r\n \r\n" );
      Title = Title.Replace ( EvcStatics.TEXT_SUBSITUTION_FIRST_NAME, "First" );
      Title = Title.Replace ( EvcStatics.TEXT_SUBSITUTION_FAMILY_NAME, "Family" );
      Title = Title.Replace ( EvcStatics.TEXT_SUBSITUTION_ADAPTER_TITLE, "Customer name" );

      Body = Body.Replace ( "\r\n\r\n", "\r\n \r\n" );
      Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_FIRST_NAME, "First" );
      Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_FAMILY_NAME, "Family" );
      Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_EMAIL_ADDRESS, "*****@*****.**" );
      Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_USER_ID, "userId" );
      Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_PASSWORD, "password" );
      Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_ORG_ID, "org ID" );
      Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_ORG_NAME, "Org Name" );
      Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_ADAPTER_TITLE, "Customer name" );
      Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_PASSWORD_RESET_URL, "https://www1evado.com/reset" );
      Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_DATE_STAMP, DateTime.Now.ToLongDateString ( ) + " at " + DateTime.Now.ToShortTimeString ( ) );

      // 
      // Create the home page title
      // 
      pageField = PageGroup.createReadOnlyTextField (
        String.Empty,
        EdLabels.UserAdmin_Email_Title_Field_Label,
        Title );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create the home page title
      // 
      pageField = PageGroup.createReadOnlyTextField (
        String.Empty,
        EdLabels.UserAdmin_Email_Body_Field_Label,
        Body );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

    }//END create_Display_Group method
    //  =================================================================================
    /// <summary>
    ///   This method generates the streamed video form field object as html markup.
    /// </summary>
    /// <param name="GroupField">Evado.UniForm.Model.PageGroup object.</param>
    //  ---------------------------------------------------------------------------------
    private void getStreamedVideoField (
      Evado.UniForm.Model.Group PageGroup )
    {
      this.LogMethod ( "getStreamedVideoField" );

      //
      // if there is not video donot create the video field.
      //
      if ( this.AdapterObjects.Settings.DemoRegistrationVideoUrl == String.Empty )
      {
        return;
      }

      // 
      // Initialise local variables.
      // 
      Evado.UniForm.Model.Field groupField = PageGroup.createField ( );
      groupField.Type = Evado.Model.EvDataTypes.Streamed_Video;
      groupField.Value = this.AdapterObjects.Settings.DemoRegistrationVideoUrl;
      groupField.Description = String.Empty;

      int iWidth = 800;
      int iHeight = 0;

      this.LogDebug ( "iWidth: " + iWidth );
      this.LogDebug ( "iHeight: " + iHeight );
      if ( iWidth > 0 )
      {
        groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Width, iWidth.ToString ( ) );
      }
      if ( iHeight > 0 )
      {
        groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Height, iHeight.ToString ( ) );
      }

      this.LogDebug ( "Value: " + groupField.Value );

      return;

    }//END getStreamedVideoField method.
    }//END getOrganisation method.

    // ==============================================================================
    /// <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 getDataObject ( 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 ( );

      ClientDataObject.Id = this.Session.AdminOrganisation.Guid;
      ClientDataObject.Title = EdLabels.Organisation_Page_Title;

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

      //
      // Set the user edit access to the objects.
      //
      if ( this.Session.UserProfile.hasAdministrationAccess == true )
      {
        ClientDataObject.Page.EditAccess = Evado.UniForm.Model.EditAccess.Enabled;
      }
      this.LogValue ( "Page.EditAccess: " + ClientDataObject.Page.EditAccess );

      //
      // Add the page commands 
      //
      this.getDataObject_PageCommands ( ClientDataObject.Page );

      //
      // Add the detail group to the page.
      //
      this.getDataObject_DetailsGroup ( ClientDataObject.Page );

      this.LogMethodEnd ( "getDataObject" );

    }//END Method
    // ==============================================================================
    /// <summary>
    /// This method add the user personaliseation group
    /// </summary>
    /// <param name="PageObject">Evado.UniForm.Model.Page object.</param>
    //  ------------------------------------------------------------------------------
    private void getDataObject_MUP_PersonaliseGroup (
      Evado.UniForm.Model.Page PageObject )
    {
      this.LogMethod ( "getDataObject_MUP_PersonaliseGroup" );
      // 
      // Initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field ( );
      Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( );
      Evado.UniForm.Model.Command groupCommand = new Evado.UniForm.Model.Command ( );
      List<EvOption> optionList = new List<EvOption> ( );

      // 
      // create the page pageMenuGroup
      // 
      pageGroup = new Evado.UniForm.Model.Group (
         EdLabels.UserProfile_Dashboard_Field_Group_Title,
         Evado.UniForm.Model.EditAccess.Inherited );
      pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;
      pageGroup.EditAccess = Evado.UniForm.Model.EditAccess.Enabled;

      //
      // Add the groups commands.
      //
      this.getDataObject_UserGroupCommands ( pageGroup );

      /*
    if ( this.Session.UserProfile.hasManagementAccess == true )
    {
      //
      // create the project dashboard option list.
      //
      optionList = Evado.Digital.Model.EdApplication.getDashBoardList ( false );

      //
      // Add the user's project dashboard component selection
      // 
      groupField = pageGroup.createCheckBoxListField (
         EvUserProfile.UserProfileFieldNames.Project_Dashboard_Components,
         EdLabels.UserProfile_Project_Dashboard_Option_Title,
         this.Session.UserProfile.ProjectDashboardComponents,
         optionList );
      groupField.Layout = EuFormGenerator.ApplicationFieldLayout;
    }

    //
    // These can see site dashboard.
    //
    if ( ( this.ApplicationObjects.ApplicationSettings.DisplaySiteDashboard == true )
     &&  ( this.Session.UserProfile.hasEndUserRole( this.Session.Record.Design.ReadAccessRoles ) == true ) )
    {
      //
      // create the site dashboard option list.
      // 
      optionList = Evado.Digital.Model.EdApplication.getDashBoardList ( true );

      //
      // Add the user's site dashboard component selection
      // 
      groupField = pageGroup.createCheckBoxListField (
         EvUserProfile.UserProfileFieldNames.Site_Dashboard_Components,
         EdLabels.UserProfile_Site_Dashboard_Option_Title,
         this.Session.UserProfile.SiteDashboardComponents, optionList );
      groupField.Layout = EuFormGenerator.ApplicationFieldLayout;
    }
      */

      if ( pageGroup.FieldList.Count > 0 )
      {
        PageObject.AddGroup ( pageGroup );
      }

      this.LogMethodEnd ( "getDataObject_MUP_PersonaliseGroup" );
    }
Esempio n. 12
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
        }//END static convertEvOptionsList method

        // =================================================================================
        /// <summary>
        ///  This static method convert a list of EvFormField into a list of ClientClientDataObjectFields
        /// </summary>
        /// <param name="FormField">The list of EvFormField objects.</param>
        /// <returns>List of ClientClientDataObjectFields</returns>
        // ---------------------------------------------------------------------------------
        private static Evado.UniForm.Model.Field generateTableField(Evado.Digital.Model.EdRecordField FormField)
        {
            //
            // Initialise the method variables and objects.
            //
            Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field(
                FormField.FieldId,
                FormField.Title,
                Evado.Model.EvDataTypes.Table);

            //
            // Initialise the field object.
            //
            if (FormField.Design.Instructions != String.Empty)
            {
                groupField.Description = FormField.Design.Instructions;
            }
            groupField.AddParameter(Evado.UniForm.Model.FieldParameterList.Width, "100");
            groupField.EditAccess = Evado.UniForm.Model.EditAccess.Inherited;
            groupField.Type       = Evado.Model.EvDataTypes.Table;
            groupField.Table      = new Evado.UniForm.Model.Table( );

            //
            // Initialise the table header
            //
            if (FormField.Table != null)
            {
                for (int column = 0; column < FormField.Table.Header.Length; column++)
                {
                    groupField.Table.Header [column].No     = FormField.Table.Header [column].No;
                    groupField.Table.Header [column].Text   = FormField.Table.Header [column].Text;
                    groupField.Table.Header [column].TypeId = FormField.Table.Header [column].TypeId;
                    groupField.Table.Header [column].Width  = FormField.Table.Header [column].Width;

                    //
                    // Proces the Options or Unit field value.
                    //
                    if (groupField.Table.Header [column].TypeId == Evado.Model.EvDataTypes.Numeric)
                    {
                        groupField.Table.Header [column].OptionsOrUnit = FormField.Table.Header [column].OptionsOrUnit;
                    }
                    if (groupField.Table.Header [column].TypeId == Evado.Model.EvDataTypes.Radio_Button_List ||
                        groupField.Table.Header [column].TypeId == Evado.Model.EvDataTypes.Selection_List)
                    {
                        groupField.Table.Header [column].OptionList = Evado.UniForm.Model.EuStatics.getStringAsOptionList(
                            FormField.Table.Header [column].OptionsOrUnit);
                    }
                }//END Column interation loop

                //
                // transfer the table values to the pagefield table object.
                //
                for (int inRow = 0; inRow < FormField.Table.Rows.Count; inRow++)
                {
                    Evado.UniForm.Model.TableRow row = new Evado.UniForm.Model.TableRow( );

                    for (int inColumn = 0; inColumn < FormField.Table.ColumnCount; inColumn++)
                    {
                        row.Column [inColumn] = FormField.Table.Rows [inRow].Column [inColumn];
                    }
                    groupField.Table.Rows.Add(row);
                }
            }

            //
            // returnt the page field object.
            //
            return(groupField);
        } //END generateTableField method.
    }//END getStreamedVideoField method.

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

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

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

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

      // 
      // Create the user id object
      // 
      groupField = pageGroup.createTextField (
         Evado.Digital.Model.EdUserProfile.FieldNames.UserId.ToString ( ),
        EdLabels.User_Profile_Identifier_Field_Label,
        this.Session.AdminUserProfile.UserId,
        80 );
      groupField.Layout = EuAdapter.DefaultFieldLayout;
      groupField.EditAccess = Evado.UniForm.Model.EditAccess.Disabled;


      // 
      // Create the comon name object
      // 
      groupField = pageGroup.createTextField (
         Evado.Digital.Model.EdUserProfile.FieldNames.CommonName,
        EdLabels.Dem_Registration_CommonName_Field_Label,
        this.Session.AdminUserProfile.CommonName,
        80 );
      groupField.Layout = EuAdapter.DefaultFieldLayout;
      groupField.Mandatory = true;

      // 
      // Create the user's email address object
      // 
      groupField = pageGroup.createTelephoneNumberField (
         Evado.Digital.Model.EdUserProfile.FieldNames.Telephone.ToString ( ),
        EdLabels.UserProfile_Telephone_Field_Label,
        this.Session.AdminUserProfile.Telephone );
      groupField.Layout = EuAdapter.DefaultFieldLayout;
      groupField.Mandatory = true;

      // 
      // Create the user's email address object
      // 
      groupField = pageGroup.createEmailAddressField (
         Evado.Digital.Model.EdUserProfile.FieldNames.Email_Address.ToString ( ),
        EdLabels.UserProfile_Email_Field_Label,
        this.Session.AdminUserProfile.EmailAddress );
      groupField.Layout = EuAdapter.DefaultFieldLayout;
      groupField.Mandatory = true;
      groupField.setBackgroundColor (
        Evado.UniForm.Model.FieldParameterList.BG_Mandatory,
        Evado.UniForm.Model.Background_Colours.Red );

    }//END getDataObject_FieldGroup Method
Esempio n. 15
0
    }//END getObject method

    // ==============================================================================
    /// <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 getDataObject (
      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 ( );

      ClientDataObject.Id = this._ApplicationEvent.Guid;
      ClientDataObject.Title = EdLabels.ApplicationEvent_Page_Title;

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

      //
      // Add the help button if the help url is defined.
      //
      if ( this.AdapterObjects.HelpUrl != String.Empty )
      {
        Evado.UniForm.Model.Command helpCommand = ClientDataObject.Page.addCommand (
         EdLabels.Label_Help_Command_Title,
         EuAdapter.ADAPTER_ID,
         EuAdapterClasses.Events.ToString ( ),
         Evado.UniForm.Model.ApplicationMethods.Get_Object );

        helpCommand.Type = Evado.UniForm.Model.CommandTypes.Http_Link;

        helpCommand.AddParameter ( Evado.UniForm.Model.CommandParameters.Link_Url,
           EvcStatics.createHelpUrl (
            this.AdapterObjects.HelpUrl,
             Evado.Digital.Model.EdStaticPageIds.Application_Event ) );
      }

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

      // 
      // Create the customer id object
      // 
      pageField = pageGroup.createReadOnlyTextField (
        String.Empty,
        EdLabels.ApplicationEvent_Date_Time_Field_Label,
        this._ApplicationEvent.DateTime.ToString ( "dd MMM yyyy HH:mm:ss" ) );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create the event id object
      // {
      if ( this._ApplicationEvent.EventId == 0
        || this._ApplicationEvent.EventId == 1 )
      {
        this._ApplicationEvent.EventId = (int) EvEventCodes.Ok;
      }

      EvEventCodes code = (EvEventCodes) this._ApplicationEvent.EventId;

      String content = this._ApplicationEvent.EventId.ToString ( "000000" )
        + " > " +
         Evado.Model.EvStatics.enumValueToString ( code );

      pageField = pageGroup.createReadOnlyTextField (
        String.Empty,
        EdLabels.ApplicationEvent_Event_Id_Field_Label,
        content );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create the type id object
      // 
      pageField = pageGroup.createReadOnlyTextField (
        String.Empty,
        EdLabels.ApplicationEvent_Type_Field_Label,
         Evado.Model.EvStatics.enumValueToString ( this._ApplicationEvent.Type ) );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create the Category id object
      // 
      pageField = pageGroup.createReadOnlyTextField (
        String.Empty,
        EdLabels.ApplicationEvent_Category_Field_Label,
        this._ApplicationEvent.Category );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create the description object
      // 
      pageField = pageGroup.createFreeTextField (
        String.Empty,
        EdLabels.ApplicationEvent_Description_Field_Label,
        this._ApplicationEvent.Description,
        80,
        40 );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create the user object
      // 
      pageField = pageGroup.createReadOnlyTextField (
        String.Empty,
        EdLabels.ApplicationEvent_UserName_Field_Label,
        this._ApplicationEvent.UserId );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

    }//END 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 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
        // =================================================================================
        /// <summary>
        ///  This static method convert a list of EvFormField into a list of ClientClientDataObjectFields
        /// </summary>
        /// <param name="FormRecordFields">The list of EvFormField objects.</param>
        /// <param name="Section">The EvFormSection defining the section to be displayed.</param>
        /// <param name="EditStatus">Evado.UniForm.Model.EditAccess defining the field edit status.</param>
        /// <param name="GroupLayout">Evado.UniForm.Model.GroupLayouts defining the pageMenuGroup layout setting.</param>
        /// <returns>ClientClientDataObjectGorup object</returns>
        // ---------------------------------------------------------------------------------
        public static Evado.UniForm.Model.Group convertListOfEvFormFields(
            List <Evado.Digital.Model.EdRecordField> FormRecordFields,
            Evado.Digital.Model.EdRecordSection Section,
            Evado.UniForm.Model.EditAccess EditStatus,
            Evado.UniForm.Model.GroupLayouts GroupLayout)
        {
            EuConversions._Status = "Evado.UniForm.Clinical.Conversions.convertListOfEvFormFields method "
                                    + " Field Count: " + FormRecordFields.Count
                                    + " Section: " + Section
                                    + " EditStatus: " + EditStatus;

            //
            // Initialise the method variables and objects.
            //
            List <Evado.UniForm.Model.Field> pageFieldList = new List <Evado.UniForm.Model.Field> ( );

            Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group(
                Section.Title,
                String.Empty,
                EditStatus);
            pageGroup.Layout = GroupLayout;

            //
            // If null create empty object.
            //
            if (Section == null)
            {
                Section = new  Evado.Digital.Model.EdRecordSection( );
            }

            //
            // if section is empty no sections on the list.
            //
            if (Section.Title != String.Empty)
            {
                EuConversions._Status += "\r\nSection No: " + Section.No + ", Section: " + Section.Title;
                pageGroup              = new Evado.UniForm.Model.Group(
                    Section.Title,
                    Section.Instructions,
                    Evado.UniForm.Model.EditAccess.Inherited);
                pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;
            }
            //
            // Iterate through the EV option list.
            //
            foreach (Evado.Digital.Model.EdRecordField field in FormRecordFields)
            {
                EuConversions._Status += "\r\nField: " + field.FieldId + ", Sectn: " + field.Design.SectionNo;

                //
                // IF the section is empty then there are no sections.
                // Process the fields in field order.
                //
                if (Section.Title == String.Empty)
                {
                    Evado.UniForm.Model.Field pageField = convertEvFormfield(field);

                    if (pageField != null)
                    {
                        EuConversions._Status += " >> NO SECTION FIELD CONVERTED";

                        pageGroup.FieldList.Add(pageField);
                    }
                }//END no section
                else
                {
                    //
                    // generate page fields for the fields in the selected section.
                    //
                    if (field.Design.SectionNo == Section.No)
                    {
                        EuConversions._Status = " >> SECTION SELECTED";
                        Evado.UniForm.Model.Field pageField = convertEvFormfield(field);

                        if (pageField != null)
                        {
                            EuConversions._Status = " >> FIELD CONVERTED";
                            pageGroup.FieldList.Add(pageField);
                        }
                    } //END section exists
                }
            }         //END Form field iteration loop.

            //
            // return the device option list.
            //
            return(pageGroup);
        }//END static convertEvOptionsList 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
    }//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
    // ==============================================================================
    /// <summary>
    /// This method add the user personaliseation group
    /// </summary>
    /// <param name="Page">Evado.UniForm.Model.Page object.</param>
    //  ------------------------------------------------------------------------------
    private void getDataObject_MUP_OrganisationGroup (
      Evado.UniForm.Model.Page PageObject )
    {
      this.LogMethod ( "getDataObject_MUP_OrganisationGroup" );
      // 
      // Initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field ( );
      Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( );
      Evado.UniForm.Model.Command groupCommand = new Evado.UniForm.Model.Command ( );
      List<EvOption> optionList = new List<EvOption> ( );

      if ( this.AdapterObjects.Settings.EnableUserOrganisationUpdate == false )
      {
        this.LogDebug ( "Update update of organisations is disabled." );
        this.LogMethodEnd ( "getDataObject_MUP_OrganisationGroup" );
        return;
      }

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

      //
      // Add the groups commands.
      //
      this.getDataObject_UserGroupCommands ( pageGroup );

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

      groupField.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 )
      {
        groupField = pageGroup.createImageField (
          EuUserProfiles.CONST_ORG_PREFIX + EdOrganisation.FieldNames.Image_File_Name.ToString ( ),
          EdLabels.Organisation_ImageFileame_Field_Label,
          this.Session.Organisation.ImageFileName,
          300, 200 );
        groupField.Layout = EuAdapter.DefaultFieldLayout;

        try
        {
          String stTargetPath = this.UniForm_BinaryFilePath + this.Session.Organisation.ImageFileName;
          String stImagePath = this.UniForm_ImageFilePath + this.Session.Organisation.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 )
      {
        groupField = pageGroup.createTextField (
          EuUserProfiles.CONST_ORG_PREFIX + EdOrganisation.FieldNames.Address_1,
          EdLabels.Organisation_Address_Street_Field_Label,
          this.Session.Organisation.AddressStreet_1, 50 );
        groupField.Layout = EuAdapter.DefaultFieldLayout;

        // 
        // Create the street address 2
        // 
        groupField = pageGroup.createTextField (
          EuUserProfiles.CONST_ORG_PREFIX + EdOrganisation.FieldNames.Address_2,
          EdLabels.Organisation_Address_Street_Field_Label,
          this.Session.Organisation.AddressStreet_2, 50 );
        groupField.Layout = EuAdapter.DefaultFieldLayout;
      }

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

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

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

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

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

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


      this.LogMethodEnd ( "getDataObject_MUP_OrganisationGroup" );
    }
Esempio n. 22
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
    }//END getDataObject_MUP_GeneralGroup Method

    // ==============================================================================
    /// <summary>
    /// This method add the user personal details update group.
    /// </summary>
    /// <param name="Page">Evado.UniForm.Model.Page object.</param>
    //  ------------------------------------------------------------------------------
    private void getDataObject_MUP_DetailsGroup (
      Evado.UniForm.Model.Page Page )
    {
      this.LogMethod ( "getDataObject_MUP_DetailsGroup" );
      // 
      // Initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field ( );
      Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( );
      Evado.UniForm.Model.Command groupCommand = new Evado.UniForm.Model.Command ( );

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

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

      //
      // Add the groups commands.
      //
      this.getDataObject_UserGroupCommands ( pageGroup );


      this.LogDebug ( "ImageFileName {0}.", this.Session.UserProfile.ImageFileName );
      // 
      // Create the customer name object
      // 
      if ( this.AdapterObjects.Settings.hasHiddenUserProfileField ( EdUserProfile.FieldNames.Image_File_Name ) == false )
      {
        this.Session.UserProfile.CurrentImageFileName = this.Session.UserProfile.ImageFileName;

        groupField = pageGroup.createImageField (
          Evado.Digital.Model.EdUserProfile.FieldNames.Image_File_Name,
          EdLabels.UserProfile_ImageFileame_Field_Label,
          this.Session.UserProfile.ImageFileName,
          300,
          300 );
        groupField.Layout = EuAdapter.DefaultFieldLayout;

        try
        {
          String stTargetPath = this.UniForm_BinaryFilePath + this.Session.UserProfile.ImageFileName;
          String stImagePath = this.UniForm_ImageFilePath + this.Session.UserProfile.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 ( Exception Ex )
        {
          this.LogException ( Ex );
        }
      }
      else
      {
        this.Session.UserProfile.ImageFileName = String.Empty;
      }

      if ( this.AdapterObjects.Settings.hasHiddenUserProfileField ( EdUserProfile.FieldNames.Title ) == false )
      {
        groupField = pageGroup.createTextField (
          Evado.Digital.Model.EdUserProfile.FieldNames.Title,
          EdLabels.UserProfile_Title_Field_Label,
          this.Session.UserProfile.Title, 50 );
        groupField.Layout = EuAdapter.DefaultFieldLayout;
      }

      //
      // create the name field.
      //
      this.LogDebug ( "Delimited Name: " + this.Session.UserProfile.DelimitedName );

      groupField = pageGroup.createNameField (
        Evado.Digital.Model.EdUserProfile.FieldNames.Delimted_Name,
        EdLabels.UserProfile_Name_Field_Label,
        this.Session.UserProfile.DelimitedName,
        true,
        false );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      #region address block
      //
      // define the user address field.
      //
      if ( this.AdapterObjects.Settings.EnableUserAddressUpdate == true
        && this.AdapterObjects.Settings.EnableUserOrganisationUpdate == false )
      {
        this.LogDebug ( "Address_1:" + this.Session.UserProfile.Address_1 );
        this.LogDebug ( "Address_2:" + this.Session.UserProfile.Address_2 );
        this.LogDebug ( "AddressCity:" + this.Session.UserProfile.AddressCity );
        this.LogDebug ( "AddressState:" + this.Session.UserProfile.AddressState );
        this.LogDebug ( "AddressPostCode:" + this.Session.UserProfile.AddressPostCode );
        this.LogDebug ( "AddressCountry:" + this.Session.UserProfile.AddressCountry );
        // 
        // Create the customer name object
        //
        groupField = pageGroup.createAddressField (
          EuUserProfiles.CONST_ADDRESS_FIELD_ID,
          EdLabels.UserProfile_Address_Field_Label,
          this.Session.UserProfile.Address_1,
          this.Session.UserProfile.Address_2,
          this.Session.UserProfile.AddressCity,
          this.Session.UserProfile.AddressState,
          this.Session.UserProfile.AddressPostCode,
          this.Session.UserProfile.AddressCountry );
        groupField.Layout = EuAdapter.DefaultFieldLayout;

        this.LogDebug ( "AddresS:" + groupField.Value );
      }
      #endregion
      #region contact details
      // 
      // Create the customer telephone number object
      // 
      groupField = pageGroup.createTelephoneNumberField (
         Evado.Digital.Model.EdUserProfile.FieldNames.Telephone.ToString ( ),
        EdLabels.UserProfile_Telephone_Field_Label,
        this.Session.UserProfile.Telephone );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create the customer telephone number object
      // 
      groupField = pageGroup.createTelephoneNumberField (
         Evado.Digital.Model.EdUserProfile.FieldNames.Mobile_Phone.ToString ( ),
        EdLabels.UserProfile_Mobilephone_Field_Label,
        this.Session.UserProfile.MobilePhone );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create the customer fax number object
      // 
      groupField = pageGroup.createEmailAddressField (
         Evado.Digital.Model.EdUserProfile.FieldNames.Email_Address.ToString ( ),
        EdLabels.UserProfile_Email_Field_Label,
        this.Session.UserProfile.EmailAddress );
      groupField.Layout = EuAdapter.DefaultFieldLayout;
      #endregion

      this.LogMethodEnd ( "getDataObject_MUP_DetailsGroup" );

    }//END getDataObject_MUP_DetailsGroup Method
Esempio n. 24
0
    }//END getRecordExport_DownloadGroup method

    //===================================================================================
    /// <summary>
    /// Thie method exports the record list to a export form.
    /// </summary>
    /// <param name="pageGroup">Evado.UniForm.Model.Group object</param>
    /// <param name="iteration">int: iteration loop</param>
    /// <param name="exportParameters">EvExportParameters object.</param>
    /// <param name="FormId">String form identifier</param>
    /// <returns>True export generated.</returns>
    //-----------------------------------------------------------------------------------
    private EvEventCodes exportRecordData (
      Evado.UniForm.Model.Group pageGroup,
      int iteration,
      EvExportParameters exportParameters,
      String FormId )
    {
      this.LogMethod ( "exportRecordData" );
      // 
      // Initialise the methods variables and objects.
      // 
      String csvDownload = String.Empty;
      String csvFileName = String.Empty;
      EvFormRecordExport exportRecords = new EvFormRecordExport ( this.ClassParameters );

      //
      // Generate the export download CSV ResultData file.
      //
      csvDownload = exportRecords.exportRecords (
        exportParameters,
        this.Session.UserProfile );

      if ( exportRecords.EventCode != EvEventCodes.Ok )
      {
        this.LogDebug ( "EventCode: " + exportRecords.EventCode );

        if ( exportRecords.EventCode == EvEventCodes.Data_Export_Empty_Record_List )
        {
          this.ErrorMessage = EdLabels.Form_Record_Export_Empty_List_Error_Message;
        }
        this.LogMethodEnd ( "exportRecordData" );
        return exportRecords.EventCode;
      }

      this.LogClass ( exportRecords.Log );
      //
      // Create the export file name.
      //
      csvFileName = FormId
        + "-Records-"
        + DateTime.Now.ToString ( "yy-MM-dd" ) + ".csv";

      if ( iteration > 0 )
      {
        csvFileName = FormId
        + "-Records-" + iteration
        + "-" + DateTime.Now.ToString ( "yy-MM-dd" ) + ".csv";
      }


      this.LogValue ( "csvDownload length: " + csvDownload.Length );
      this.LogValue ( "csvFileName: " + csvFileName );

      bool result = Evado.Digital.Model.EvcStatics.Files.saveFile (
        this.UniForm_BinaryFilePath,
        csvFileName,
        csvDownload );

      if ( result == false )
      {
        this.ErrorMessage = EdLabels.Record_Export_Error_Message;

        this.LogDebugClass ( Evado.Digital.Model.EvcStatics.Files.DebugLog );
        this.LogDebug ( "ReturnedEventCode: " + Evado.Digital.Model.EvcStatics.Files.ReturnedEventCode );
        this.LogDebug ( this.ErrorMessage );
        this.LogMethodEnd ( "exportRecordData" );
        return Evado.Digital.Model.EvcStatics.Files.ReturnedEventCode;
      }

      Evado.UniForm.Model.Field groupField = pageGroup.createHtmlLinkField (
        String.Empty,
        csvFileName,
      this.UniForm_BinaryServiceUrl + csvFileName );

      this.LogMethodEnd ( "exportRecordData" );
      return EvEventCodes.Ok;
    }//END exportRecordData method.
Esempio n. 25
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 );

    }
Esempio n. 26
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 static convertEvOptionsList method

        // =================================================================================
        /// <summary>
        ///  This static method convert a list of EvFormField into a list of ClientClientDataObjectFields
        /// </summary>
        /// <param name="FormField">The list of EvFormField objects.</param>
        /// <returns>List of ClientClientDataObjectFields</returns>
        // ---------------------------------------------------------------------------------
        public static Evado.UniForm.Model.Field convertEvFormfield(Evado.Digital.Model.EdRecordField FormField)
        {
            //
            // Initialise the method variables and objects.
            //
            Evado.UniForm.Model.Field pageField = new Evado.UniForm.Model.Field(
                FormField.FieldId,
                FormField.Title,
                Evado.Model.EvDataTypes.Null);
            pageField.Layout = Evado.UniForm.Model.FieldLayoutCodes.Left_Justified;

            if (FormField.Design.Instructions != String.Empty)
            {
                pageField.Description = FormField.Design.Instructions;
            }

            switch (FormField.TypeId)
            {
            case Evado.Model.EvDataTypes.Text:
            {
                pageField.Type  = Evado.Model.EvDataTypes.Text;
                pageField.Value = FormField.ItemValue;
                pageField.AddParameter(Evado.UniForm.Model.FieldParameterList.Width, "50");
                break;
            }

            case Evado.Model.EvDataTypes.Free_Text:
            {
                pageField.Type  = Evado.Model.EvDataTypes.Free_Text;
                pageField.Value = FormField.ItemText;
                pageField.AddParameter(Evado.UniForm.Model.FieldParameterList.Width, "50");
                pageField.AddParameter(Evado.UniForm.Model.FieldParameterList.Height, "5");
                break;
            }

            case Evado.Model.EvDataTypes.Date:
            {
                pageField.Type  = Evado.Model.EvDataTypes.Date;
                pageField.Value = FormField.ItemValue;
                pageField.AddParameter(Evado.UniForm.Model.FieldParameterList.Width, "12");
                break;
            }

            case Evado.Model.EvDataTypes.Time:
            {
                pageField.Type  = Evado.Model.EvDataTypes.Time;
                pageField.Value = FormField.ItemValue;
                pageField.AddParameter(Evado.UniForm.Model.FieldParameterList.Width, "6");
                break;
            }

            case Evado.Model.EvDataTypes.Numeric:
            {
                pageField.Type  = Evado.Model.EvDataTypes.Numeric;
                pageField.Value = FormField.ItemValue;

                pageField.AddParameter(
                    Evado.UniForm.Model.FieldParameterList.Min_Value,
                    FormField.Design.ValidationLowerLimit.ToString( ));

                pageField.AddParameter(
                    Evado.UniForm.Model.FieldParameterList.Max_Value,
                    FormField.Design.ValidationUpperLimit.ToString( ));

                pageField.AddParameter(
                    Evado.UniForm.Model.FieldParameterList.Width, "10");
                break;
            }

            case Evado.Model.EvDataTypes.Selection_List:
            case Evado.Model.EvDataTypes.External_Selection_List:
            {
                pageField.Type       = Evado.Model.EvDataTypes.Selection_List;
                pageField.Value      = FormField.ItemValue;
                pageField.OptionList = EuConversions.convertEvOptionsList(FormField.Design.OptionList, true);
                pageField.AddParameter(
                    Evado.UniForm.Model.FieldParameterList.Width, "50");
                break;
            }

            case Evado.Model.EvDataTypes.Radio_Button_List:
                // case Evado.Model.EvDataTypes.Horizontal_Radio_Buttons:
            {
                pageField.Type       = Evado.Model.EvDataTypes.Radio_Button_List;
                pageField.Value      = FormField.ItemValue;
                pageField.OptionList = EuConversions.convertEvOptionsList(FormField.Design.OptionList, true);
                pageField.AddParameter(
                    Evado.UniForm.Model.FieldParameterList.Width, "50");
                break;
            }

            case Evado.Model.EvDataTypes.Boolean:
            {
                pageField.Type  = Evado.Model.EvDataTypes.Boolean;
                pageField.Value = FormField.ItemValue;
                pageField.AddParameter(Evado.UniForm.Model.FieldParameterList.Width, "50");
                break;
            }

            case Evado.Model.EvDataTypes.Check_Box_List:
            {
                pageField.Type       = Evado.Model.EvDataTypes.Check_Box_List;
                pageField.Value      = FormField.ItemValue;
                pageField.OptionList = EuConversions.convertEvOptionsList(FormField.Design.OptionList, true);
                pageField.AddParameter(Evado.UniForm.Model.FieldParameterList.Width, "50");
                break;
            }

            case Evado.Model.EvDataTypes.Analogue_Scale:
            case Evado.Model.EvDataTypes.Horizontal_Radio_Buttons:
            {
                pageField.Type  = Evado.Model.EvDataTypes.Read_Only_Text;
                pageField.Value = FormField.ItemValue;
                pageField.AddParameter(Evado.UniForm.Model.FieldParameterList.Width, "50");
                break;
            }

            case Evado.Model.EvDataTypes.Table:
            case Evado.Model.EvDataTypes.Special_Matrix:
            {
                pageField = generateTableField(FormField);
                break;
            }

            default:
            {
                pageField = null;
                break;
            }
            }

            //
            // return the device option list.
            //
            return(pageField);
        }//END static convertEvOptionsList method
    }//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
Esempio n. 29
0
    }//END getRecordExport_ListObject 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_DownloadGroup (
      Evado.UniForm.Model.Page Page )
    {
      this.LogMethod ( "getRecordExport_DownloadGroup" );
      this.LogDebug ( "FormRecords_IncludeFreeTextData: " + this.Session.FormRecords_IncludeFreeTextData );
      this.LogDebug ( "FormRecords_IncludeDraftRecords: " + this.Session.FormRecords_IncludeDraftRecords );
      // 
      // 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 ( );
      EvFormRecordExport exportRecords = new EvFormRecordExport ( );
      EvExportParameters exportParameters = new EvExportParameters ( );
      EdQueryParameters queryParameters = new EdQueryParameters ( );
      int exportRecordFileLimit = 250;
      this.LogDebug ( "exportRecordFileLimit: " + exportRecordFileLimit );

      //
      // IF there are not parameters then exit.
      //
      if ( this.Session.Selected_EntityLayoutId == String.Empty )
      {
        this.LogDebug ( " Form {0}. ", this.Session.Selected_EntityLayoutId );
        this.LogMethodEnd ( "getRecordExport_DownloadGroup" );
        return;
      }


      exportParameters = new EvExportParameters (
        EvExportParameters.ExportDataSources.Project_Record,
        this.Session.Selected_EntityLayoutId );
      exportParameters.IncludeTestSites = false;
      exportParameters.IncludeFreeTextData = this.Session.FormRecords_IncludeFreeTextData;
      exportParameters.IncludeDraftRecords = this.Session.FormRecords_IncludeDraftRecords;

      queryParameters = new EdQueryParameters ( );
      queryParameters.LayoutId = this.Session.Selected_EntityLayoutId;

      queryParameters.States.Add ( EdRecordObjectStates.Withdrawn );
      queryParameters.States.Add ( EdRecordObjectStates.Draft_Record );
      queryParameters.States.Add ( EdRecordObjectStates.Empty_Record );
      queryParameters.States.Add ( EdRecordObjectStates.Completed_Record );

      if ( exportParameters.IncludeDraftRecords == true )
      {
        queryParameters.States.Add ( EdRecordObjectStates.Withdrawn );
      }
      queryParameters.NotSelectedState = true;
      queryParameters.IncludeSummary = true;
      queryParameters.IncludeRecordValues = false;
      queryParameters.IncludeComments = false;

      //
      // Create the export ResultData file.
      //
      int inResultCount = this._Bll_Entities.geyEntityCount ( queryParameters );

      this.LogClass ( this._Bll_Entities.Log );

      this.LogDebug ( "inResultCount: " + inResultCount );
      // 
      // Create the record display pageMenuGroup.
      // 
      pageGroup = Page.AddGroup (
        EdLabels.Record_Export_Download_Group_Title,
        Evado.UniForm.Model.EditAccess.Enabled );
      pageGroup.CmdLayout = Evado.UniForm.Model.GroupCommandListLayouts.Vertical_Orientation;

      pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;

      if ( inResultCount == 0 )
      {
        LogDebug ( "Record Count is 0." );
        pageGroup.Description = EdLabels.Form_Record_Export_Empty_List_Error_Message;

        this.LogMethodEnd ( "getRecordExport_DownloadGroup" );
        return;
      }

      //
      // If the record list is less thant the exportrecord limit output.
      //
      if ( inResultCount <= exportRecordFileLimit )
      {
        //
        // export the ResultData.
        //
        this.exportRecordData (
            pageGroup,
            0,
           exportParameters,
             this.Session.Selected_EntityLayoutId );
      }
      else
      {
        //
        // Initialise the output loop parameters.
        int iRecordRangeStart = 0;
        int iRecordRangeFinish = exportRecordFileLimit;
        int iterations = ( inResultCount / exportRecordFileLimit ) + 1;

        this.LogValue ( "iterations: " + iterations );

        for ( int iLoop = 0; iLoop < iterations && iRecordRangeFinish <= inResultCount; iLoop++ )
        {

          //
          // export the ResultData.
          //
          var result = this.exportRecordData (
            pageGroup,
            iLoop,
             exportParameters,
             this.Session.Selected_EntityLayoutId );

          if ( result != EvEventCodes.Ok )
          {
            this.LogDebug ( "Result {0}.", result );
            this.LogMethodEnd ( "getRecordExport_DownloadGroup" );
            return;
          }

          //
          // Increment the start and finish for then next loop
          //
          iRecordRangeStart = iRecordRangeFinish + 1;
          if ( ( iRecordRangeFinish + exportRecordFileLimit ) < inResultCount )
          {

            iRecordRangeFinish += exportRecordFileLimit;
          }
          else
          {
            iRecordRangeFinish = inResultCount;
          }

        }//END loop iteration statement.
      }

      this.LogMethodEnd ( "getRecordExport_DownloadGroup" );
      return;
    }//END getRecordExport_DownloadGroup method