}//END getClientDataObject method

    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    #endregion

    #region Class get object methods

    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="PageCommand">Evado.UniForm.Model.Command object.</param>
    /// <returns>ClientApplicationData object</returns>
    //  ------------------------------------------------------------------------------
    private Evado.UniForm.Model.AppData getObject (
      Evado.UniForm.Model.Command PageCommand )
    {
      this.LogMethod ( "getObject" );
      // 
      // Initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.AppData clientDataObject = new Evado.UniForm.Model.AppData ( );
      Guid OrgGuid = Guid.Empty;

      try
      {
        // 
        // return the client ResultData object for the customer.
        // 
        this.getDataObject ( clientDataObject );

        return clientDataObject;
      }
      catch ( Exception Ex )
      {
        // 
        // Create the error message to be displayed to the user.
        // 
        this.ErrorMessage = EdLabels.ApplicationProfile_Page_Error_Message;

        // 
        // Generate the log the error event.
        // 
        this.LogException ( Ex );
      }

      return null;

    }//END getObject 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
Ejemplo n.º 3
0
    // ==================================================================================
    /// <summary>
    /// This method appendes the page command to the debug log for the class and adds
    /// a new line at the end of the text.
    /// </summary>
    /// <param name="Value">String:  debug text.</param>
    // ----------------------------------------------------------------------------------
    public void LogAction ( Evado.UniForm.Model.Command PageCommand, bool WithParameters )
    {
      //
      // get the command values.
      //
      string Value = "PageCommand: " + PageCommand.getAsString ( false, WithParameters );

      //
      // Append the value to the text log.
      //
      this._AdapterLog.AppendLine (
        DateTime.Now.ToString ( "dd-MM-yy hh:mm:ss" ) + " ACTION:  " + Value );

      //
      // create the aplplication event
      //
      EvApplicationEvent applicationEvent = new EvApplicationEvent (
        EvApplicationEvent.EventType.Action,
        EvEventCodes.Ok,
        this.ClassNameSpace,
        Value,
        this.Session.UserProfile.UserId );

      //
      // Log the application event.
      //
      this.AddEvent ( applicationEvent );
    }
