コード例 #1
0
    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    #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.Model.UniForm.Command object.</param>
    /// <returns>Application Data object</returns>
    //  ----------------------------------------------------------------------------------
    private Evado.Model.UniForm.AppData getDataObject_ExitPage (
      Evado.Model.UniForm.Command PageCommand )
    {
      this.LogMethod ( "getDataObject_ExitPage" );
      this.LogValue ( "Parameter: " + PageCommand.getAsString ( false, false ) );
      // 
      // Initialise the methods variables and objects.
      //      
      Evado.Model.UniForm.AppData clientDataObject = new Model.UniForm.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
コード例 #2
0
    }//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.Model.UniForm.Command object.</param>
    /// <returns>Application Data object</returns>
    //  ----------------------------------------------------------------------------------
    private Evado.Model.UniForm.AppData getDataObject_RegistrationPage (
      Evado.Model.UniForm.Command PageCommand )
    {
      this.LogValue ( Evado.Model.UniForm.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.Model.UniForm.AppData clientDataObject = new Model.UniForm.AppData ( );

        // 
        // Create the milestone object and add it to the clinical session object.
        // 
        this.Session.AdminUserProfile = new Evado.Model.Digital.EdUserProfile ( );
        this.Session.AdminUserProfile.Guid = Evado.Model.Digital.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.TypeId = EdUserProfile.UserTypesList.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
コード例 #3
0
    }//END RegisterUserDetails method

    // ==================================================================================
    /// <summary>
    /// THis method validates that the user id is not duplicated in the ADS
    /// </summary>
    /// <returns>Application Data object</returns>
    //  ----------------------------------------------------------------------------------
    private Evado.Model.UniForm.AppData GetUserRegistrationExitPage (
      EvEventCodes UpdateResult )
    {
      this.LogMethod ( "GetUserRegistrationExitPage method" );
      //
      // Initialise the methods variables and objects.
      //
      Evado.Model.UniForm.AppData clientDataObject = new Model.UniForm.AppData ( );
      String groupDescription = this.AdapterObjects.ContentTemplates.DemoRegistrationConfirmation;

      if ( UpdateResult != EvEventCodes.Ok )
      {
        this.LogDebug ( "ERROR: Update Result Error: {0}", UpdateResult );

        groupDescription = this.AdapterObjects.ContentTemplates.DemoRegistrationError;
      }

      //
      // set the client ResultData object properties
      //
      clientDataObject.Id = this.Session.AdminUserProfile.Guid;
      clientDataObject.Page.Id = this.Session.AdminUserProfile.Guid;
      clientDataObject.Title = EdLabels.User_Profile_Page_Title
        + this.Session.AdminUserProfile.CommonName;

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

      var pageGroup = clientDataObject.Page.AddGroup (
        String.Empty,
        Model.UniForm.EditAccess.Disabled );
      pageGroup.Layout = Evado.Model.UniForm.GroupLayouts.Full_Width;

      //
      // Define the markdown options.
      //
      MarkdownSharp.MarkdownOptions markDownOptions = new MarkdownSharp.MarkdownOptions ( );
      markDownOptions.AutoHyperlink = true;
      markDownOptions.AutoNewlines = true;
      markDownOptions.EmptyElementSuffix = "/>";
      markDownOptions.EncodeProblemUrlCharacters = true;
      markDownOptions.LinkEmails = true;
      markDownOptions.StrictBoldItalic = true;

      //
      // Initialise the markdown class
      //
      MarkdownSharp.Markdown markDown = new MarkdownSharp.Markdown ( markDownOptions );

      //
      // perform the html body transformation.
      //
      string description = markDown.Transform ( groupDescription );

      pageGroup.Description = description;


      this.LogMethodEnd ( "GetUserRegistrationExitPage" );
      return clientDataObject;
    }
コード例 #4
0
    }//END getDataObject_ExitPage method

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

        // 
        // Update the object.
        // 
        if ( this.updateObjectValue ( PageCommand ) == false )
        {
          this.ErrorMessage = EdLabels.UserProfile_Value_Update_Error_Message;

          this.LogMethodEnd ( "RegisterUserDetails" );
          return EvEventCodes.Value_Update_Processing_Error;
        }

        this.LogValue ( "Guid: " + this.Session.AdminUserProfile.Guid );
        this.LogValue ( "UserId: " + this.Session.AdminUserProfile.UserId );
        this.LogValue ( "CommonName: " + this.Session.AdminUserProfile.CommonName );

        this.Session.AdminUserProfile.UserId = EvStatics.CleanSamUserId (
          this.Session.AdminUserProfile.UserId );

        if ( PageCommand.hasParameter ( EuDemoUserRegistration.CONST_NEW_PASSWORD_PARAMETER ) == true )
        {
          this.LogValue ( "Creating a new password." );
          this.createDefaultPassword ( );
        }

        this.LogValue ( "AdminUserProfile.Password: "******"RegisterUserDetails" );
          return result;
        }

        this.LogMethodEnd ( "RegisterUserDetails" );

        return EvEventCodes.Ok;

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

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

      this.LogMethodEnd ( "RegisterUserDetails" );
      return EvEventCodes.Database_Record_Update_Error;

    }//END RegisterUserDetails method