}//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 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
Ejemplo n.º 3
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 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
    }//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