Ejemplo n.º 4
0
    }//END Method

    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    #endregion

    #region Class private create object methods

    // ==================================================================================
    /// <summary>
    /// THis method saves the ResultData object updating the field values contained in the 
    /// parameter list.
    /// </summary>
    /// <param name="Command">Evado.UniForm.Model.Command object.</param>
    /// <returns>Evado.UniForm.Model.AppData object</returns>
    //  ----------------------------------------------------------------------------------
    private Evado.UniForm.Model.AppData createObject ( Evado.UniForm.Model.Command Command )
    {
      this.LogMethod ( "createObject" );
      try
      {
        //
        // Determine if the user has access to this page and log and error if they do not.
        //
        if ( this.Session.UserProfile.hasAdministrationAccess == false )
        {
          this.LogIllegalAccess (
            this.ClassNameSpace + "createObject",
            this.Session.UserProfile );

          this.ErrorMessage = EdLabels.Illegal_Page_Access_Attempt;

          return this.Session.LastPage;
        }

        // 
        // Log access to page.
        // 
        this.LogPageAccess (
          this.ClassNameSpace + "createObject",
          this.Session.UserProfile );

        // 
        // Initialise the methods variables and objects.
        //      
        Evado.UniForm.Model.AppData clientDataObject = new Evado.UniForm.Model.AppData ( );
        this.Session.MenuItem = new EvMenuItem ( );
        this.Session.MenuItem.Guid = Evado.Digital.Model.EvcStatics.CONST_NEW_OBJECT_ID;
        this.Session.MenuItem.Group = this.Session.MenuGroupIdentifier;
        this.Session.MenuItem.Platform = this.Session.MenuPlatformId;

        this.AdapterObjects.MenuList = new List<EvMenuItem> ( );

        this.getClientData ( clientDataObject );

        //this.LogDebug ( "Exit createObject method. ID: {0}, Title: {1} ", clientDataObject.Id, clientDataObject.Title );

        return clientDataObject;

      }
      catch ( Exception Ex )
      {
        // 
        // Create the error message to be displayed to the user.
        // 
        this.ErrorMessage = EdLabels.MenuItem_Load_Page_Error_Message;

        // 
        // Generate the log the error event.
        // 
        this.LogException ( Ex );
      }

      return this.Session.LastPage; ;

    }//END method
    }//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
    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    #endregion

    #region Update User methods

    // ==================================================================================
    /// <summary>
    /// THis method saves the ResultData object updating the field values contained in the 
    /// parameter list.
    /// </summary>
    /// <param name="PageCommand">Evado.UniForm.Model.ClientClientDataObjectEvado.UniForm.Model.Command object.</param>
    /// <returns>Application Data object</returns>
    //  ----------------------------------------------------------------------------------
    private Evado.UniForm.Model.AppData getDataObject_ExitPage (
      Evado.UniForm.Model.Command PageCommand )
    {
      this.LogMethod ( "getDataObject_ExitPage" );
      this.LogValue ( "Parameter: " + PageCommand.getAsString ( false, false ) );
      // 
      // Initialise the methods variables and objects.
      //      
      Evado.UniForm.Model.AppData clientDataObject = new Evado.UniForm.Model.AppData ( );
      EvEventCodes result;

      //
      // register the user details.
      //
      result = this.RegisterUserDetails ( PageCommand );

      //
      // create the registration exit page.

      clientDataObject = this.GetUserRegistrationExitPage ( result );

      this.LogMethodEnd ( "getDataObject_ExitPage" );
      return clientDataObject;

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

      // 
      // Add the save groupCommand
      // 
      groupCommand = PageGroup.addCommand (
        EdLabels.User_Profile_Save_Command_Title,
        EuAdapter.ADAPTER_ID,
        EuAdapterClasses.Users.ToString ( ),
        Evado.UniForm.Model.ApplicationMethods.Save_Object );

      groupCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.My_User_Profile_Update_Page );

      // 
      // Define the save and delete groupCommand parameters
      // 
      groupCommand.SetGuid ( this.Session.UserProfile.Guid );

      this.LogMethodEnd ( "getDataObject_UserGroupCommands" );

    }//END getDataObject_GroupCommands method.
    }//END Method

    //================================================================================
    /// <summary>
    /// This method add the group commands to the grop.
    /// </summary>
    /// <param name="PageObject">Evado.UniForm.Model.Group object.</param>
    //  ------------------------------------------------------------------------------
    private void getDataObject_PageCommands (
      Evado.UniForm.Model.Page PageObject )
    {
      this.LogMethod ( "getDataObject_PageCommands" );
      // 
      // Initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.Command pageCommand = new Evado.UniForm.Model.Command ( );

      // 
      // Add the save groupCommand
      // 
      if ( PageObject.EditAccess == Evado.UniForm.Model.EditAccess.Enabled )
      {
        //
        // save command.
        //
        pageCommand = PageObject.addCommand (
          EdLabels.Organisation_Save_Command_Title,
          EuAdapter.ADAPTER_ID,
          EuAdapterClasses.Organisations.ToString ( ),
          Evado.UniForm.Model.ApplicationMethods.Save_Object );

        // 
        // Define the save and delete groupCommand parameters
        // 
        pageCommand.SetGuid ( this.Session.AdminOrganisation.Guid );
        pageCommand.AddParameter (
           Evado.Digital.Model.EvcStatics.CONST_SAVE_ACTION,
          EdOrganisation.ActionCodes.Save.ToString ( ) );

        this.LogDebug ( "Org GUid {0}.", this.Session.AdminOrganisation.Guid );
        this.LogDebug ( "OrgType {0}.", this.Session.AdminOrganisation.OrgType );
        //
        // Delete command
        //
        if ( this.Session.AdminOrganisation.Guid != EvStatics.CONST_NEW_OBJECT_ID
          && this.Session.AdminOrganisation.OrgType != "Evado" )
        {
          pageCommand = PageObject.addCommand (
            EdLabels.Organisation_Delete_Command_Title,
            EuAdapter.ADAPTER_ID,
            EuAdapterClasses.Organisations.ToString ( ),
            Evado.UniForm.Model.ApplicationMethods.Save_Object );

          // 
          // Define the save and delete groupCommand parameters
          // 
          pageCommand.SetGuid ( this.Session.AdminOrganisation.Guid );
          pageCommand.AddParameter (
             Evado.Digital.Model.EvcStatics.CONST_SAVE_ACTION,
            EdOrganisation.ActionCodes.Delete_Object.ToString ( ) );
        }
      }

      this.LogMethodEnd ( "getDataObject_PageCommands" );

    }//END getDataObject_GroupCommands Method
Ejemplo n.º 9
0
    //private Evado.Digital.Bll.EvApplicationEvents _Bll_ApplicationEvents = newEvado.Digital.Bll.EvApplicationEvents ( );
   
    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    #endregion

    #region Class public methods

    /// <summary>
    /// This method gets the application object from the list.
    /// 
    /// </summary>
    /// <param name="PageCommand">ClientPateEvado.UniForm.Model.Command object</param>
    /// <returns>ClientApplicationData</returns>
    //  ----------------------------------------------------------------------------------
    public virtual Evado.UniForm.Model.AppData getDataObject (
      Evado.UniForm.Model.Command PageCommand )
    {
      this.LogMethod ( "getDataObject" );
      this.LogValue ( "Parameter PageCommand " + PageCommand.getAsString ( false, false ) );

      return new Evado.UniForm.Model.AppData ( );

    }//END getSubjectObject method
    }//END getProperties_SectionsPageGroup Method

    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    #endregion

    #region Form properties Section page.

    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="PageCommand">Evado.UniForm.Model.Command object.</param>
    /// <returns>Evado.UniForm.Model.AppData object</returns>
    //  ------------------------------------------------------------------------------
    private Evado.UniForm.Model.AppData getPropertiesSectionObject (
      Evado.UniForm.Model.Command PageCommand )
    {
      this.LogMethod ( "getFormPropertiesSection" );

      // 
      // Initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.AppData clientDataObject = new Evado.UniForm.Model.AppData ( );
      Guid formGuid = Guid.Empty;
      int SectionNo = 0;

      try
      {
        string value = PageCommand.GetParameter ( EdRecordSection.FormSectionClassFieldNames.Sectn_No.ToString ( ) );
        this.LogDebug ( "Parameter value: " + value );

        if ( value != String.Empty )
        {
          if ( int.TryParse ( value, out SectionNo ) == false )
          {
            SectionNo = 0;
          }
        }

        if ( this.getSection ( SectionNo ) == false )
        {
          return null;
        }

        // 
        // Generate the client ResultData object for the UniForm client.
        // 
        this.getPropertiesSectionDataObject ( clientDataObject );

        this.LogMethodEnd ( "getFormPropertiesSection" );
        // 
        // Return the client ResultData object to the calling method.
        // 
        return clientDataObject;
      }
      catch ( Exception Ex )
      {
        // 
        // On an exception raised create the error message to be displayed to the user.
        // 
        this.ErrorMessage = EdLabels.Form_Retrieve_Error_Message;

        // 
        // Generate the log the error event.
        // 
        this.LogException ( Ex );
      }
      this.LogMethodEnd ( "getFormPropertiesSection" );
      return null;

    }//END getFormPropertiesObject method
Ejemplo n.º 11
0
 //===================================================================================
 /// <summary>
 /// This is the parameterised initialisation method for this class
 /// </summary>
 //-----------------------------------------------------------------------------------
 public AdapterCommand(
     Evado.Model.EvUserProfileBase Profile,
     Evado.UniForm.Model.Command PageCommand,
     Evado.UniForm.Model.Command ExitCommand)
 {
     this.ServiceUserProfile = Profile;
     this.PageCommand        = PageCommand;
     this.ExitCommand        = ExitCommand;
 }
    // ==================================================================================
    /// <summary>
    /// THis method saves the ResultData object updating the field values contained in the 
    /// parameter list.
    /// </summary>
    /// <param name="Parameters">List of field values to be updated.</param>
    /// <returns></returns>
    //  ----------------------------------------------------------------------------------
    private bool updateObjectValue (
      Evado.UniForm.Model.Command PageCommand )
    {
      this.LogMethod ( "updateObjectValue" );
      this.LogValue ( "Parameters.Count: " + PageCommand.Parameters.Count );
      this.LogValue ( "AdminUser.Guid: " + this.Session.AdminUserProfile.Guid );

      // 
      // Iterate through the parameter values updating the ResultData object
      // 
      foreach ( Evado.UniForm.Model.Parameter parameter in PageCommand.Parameters )
      {
        this.LogTextStart ( parameter.Name + " = " + parameter.Value );

        if ( parameter.Name.Contains ( Evado.Digital.Model.EvcStatics.CONST_GUID_IDENTIFIER ) == false
          && parameter.Name != Evado.UniForm.Model.CommandParameters.Custom_Method.ToString ( )
          && parameter.Name != Evado.UniForm.Model.CommandParameters.Page_Id.ToString ( )
          && parameter.Name != Evado.Digital.Model.EvcStatics.CONST_SAVE_ACTION
          && parameter.Name != EuUserRegistration.CONST_ADDRESS_FIELD_ID
          && parameter.Name != EuUserRegistration.CONST_CURRENT_FIELD_ID
          && parameter.Name != EuUserRegistration.CONST_NEW_PASSWORD_PARAMETER )
        {
          this.LogTextEnd ( " >> UPDATED" );
          try
          {
            Evado.Digital.Model.EdUserProfile.FieldNames fieldName =
              Evado.Model.EvStatics.parseEnumValue<Evado.Digital.Model.EdUserProfile.FieldNames> (
             parameter.Name );

            this.Session.AdminUserProfile.setValue ( fieldName, parameter.Value );

          }
          catch ( Exception Ex )
          {
            this.LogException ( Ex );

            return false;
          }
        }
        else
        {
          this.LogTextEnd ( " >> SKIPPED" );
        }

      }// End iteration loop

      //
      // IF the AD user id is empty set it to save value as the UserID.
      //
      if ( this.Session.AdminUserProfile.ActiveDirectoryUserId == String.Empty )
      {
        this.Session.AdminUserProfile.ActiveDirectoryUserId = this.Session.AdminUserProfile.UserId;
      }

      return true;

    }//END updateObjectValue 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 add the group commands to the passed group.
    /// </summary>
    /// <param name="PageObject">Evado.UniForm.Model.Page object.</param>
    //  ------------------------------------------------------------------------------
    private void addGroupCommands ( Evado.UniForm.Model.Group PageGroup )
    {
      //
      // Initialise the methods variables and objects.
      //
      Evado.UniForm.Model.Command pageCommand = new Evado.UniForm.Model.Command ( );

      if ( this._displayPage == true )
      {
        // 
        // Add the display groupCommand
        //
        pageCommand = PageGroup.addCommand (
          EdLabels.UserAdmin_Edit_Page_Command_Title,
          EuAdapter.ADAPTER_ID,
          EuAdapterClasses.Email_Templates.ToString ( ),
          Evado.UniForm.Model.ApplicationMethods.Custom_Method );

        pageCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.Get_Object );

        pageCommand.AddParameter ( EuStaticContentTemplates.CONST_DISPLAY_PAGE, "false" );

        pageCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.Email_Templates_Page );

        return;
      }
      else
      {
        // 
        // Add the display groupCommand
        //
        pageCommand = PageGroup.addCommand (
          EdLabels.UserAdmin_Display_Page_Command_Title,
          EuAdapter.ADAPTER_ID,
          EuAdapterClasses.Email_Templates.ToString ( ),
          Evado.UniForm.Model.ApplicationMethods.Custom_Method );

        pageCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.Get_Object );

        pageCommand.AddParameter ( EuStaticContentTemplates.CONST_DISPLAY_PAGE, "true" );

        pageCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.Email_Templates_Page );
      }

      // 
      // Add the save groupCommand
      //
      if ( this._displayPage == false )
      {
        pageCommand = PageGroup.addCommand (
          EdLabels.UserAdmin_Save_Command_Title,
          EuAdapter.ADAPTER_ID,
          EuAdapterClasses.Email_Templates.ToString ( ),
          Evado.UniForm.Model.ApplicationMethods.Save_Object );
      }
    }
Ejemplo n.º 15
0
    }//END getSelectionGroup method

    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="PageObject">Evado.UniForm.Model.Page object.</param>
    /// <returns>ClientApplicationData object</returns>
    //  ------------------------------------------------------------------------------
    public void getListGroup (
      Evado.UniForm.Model.Page PageObject )
    {
      this.LogMethod ( "getListGroup" );
      try
      {
        // 
        // Create the new pageMenuGroup.
        // 
        Evado.UniForm.Model.Group listGroup = PageObject.AddGroup (
          EdLabels.ApplicationEvent_List_Group_Title,
          Evado.UniForm.Model.EditAccess.Inherited );
        listGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;
        listGroup.CmdLayout = Evado.UniForm.Model.GroupCommandListLayouts.Vertical_Orientation;

        // 
        // generate the page links.
        // 
        foreach ( EvApplicationEvent applicationEvent in this.Session.ApplicationEventList )
        {
          if ( applicationEvent.UserId != this.Session.EventUserName
            && this.Session.EventUserName != String.Empty)
          {
            continue;
          }

          // 
          // Add the trial applicationEvent to the list of applicationEvents as a groupCommand.
          // 
          Evado.UniForm.Model.Command command = listGroup.addCommand (
            applicationEvent.LinkText,
            EuAdapter.ADAPTER_ID,
            EuAdapterClasses.Events.ToString ( ),
            Evado.UniForm.Model.ApplicationMethods.Get_Object );

          command.SetGuid ( applicationEvent.Guid );

        }//END trial applicationEvent list iteration loop

        this.LogValue ( "command count: " + listGroup.CommandList.Count );

      }
      catch ( Exception Ex )
      {
        // 
        // Create the error message to be displayed to the user.
        // 
        this.ErrorMessage = EdLabels.ApplicationEvent_List_Error_Message;

        // 
        // Generate the log the error event.
        // 
        this.LogException ( Ex );
      }

    }//END getListObject method.
Ejemplo n.º 16
0
    }//END getOrganisationSelection method

    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="PageObject">Evado.UniForm.Model.Page object.</param>
    /// <returns>ClientApplicationData object</returns>
    //  ------------------------------------------------------------------------------
    public void getListGroup (
      Evado.UniForm.Model.Page PageObject )
    {
      this.LogMethod ( "getListGroup" );

      // 
      // Create the new pageMenuGroup.
      // 
      Evado.UniForm.Model.Group pageGroup = PageObject.AddGroup (
        EdLabels.Organisation_List_Group_Title );
      pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;
      pageGroup.CmdLayout = Evado.UniForm.Model.GroupCommandListLayouts.Vertical_Orientation;

      // 
      // Add the save groupCommand
      // 
      Evado.UniForm.Model.Command groupCommand = pageGroup.addCommand (
        EdLabels.Organisation_New_Command_Title,
        EuAdapter.ADAPTER_ID,
        EuAdapterClasses.Organisations.ToString ( ),
        Evado.UniForm.Model.ApplicationMethods.Create_Object );

      // 
      // Define the save and delete groupCommand parameters
      // 
      groupCommand.AddParameter ( EuOrganisations.CONST_NEW_FIELD_ID, "true" );

      groupCommand.SetBackgroundColour (
        Evado.UniForm.Model.CommandParameters.BG_Default,
        Evado.UniForm.Model.Background_Colours.Purple );

      // 
      // generate the page links.
      // 
      foreach ( EdOrganisation organisation in this.Session.AdminOrganisationList )
      {
        // 
        // Add the trial organisation to the list of organisations as a groupCommand.
        // 
        Evado.UniForm.Model.Command command = pageGroup.addCommand (
          organisation.LinkText,
          EuAdapter.ADAPTER_ID,
          EuAdapterClasses.Organisations.ToString ( ),
          Evado.UniForm.Model.ApplicationMethods.Get_Object );

        command.Id = organisation.Guid;
        command.SetGuid ( organisation.Guid );

      }//END organisation list iteration loop

      this.LogValue ( "pageGroup.CommandList.Count {0}. ", pageGroup.CommandList.Count );

      this.LogMethodEnd ( "getListGroup" );

    }//END getListGroup method.
Ejemplo n.º 17
0
    }//END getClientDataObject method

    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    #endregion

    #region Class private methods

    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="PageCommand">Evado.UniForm.Model.Command object.</param>
    /// <returns>ClientApplicationData object</returns>
    //  ------------------------------------------------------------------------------
    public Evado.UniForm.Model.AppData getListObject (
      Evado.UniForm.Model.Command PageCommand )
    {
      this.LogMethod ( "getListObject" );
      try
      {
        // 
        // Initialise the methods variables and objects.
        //      
        Evado.UniForm.Model.AppData clientDataObject = new Evado.UniForm.Model.AppData ( );

        //
        // initialise the list page.
        //
        clientDataObject.Title = EdLabels.ApplicationEvent_List_Page_Title;
        clientDataObject.Page.Title = clientDataObject.Title;
        clientDataObject.Id = Guid.NewGuid ( );

        this.queryApplicatinEventLog ( );

        // 
        // Create the new pageMenuGroup.
        // 
        this.getSelectionGroup ( clientDataObject.Page );
        // 
        // Add the trial applicationEvent list to the page.
        // 
        this.getListGroup ( clientDataObject.Page );

        this.LogValue ( "data.Title: " + clientDataObject.Title );
        this.LogValue ( "data.Page.Title: " + clientDataObject.Page.Title );


        return clientDataObject;

      }
      catch ( Exception Ex )
      {
        // 
        // Create the error message to be displayed to the user.
        // 
        this.ErrorMessage = EdLabels.ApplicationEvent_List_Error_Message;

        // 
        // Generate the log the error event.
        // 
        this.LogException ( Ex );
      }

      this.LogMethodEnd ( "getListObject" );

      return this.Session.LastPage;

    }//END getListObject 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 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 updateObject method

    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    #endregion

    #region Create User methods

    // ==================================================================================
    /// <summary>
    /// THis method saves the ResultData object updating the field values contained in the 
    /// parameter list.
    /// </summary>
    /// <param name="PageCommand">Evado.UniForm.Model.Command object.</param>
    /// <returns>Application Data object</returns>
    //  ----------------------------------------------------------------------------------
    private Evado.UniForm.Model.AppData getDataObject_RegistrationPage (
      Evado.UniForm.Model.Command PageCommand )
    {
      this.LogValue ( Evado.UniForm.Model.EuStatics.CONST_METHOD_START
        + this.ClassNameSpace + "getDataObject_RegistrationPage" );
      this.LogDebug ( "AdminOrganisation.OrgId: " +this.Session.SelectedUserType.ToString() );
      this.LogDebug ( "Demo Expiry {0}", this.AdapterObjects.Settings.DemoAccountExpiryDays.ToString() );
      try
      {
        // 
        // Initialise the methods variables and objects.
        //      
        Evado.UniForm.Model.AppData clientDataObject = new Evado.UniForm.Model.AppData ( );

        // 
        // Create the milestone object and add it to the clinical session object.
        // 
        this.Session.AdminUserProfile = new Evado.Digital.Model.EdUserProfile ( );
        this.Session.AdminUserProfile.Guid = Evado.Digital.Model.EvcStatics.CONST_NEW_OBJECT_ID;
        this.Session.AdminUserProfile.ExpiryDate = DateTime.Now.AddDays (
          this.AdapterObjects.Settings.DemoAccountExpiryDays );
        this.Session.AdminUserProfile.UserId = this.createDemoUderId ( );
        this.Session.AdminUserProfile.FamilyName = this.Session.AdminUserProfile.UserId;
        this.Session.AdminUserProfile.GivenName = this.Session.AdminUserProfile.UserId;
        this.Session.AdminUserProfile.UserType = "End_User";

        this.LogDebug ( "AdminUserProfile.UserId: {0} ", this.Session.AdminUserProfile.UserId );
        this.LogDebug ( "AdminUserProfile.ExpiryDate: {0} ", this.Session.AdminUserProfile.ExpiryDate );

        this.getDataObject_RegistrationPage ( clientDataObject );

        this.LogMethodEnd ( "getDataObject_RegistrationPage" );

        return clientDataObject;

      }
      catch ( Exception Ex )
      {
        // 
        // Create the error message to be displayed to the user.
        // 
        this.ErrorMessage = EdLabels.User_Profile_Creation_Error_Message;

        // 
        // Generate the log the error event.
        // 
        this.LogException ( Ex );
      }

      this.LogMethodEnd ( "getDataObject_RegistrationPage" );
      return this.Session.LastPage; ;

    }//END method
Ejemplo n.º 21
0
    }//END createViewCommandList method

    // ==============================================================================
    /// <summary>
    /// This method appends the milestone groupCommand to the page milestone list pageMenuGroup
    /// </summary>
    /// <param name="CommandEntity">EvForm object</param>
    /// <param name="PageGroup"> Evado.UniForm.Model.Group</param>
    //  -----------------------------------------------------------------------------
    private Evado.UniForm.Model.Command getGroupListCommand (
      EdRecord CommandEntity,
      Evado.UniForm.Model.Group PageGroup,
      EdRecord.LinkContentSetting ParentLinkSetting )
    {
      this.LogMethod ( "getGroupListCommand" );
      this.LogDebug ( "CommandEntity.EntityId: " + CommandEntity.EntityId );
      this.LogDebug ( "LinkContentSetting: " + CommandEntity.Design.LinkContentSetting );
      this.LogDebug ( "TypeId: " + CommandEntity.TypeId );
      this.LogDebug ( "ParentLinkSetting: " + ParentLinkSetting );

      //
      // Set the link setting.
      //
      if ( CommandEntity.Design.LinkContentSetting == EdRecord.LinkContentSetting.Null
        && ParentLinkSetting != EdRecord.LinkContentSetting.Null )
      {
        CommandEntity.Design.LinkContentSetting = ParentLinkSetting;
      }

      this.LogDebug ( "FINAL: LinkContentSetting: " + CommandEntity.Design.LinkContentSetting );
      this.LogDebug ( "CommandTitle: " + CommandEntity.CommandTitle );
      this.LogDebug ( "getFirstTextField: " + CommandEntity.getFirstTextField ( ) );

      //
      // Define the pageMenuGroup groupCommand.
      //
      Evado.UniForm.Model.Command groupCommand = PageGroup.addCommand (
          CommandEntity.CommandTitle,
          EuAdapter.ADAPTER_ID,
          EuAdapterClasses.Entities,
          Evado.UniForm.Model.ApplicationMethods.Get_Object );

      groupCommand.Id = CommandEntity.Guid;
      groupCommand.SetGuid ( CommandEntity.Guid );

      groupCommand.AddParameter (
        Evado.UniForm.Model.CommandParameters.Short_Title,
        EdLabels.Label_Record_Id + CommandEntity.RecordId );
      if ( CommandEntity.ImageFileName != String.Empty )
      {
        string relativeURL = EuAdapter.CONST_IMAGE_FILE_DIRECTORY + CommandEntity.ImageFileName;
        groupCommand.AddParameter ( Evado.UniForm.Model.CommandParameters.Image_Url, relativeURL );
      }

      if ( this.Session.UserProfile.hasAdministrationAccess == true )
      {
        groupCommand.Title = CommandEntity.EntityId + " >> " + groupCommand.Title;
      }

      return groupCommand;

    }//END getGroupListCommand method
    }//END method

    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    #endregion

    #region Class update  object methods

    // ==================================================================================
    /// <summary>
    /// THis method saves the ResultData object updating the field values contained in the 
    /// parameter list.
    /// </summary>
    /// <param name="PageCommand">Evado.UniForm.Model.ClientClientDataObjectEvado.UniForm.Model.Command object.</param>
    /// <returns>Application Data object</returns>
    //  ----------------------------------------------------------------------------------
    private bool updateObject ( Evado.UniForm.Model.Command PageCommand )
    {
      try
      {
        this.LogMethod ( "updateObject" );
        this.LogValue ( "Parameter PageEvado.UniForm.Model.Command: " + PageCommand.getAsString ( false, true ) );

        // 
        // Log access to page.
        // 
        this.LogPageAccess (
        this.ClassNameSpace + "updateObject",
          this.Session.UserProfile );

        // 
        // Delete the object.
        // 
        if ( PageCommand.Method == Evado.UniForm.Model.ApplicationMethods.Delete_Object )
        {
          return true;
        }

        // 
        // Update the object.
        // 
        this.updateObjectValue ( PageCommand );




        bool result = EvStatics.Files.saveFile<EvStaticContentTemplates> (
          this.AdapterObjects.ApplicationPath,
          EuStaticContentTemplates.CONST_EMAIL_TEMPLATE_FILENAME,
          this.AdapterObjects.ContentTemplates );

        return true;

      }
      catch ( Exception Ex )
      {
        // 
        // Create the error message to be displayed to the user.
        // 
        this.ErrorMessage = "Error raised saving the email template page..";

        // 
        // Generate the log the error event.
        // 
        this.LogException ( Ex );
      }
      return false;

    }//END method
Ejemplo n.º 23
0
    }//END getOrganisationList method.

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

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

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

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

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

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

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

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


      this.LogMethodEnd ( "getOrganisationSelection" );

    }//END getOrganisationSelection method
    }//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 updateObjectValue method.

    // ==================================================================================
    /// <summary>
    /// THis method saves the ResultData object updating the field values contained in the 
    /// parameter list.
    /// </summary>
    /// <param name="PageCommand">Evado.UniForm.Model.Command updated.</param>
    /// <returns></returns>
    //  ----------------------------------------------------------------------------------
    private void updateUserAddressValue (
      Evado.UniForm.Model.Command PageCommand )
    {
      this.LogMethod ( "updateAddressValue" );
      this.LogDebug ( "Parameters.Count: " + PageCommand.Parameters.Count );

      //
      // Get the organisation's address 
      //
      String stAddress = PageCommand.GetParameter ( EuUserProfiles.CONST_ADDRESS_FIELD_ID );

      //
      // If there is no address object exit.
      //
      if ( stAddress == String.Empty )
      {
        this.LogDebug ( "Address string empty" );
        this.LogMethodEnd ( "updateAddressValue" );
        return;
      }

      if ( stAddress.Contains ( ";" ) == false )
      {
        this.LogDebug ( "Address missing delimiters." );
        this.LogMethodEnd ( "updateAddressValue" );
        return;
      }

      String [ ] arAddress = stAddress.Split ( ';' );

      this.LogDebug ( "Address array length is {0}.", arAddress.Length );
      if ( arAddress.Length > 5 )
      {
        this.Session.UserProfile.Address_1 = arAddress [ 0 ];
        this.Session.UserProfile.Address_2 = arAddress [ 1 ];
        this.Session.UserProfile.AddressCity = arAddress [ 2 ];
        this.Session.UserProfile.AddressState = arAddress [ 3 ];
        this.Session.UserProfile.AddressPostCode = arAddress [ 4 ];
        this.Session.UserProfile.AddressCountry = arAddress [ 5 ];
      }
      this.LogMethodEnd ( "updateAddressValue" );

    }//END updateAddressValue Method
    }//END updateAddressValue Method

    // ==================================================================================
    /// <summary>
    /// THis method saves the ResultData object updating the field values contained in the 
    /// parameter list.
    /// </summary>
    /// <param name="PageCommand">Evado.UniForm.Model.Command updated.</param>
    /// <returns></returns>
    //  ----------------------------------------------------------------------------------
    private void updateOrganisationValues (
      Evado.UniForm.Model.Command PageCommand )
    {
      this.LogMethod ( "updateOrganisationValues" );
      this.LogDebug ( "Parameters.Count: " + PageCommand.Parameters.Count );

      /// 
      /// Iterate through the parameter values updating the ResultData object
      /// 
      foreach ( Evado.UniForm.Model.Parameter parameter in PageCommand.Parameters )
      {
        if ( parameter.Name.Contains ( EuUserProfiles.CONST_ORG_PREFIX ) == true )
        {
          string orgFieldName = parameter.Name.Replace ( EuUserProfiles.CONST_ORG_PREFIX, String.Empty );

          this.LogDebug ( orgFieldName + " = " + parameter.Value + " >> UPDATED" );
          try
          {
            EdOrganisation.FieldNames fieldName =
               Evado.Model.EvStatics.parseEnumValue<EdOrganisation.FieldNames> (
              orgFieldName );

            this.Session.Organisation.setValue ( fieldName, parameter.Value );

          }
          catch ( Exception Ex )
          {
            this.LogException ( Ex );
          }
        }
        else
        {
          this.LogDebug ( parameter.Name + " > " + parameter.Value + " >> SKIPPED" );
        }

      }// End iteration loop
      this.LogMethodEnd ( "updateOrganisationValues" );

    }//END updateOrganisationValues Method
Ejemplo n.º 27
0
    }//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
    }//END method


    // ==================================================================================
    /// <summary>
    /// THis method updates the organisation object.
    /// </summary>
    //  ----------------------------------------------------------------------------------
    private EvEventCodes saveUserProfile ( Evado.UniForm.Model.Command PageCommand )
    {
      this.LogMethod ( "saveUserProfile" );
      //
      // Initialise the methods variables and objecs.
      //

      // 
      // Get the save action message value.
      // 
      String stSaveAction = PageCommand.GetParameter ( Evado.Digital.Model.EvcStatics.CONST_SAVE_ACTION );

      // 
      // update the object.
      // 
      var result = this._Bll_UserProfiles.saveItem ( this.Session.UserProfile );

      // 
      // get the debug ResultData.
      // 
      this.LogDebugClass ( this._Bll_UserProfiles.Log );

      // 
      // if an error state is returned create log the event.
      //
      if ( result != EvEventCodes.Ok )
      {
        string StEvent = this._Bll_UserProfiles.Log + " returned error message: " + Evado.Digital.Model.EvcStatics.getEventMessage ( result );
        this.LogError ( EvEventCodes.Database_Record_Update_Error, StEvent );

        this.ErrorMessage = EdLabels.User_Profile_Save_Error_Message;

        return result;
      }

      this.LogMethodEnd ( "saveUserProfile" );
      return EvEventCodes.Ok;
    }//ENd saveUserProfile method
    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="PageCommand">Evado.UniForm.Model.Command object.</param>
    /// <returns>ClientApplicationData object</returns>
    //  ------------------------------------------------------------------------------
    private Evado.UniForm.Model.AppData getObject_MyUserProfile (
      Evado.UniForm.Model.Command PageCommand )
    {
      this.LogMethod ( "getObject_MyUserProfile" );
      // 
      // Initialise the methods variables and objects.
      // 
      Guid subjectGuid = Guid.Empty;
      Evado.UniForm.Model.AppData clientDataObject = new Evado.UniForm.Model.AppData ( );

      try
      {
        // 
        // return the client ResultData object for the customer.
        // 
        this.getDataObject_MUP_Page ( clientDataObject );

        this.LogMethodEnd ( "getObject_MyUserProfile" );
        return clientDataObject;
      }
      catch ( Exception Ex )
      {
        // 
        // Create the error message to be displayed to the user.
        // 
        this.ErrorMessage = EdLabels.User_Profile_Page_Error_Message;

        // 
        // Generate the log the error event.
        // 
        this.LogException ( Ex );
      }

      this.LogMethodEnd ( "getObject_MyUserProfile" );
      return this.Session.LastPage;

    }//END getObject method
    }//END method

    // ==================================================================================
    /// <summary>
    /// THis method saves the ResultData object updating the field values contained in the 
    /// parameter list.
    /// </summary>
    /// <param name="Parameters">List of field values to be updated.</param>
    /// <returns></returns>
    //  ----------------------------------------------------------------------------------
    private void updateObjectValue ( Evado.UniForm.Model.Command PageCommand )
    {
      this.LogMethod ( "updateObjectValue" );
      this.LogValue ( " Parameters.Count: " + PageCommand.Parameters.Count );

      /// 
      /// Iterate through the parameter values updating the ResultData object
      /// 
      foreach ( Evado.UniForm.Model.Parameter parameter in PageCommand.Parameters )
      {
        this.LogTextStart ( parameter.Name + " > " + parameter.Value );

        if ( parameter.Name.Contains (  Evado.Digital.Model.EvcStatics.CONST_GUID_IDENTIFIER ) == false
          && parameter.Name != Evado.UniForm.Model.CommandParameters.Custom_Method.ToString ( )
          && parameter.Name !=  Evado.Digital.Model.EvcStatics.CONST_SAVE_ACTION )
        {
          this.LogText ( ">> UPDATED" );

          try
          {
            EvStaticContentTemplates.ClassFieldNames fieldName =
               Evado.Model.EvStatics.parseEnumValue<EvStaticContentTemplates.ClassFieldNames> (
              parameter.Name );

            this.AdapterObjects.ContentTemplates.setValue ( fieldName, parameter.Value );

          }
          catch ( Exception Ex )
          {
            this.LogException ( Ex );
          }
        }
        this.LogTextEnd ( "" );

      }// End iteration loop

    }//END updateObjectValue method.