}//END setUserRecordAccess

    // ==============================================================================
    /// <summary>
    /// This method creates a save groupCommand.
    /// </summary>
    /// <returns>Evado.Model.UniForm.Command object</returns>
    //  ------------------------------------------------------------------------------
    private Evado.Model.UniForm.Command createRecordSaveCommand (
      Guid RecordGuid,
      String Title,
      String SaveAction )
    {
      this.LogMethod ( "createRecordSaveCommand" );
      //
      // Initialise the methods variables and objects.
      // 
      Evado.Model.UniForm.Parameter parameter = new Evado.Model.UniForm.Parameter ( );

      // 
      // initialise the save groupCommand.
      // 
      Evado.Model.UniForm.Command saveCommand = new Evado.Model.UniForm.Command (
        Title,
        EuAdapter.APPLICATION_ID,
        EuAdapterClasses.Ancillary_Record.ToString ( ),
        Evado.Model.UniForm.ApplicationMethods.Save_Object );


      // 
      // Define the groupCommand parameters.
      // 
      parameter = new Evado.Model.UniForm.Parameter ( "Guid", RecordGuid.ToString ( ) );
      saveCommand.Parameters.Add ( parameter );

      parameter = new Evado.Model.UniForm.Parameter ( "SaveAction", SaveAction );
      saveCommand.Parameters.Add ( parameter );

      return saveCommand;

    }//END createRecordSaveCommand method
Example #2
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
Example #3
0
    // ==================================================================================
    /// <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.Model.UniForm.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.Model.UniForm.Parameter parameter in PageCommand.Parameters )
      {
        this.LogTextStart ( parameter.Name + " = " + parameter.Value );

        if ( parameter.Name.Contains ( Evado.Model.Digital.EvcStatics.CONST_GUID_IDENTIFIER ) == false
          && parameter.Name != Evado.Model.UniForm.CommandParameters.Custom_Method.ToString ( )
          && parameter.Name != Evado.Model.UniForm.CommandParameters.Page_Id.ToString ( )
          && parameter.Name != Evado.Model.Digital.EvcStatics.CONST_SAVE_ACTION
          && parameter.Name != EuDemoUserRegistration.CONST_ADDRESS_FIELD_ID
          && parameter.Name != EuDemoUserRegistration.CONST_CURRENT_FIELD_ID
          && parameter.Name != EuDemoUserRegistration.CONST_NEW_PASSWORD_PARAMETER )
        {
          this.LogTextEnd ( " >> UPDATED" );
          try
          {
            Evado.Model.Digital.EdUserProfile.UserProfileFieldNames fieldName =
              Evado.Model.EvStatics.parseEnumValue<Evado.Model.Digital.EdUserProfile.UserProfileFieldNames> (
             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.
Example #4
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
Example #5
0
    }//END getListObject_Selection_Group method

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

        // 
        // generate the page links.
        // 
        foreach ( EvAlert alert in _AlertView )
        {
          String stAlertTite = alert.Subject;
          Evado.Model.UniForm.Command command = listGroup.addCommand ( stAlertTite,
            EuAdapter.APPLICATION_ID,
            EuAdapterClasses.Alert.ToString ( ),
            Model.UniForm.ApplicationMethods.Get_Object );

          command.SetGuid (alert.Guid );

        }//END Alert list iteration loop

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

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

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

    }//END getListObject method.
    }//END getClientDataObject Method

    //===================================================================================
    /// <summary>
    /// This method generates the relevant page commands for the milestone record page.
    /// </summary>
    /// <param name="PageObject">Evado.Model.UniForm.Page object</param>
    //-----------------------------------------------------------------------------------
    private void getClientDataObject_PageCommands (
      Evado.Model.UniForm.Page PageObject )
    {
      this.LogMethod ( "getClientDataObject_PageCommands" );
      //
      // Set the page access and commands based on the user role and the record state.
      //
      switch ( this.Session.AncillaryRecord.State )
      {
        case EvFormObjectStates.Draft_Record:
        case EvFormObjectStates.Queried_Record:
        case EvFormObjectStates.Submitted_Record:
          {
            if ( this.Session.UserProfile.hasRecordEditAccess == true )
            {
              PageObject.EditAccess = Evado.Model.UniForm.EditAccess.Enabled;

              // 
              // Add the save groupCommand and add it to the groupCommand list.
              // 
              Evado.Model.UniForm.Command saveCommand =  PageObject.addCommand( this.createRecordSaveCommand (
                this.Session.AncillaryRecord.Guid,
                EvLabels.Ancillary_Record_Save_Command_Title,
                EvAncillaryRecords.ACTION_SAVE ) );
              /*
              // 
              // Add the create groupCommand and add it to the groupCommand list.
              // 
              Evado.Model.UniForm.Command submitRecord = PageObject.addCommand( this.createRecordSaveCommand (
                this.SessionObjects.AncillaryRecord.Guid,
                EvLabels.Ancillary_Record_Submit_Command_Title,
                EvAncillaryRecords.ACTION_SIGNED ) );
               */
            }
            break;
          }
        default:
          {
            PageObject.EditAccess = Evado.Model.UniForm.EditAccess.Enabled;
            break;
          }
      }//END switch

      this.LogMethodEnd ( "getClientDataObject_PageCommands" );

    }//END getClientDataObject_PageCommands method
    }//END getProjectPage_SignoffLog Method

    // ==================================================================================
    /// <summary>
    /// THis method saves the ResultData object updating the field values contained in the 
    /// parameter list.
    /// </summary>
    /// <param name="Command">Evado.Model.UniForm.Command object.</param>
    /// <returns>Application Data object</returns>
    //  ----------------------------------------------------------------------------------
    private Evado.Model.UniForm.AppData createObject (
      Evado.Model.UniForm.Command Command )
    {
      try
      {
        this.LogMethod ( "createObject" );
        // 
        // Initialise the methods variables and objects.
        //      
        Evado.Model.UniForm.AppData data = new Evado.Model.UniForm.AppData ( );
        this.Session.AncillaryRecord = new EvAncillaryRecord ( );
        this.Session.AncillaryRecord.Guid =  Evado.Model.Clinical.EvcStatics.CONST_NEW_OBJECT_ID;
        this.Session.AncillaryRecord.State = EvFormObjectStates.Draft_Record;
        this.Session.AncillaryRecord.RecordDate = DateTime.Now;

        // 
        // Log access to page.
        // 
        this.LogPageAccess (
          "Evado.UniForm.Clinical.SubjectRecords.createObject",
          this.Session.UserProfile );

        this.getClientDataObject ( data );


        this.LogValue ( "Exit createObject method. ID: " + data.Id + ", Title: " + data.Title );

        return data;

      }
      catch ( Exception Ex )
      {
        // 
        // Create the error message to be displayed to the user.
        // 
        this.ErrorMessage = "Error raised when creating a subject record.";

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

      return null;

    }//END method
Example #8
0
    }//END getTrialAlertObject method

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

    #region Class private methods

    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="ClientDataObject">Evado.Model.UniForm.AppData object.</param>
    /// <remarks>
    /// This method consists of following steps:
    /// 
    /// 1. Based on the selection of ALert Type, redirect the user to the specific object
    /// </remarks>
    //  ------------------------------------------------------------------------------
    private void generateRedirection ( 
      Evado.Model.UniForm.AppData ClientDataObject )
    {
      this.LogMethod ( "generateRedirectionCommand" );
      //
      // If the save action is not acknowledgement exit.
      //
      if ( this.Session.Alert.Action != EvAlert.AlertSaveActionCodes.Acknowledge_Alert )
      {
        this.LogMethodEnd ( "generateRedirectionCommand" );
        return;
      }

      this.LogValue ( "Alert.TypeId: " + this.Session.Alert.TypeId );
      this.LogValue ( "Alert.RecordId: " + this.Session.Alert.RecordId );

      //
      // Initialise the methods variables and objects.
      //
      Evado.Model.UniForm.Command groupCommand =  ClientDataObject.Page.Exit;

      //
      // based on the alert type redirect the user to the relevant object.
      switch ( this.Session.Alert.TypeId )
      {
        case EvAlert.AlertTypes.Trial_Record:
          {
            groupCommand = new Model.UniForm.Command (
              EvLabels.Label_Record,
              EuAdapter.APPLICATION_ID,
              EuAdapterClasses.Records.ToString ( ),
              Model.UniForm.ApplicationMethods.Get_Object );

            groupCommand.AddParameter ( EvIdentifiers.RECORD_ID, this.Session.Alert.RecordId );

            break;
          }

      }//END alert type switch

      ClientDataObject.Page.Exit = groupCommand;

      this.LogMethodEnd ( "generateRedirectionCommand" );

    }//ENd generateRedirectionCommand method
Example #9
0
    // ==================================================================================
    /// <summary>
    /// THis method saves the ResultData object updating the field values contained in the 
    /// parameter list.
    /// </summary>
    /// <param name="Command">Evado.Model.UniForm.Command object.</param>
    /// <returns>Application Data object</returns>
    //  ----------------------------------------------------------------------------------
    private Evado.Model.UniForm.AppData createObject ( Evado.Model.UniForm.Command Command )
    {
      try
      {
        this.LogMethod ( "createObject" );

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

        // 
        // Initialise the methods variables and objects.
        //      
        Evado.Model.UniForm.AppData data = new Evado.Model.UniForm.AppData ( );
        this.Session.Alert = new EvAlert ( );
        this.Session.Alert.Guid =  Evado.Model.Digital.EvcStatics.CONST_NEW_OBJECT_ID;

        this.getClientDataObject ( data );


        this.LogDebug ( "Exit createObject method. ID: " + data.Id + ", Title: " + data.Title );

        return data;

      }
      catch ( Exception Ex )
      {
        // 
        // Create the error message to be displayed to the user.
        // 
        this.ErrorMessage = "Error raised when creating a trial site.";

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

      return this.Session.LastPage;

    }//END method
Example #10
0
    }//END getDataObject_FieldGroup Method

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

      // 
      // Add the save groupCommand
      // 
      groupCommand = PageGroup.addCommand (
        EdLabels.Demo_Registration_Save_Command_Title,
        EuAdapter.ADAPTER_ID,
        EuAdapterClasses.User_Registration.ToString ( ),
        Evado.Model.UniForm.ApplicationMethods.Custom_Method );

      groupCommand.setCustomMethod ( Model.UniForm.ApplicationMethods.Get_Object );

      groupCommand.SetPageId ( EdStaticPageIds.Demo_User_Exit_Page );

      this.LogMethodEnd ( "getDataObject_GroupCommands" );
    }//END getDataObject_GroupCommands method.
Example #11
0
    }//ENd generateRedirectionCommand method

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

        // 
        // If the user does not have monitor or ResultData manager roles exit the page.
        // 
        if ( this.Session.UserProfile.hasMultiSiteAccess == false
          && this.Session.UserProfile.hasRecordAccess == false )
        {
          this.LogIllegalAccess (
            this.ClassNameSpace + "getListObject",
            this.Session.UserProfile );

          this.ErrorMessage = EvLabels.Record_Access_Error_Message;

          return this.Session.LastPage;
        }

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

        //
        // Initialise the client ResultData object.
        //
        clientDataObject.Title = EvLabels.Alert_View_Page_Title;
        clientDataObject.Page.Title = clientDataObject.Title;
        clientDataObject.Id = Guid.NewGuid ( );
        this.Session.AlertType = EvAlert.AlertTypes.Null;
        this.Session.AlertState = EvAlert.AlertStates.Not_Closed;
        string stValue = String.Empty;

        this.LogValue ( "data.Title: " + clientDataObject.Title );
        this.LogValue ( "data.Page.Title: " + clientDataObject.Page.Title );
        // 
        // get the groupCommand parameters.
        // 
        stValue = PageCommand.GetParameter ( EuAlerts.CONST_ALERT_TYPE );
        this.Session.AlertType =  Evado.Model.Digital.EvcStatics.Enumerations.parseEnumValue<EvAlert.AlertTypes> ( stValue );

        stValue = PageCommand.GetParameter ( EuAlerts.CONST_ALERT_STATE );
        this.Session.AlertState =  Evado.Model.Digital.EvcStatics.Enumerations.parseEnumValue<EvAlert.AlertStates> ( stValue );

        // 
        // Query and database.
        // 
        this._AlertView = this._Bll_Alerts.getView (
          this.Session.Application,
          new EvOrganisation(),
          this.Session.UserProfile,
          this.Session.AlertState,
          this.Session.AlertType);

        this.LogValue ( this._Bll_Alerts.Log );

        // 
        // bind output to the datagrid.
        // 
        if ( _AlertView.Count == 0 )  // If nothing returned create a blank row.
        {
          _AlertView.Add ( new EvAlert ( ) );
        }

        //
        // add the alert selection pageMenuGroup.
        //
        this.getListObject_Selection_Group ( clientDataObject.Page );

        // 
        // Add the alert list to the page.
        // 
        this.getListObject_List_Group ( clientDataObject.Page );


        return clientDataObject;

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

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

      return this.Session.LastPage;

    }//END getListObject method.
Example #12
0
    }//END getStreamedVideoField method.

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

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

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

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

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


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

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

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

    }//END getDataObject_FieldGroup Method
    }//END getListObject method.

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

      //
      // Determine if the user has access to this page and log and error if they do not.
      //
      if ( this.Session.UserProfile.hasRecordAccess == false )
      {
        this.LogIllegalAccess (
          "Evado.UniForm.Clinical.AncilliaryRecords.getObject",
          this.Session.UserProfile );

        this.ErrorMessage = EvLabels.Illegal_Page_Access_Attempt;

        return null;
      }

      // 
      // Log access to page.
      // 
      this.LogPageAccess (
        "Evado.UniForm.Clinical.AncilliaryRecords.getObject",
        this.Session.UserProfile );

      // 
      // if the parameter value exists then set the customerId
      // 
      RecordGuid = PageCommand.GetGuid ( );
      this.LogValue ( "RecordGuid: " + RecordGuid );

      // 
      // return if not trial id
      // 
      if ( RecordGuid == Guid.Empty )
      {
        this.LogValue ( "Record GUID is empty." );
        return null;
      }

      this.LogValue ( "Record exists" );

      try
      {
        // 
        // Retrieve the customer object from the database via the DAL and BLL layers.
        // 
        this.Session.AncillaryRecord = this._Bll_AncillaryRecords.getRecord ( RecordGuid );

        this.LogValue ( this._Bll_AncillaryRecords.DebugLog );

        this.LogValue ( "SubjectRecord.RecordId: "
          + this.Session.AncillaryRecord.RecordId );

        // 
        // return the client ResultData object for the customer.
        // 
        this.getClientDataObject ( clientDataObject );

        this.LogMethodEnd ( "getObject" );

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

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

      this.LogMethodEnd ( "getObject" );
      return null;

    }//END getObject method
    }//END getClientDataObject method

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

    #region Class private methods

    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="PageCommand">Evado.Model.UniForm.Command object.</param>
    /// <returns>Evado.Model.UniForm.AppData object</returns>
    //  ------------------------------------------------------------------------------
    private Evado.Model.UniForm.AppData getListObject (
      Evado.Model.UniForm.Command PageCommand )
    {
      try
      {
        this.LogMethod ( "getListObject" );
        this.LogValue ( "UserProfile.CommonName: " + this.Session.UserProfile.CommonName );

        //
        // Determine if the user has access to this page and log and error if they do not.
        //
        if ( this.Session.UserProfile.hasRecordAccess == false )
        {
          this.LogIllegalAccess (
            "Evado.UniForm.Clinical.AncilliaryRecords.getObject",
            this.Session.UserProfile );

          this.ErrorMessage = EvLabels.Illegal_Page_Access_Attempt;

          return null;
        }

        // 
        // Log access to page.
        // 
        this.LogPageAccess (
          "Evado.UniForm.Clinical.AncilliaryRecords.getListObject",
          this.Session.UserProfile );

        // 
        // Initialise the methods variables and objects.
        //      
        Evado.Model.UniForm.AppData clientDataObject = new Evado.Model.UniForm.AppData ( );
        Evado.Model.UniForm.Command groupCommand = new Model.UniForm.Command ( );
        Evado.Model.UniForm.Group pageGroup = new Model.UniForm.Group ( );

        clientDataObject.Title = EvLabels.Ancillary_Record_List_Page_Title;
        clientDataObject.Page.Title = clientDataObject.Title;
        clientDataObject.Id = Guid.NewGuid ( );
        this.LogValue ( "data.Page.Title: " + clientDataObject.Page.Title );

        // 
        // Create the new pageMenuGroup.
        // 
        pageGroup = clientDataObject.Page.AddGroup (
        EvLabels.Ancillary_Record_List_Page_Group_Title,
        Evado.Model.UniForm.EditAccess.Enabled );
        pageGroup.CmdLayout = Evado.Model.UniForm.GroupCommandListLayouts.Vertical_Orientation;
        pageGroup.Layout = Evado.Model.UniForm.GroupLayouts.Full_Width;

        if ( this.Session.UserProfile.hasRecordEditAccess == true )
        {
          groupCommand = pageGroup.addCommand ( 
            EvLabels.Ancillary_Record_Add_Record_Command_Title, 
            EuAdapter.APPLICATION_ID, 
            EuAdapterClasses.Ancillary_Record.ToString ( ),
            Model.UniForm.ApplicationMethods.Create_Object );

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

        // 
        // get the list of customers.
        // 
        List<EvAncillaryRecord> siteList = this._Bll_AncillaryRecords.getView (
          this.Session.Trial.TrialId,
          this.Session.Subject.SubjectId,
          String.Empty,
         String.Empty );

        this.LogValue ( this._Bll_AncillaryRecords.DebugLog );
        this.LogValue ( "list count: " + siteList.Count );

        // 
        // generate the page links.
        // 
        foreach ( EvAncillaryRecord ancillaryRecord in siteList )
        {

          groupCommand = pageGroup.addCommand(
            ancillaryRecord.RecordId, 
            EuAdapter.APPLICATION_ID,
            EuAdapterClasses.Ancillary_Record.ToString ( ),
            Evado.Model.UniForm.ApplicationMethods.Get_Object );

          groupCommand.SetGuid(  ancillaryRecord.Guid );

          groupCommand.Title = ancillaryRecord.Subject
            + EvLabels.Space_Open_Bracket
            + EvLabels.Label_Date
            + ancillaryRecord.stRecordDate
            + EvLabels.Space_Close_Bracket;
        }//END ancillary command iteration loop.

        if ( pageGroup.CommandList.Count == 0 )
        {
          pageGroup.Description = EvLabels.Ancillary_Record_List_Page_No_Records_Label ;
        }


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

        return clientDataObject;

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

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

      return null;

    }//END getListObject method.
    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    #endregion

    #region Class public methods

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

      try
      {
        // 
        // Initialise the methods variables and objects.
        // 
        Evado.Model.UniForm.AppData clientDataObject = new Evado.Model.UniForm.AppData ( );

        String stViewType = PageCommand.GetParameter ( Evado.Model.UniForm.CommandParameters.Page_Id.ToString ( ) );

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

        // 
        // Determine the method to be called
        // 
        switch ( PageCommand.Method )
        {
          case Evado.Model.UniForm.ApplicationMethods.List_of_Objects:
            {
              clientDataObject = this.getListObject ( PageCommand ); 
              
              break;
            }
          case Evado.Model.UniForm.ApplicationMethods.Get_Object:
            {
              clientDataObject = this.getObject ( PageCommand );

              break;
            }
          case Evado.Model.UniForm.ApplicationMethods.Create_Object:
            {
              clientDataObject = this.createObject ( PageCommand );

              break;
            }
          case Evado.Model.UniForm.ApplicationMethods.Save_Object:
          case Evado.Model.UniForm.ApplicationMethods.Delete_Object:
            {
              this.LogValue ( " Save Object method" );
              // 
              // Update the object values
              // 
              clientDataObject = this.updateObject ( PageCommand );

              break;
            }

        }//END Switch

        // 
        // Handle returned exceptions.
        // 
        if ( clientDataObject == null )
        {
          this.LogValue ( " null application data returned." );

          clientDataObject = this.Session.LastPage;
        }

        //
        // If an errot message exist display it.
        //
        if ( this.ErrorMessage != String.Empty )
        {
          clientDataObject.Message = this.ErrorMessage;
        }

        // 
        // return the client ResultData object.
        // 
        return clientDataObject;

      }
      catch ( Exception Ex )
      {
        this.LogException ( Ex );
      }
      return this.Session.LastPage;

    }//END getClientDataObject method
Example #16
0
    }//END method

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

        this.LogDebug ( "Clinical.Alert: " );
        this.LogDebug ( "Guid: " + this.Session.Alert.Guid );
        this.LogDebug ( "ProjectId: " + this.Session.Alert.ProjectId );
        this.LogDebug ( "Title: " + this.Session.Alert.Subject );
        EvAlert.AlertSaveActionCodes saveAction = EvAlert.AlertSaveActionCodes.Save_Alert;

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

        // 
        // Initialise the update variables.
        // 
        this.Session.Alert.UpdatedByUserId = this.Session.UserProfile.UserId;
        this.Session.Alert.UserCommonName = this.Session.UserProfile.CommonName;

        // 
        // IF the guid is new object id  alue then set the save object for adding to the database.
        // 
        if ( this.Session.Alert.Guid == Evado.Model.Digital.EvcStatics.CONST_NEW_OBJECT_ID )
        {
          this.Session.Alert.Guid = Guid.Empty;
        }
        // 
        // Delete the object.
        // 
        if ( PageCommand.Method == Evado.Model.UniForm.ApplicationMethods.Delete_Object )
        {
          this.LogMethodEnd ( "updateObject" );
          return this.Session.LastPage;
        }

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

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

        // 
        // Resets the save action to the parameter passed in the page groupCommand.
        // 
        if ( stSaveAction != String.Empty )
        {
          saveAction = Evado.Model.Digital.EvcStatics.Enumerations.parseEnumValue<EvAlert.AlertSaveActionCodes> ( stSaveAction );
        }
        this.Session.Alert.Action = saveAction;
        this.Session.Alert.UpdatedByUserId = this.Session.UserProfile.UserId;
        this.Session.Alert.UserCommonName = this.Session.UserProfile.UserCommonName;

        // 
        // update the object.
        // 
        EvEventCodes result = this._Bll_Alerts.saveAlert ( this.Session.Alert );

        // 
        // get the debug ResultData.
        // 
        this.LogValue ( this._Bll_Alerts.Log );

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

          switch ( result )
          {
            case EvEventCodes.Identifier_Project_Id_Error:
              {
                this.ErrorMessage = EvLabels.Project_Identifier_Empty_Error_Message;
                break;
              }
            default:
              {
                this.ErrorMessage = EvLabels.Alert_Update_Error_Message;
                break;
              }
          }

          this.LogMethodEnd ( "updateObject" );
          return this.Session.LastPage;
        }

        this.LogMethodEnd ( "updateObject" );
        return new Model.UniForm.AppData();

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

        // 
        // Generate the log the error event.
        // 
        this.LogException ( Ex );
      }
      this.LogMethodEnd ( "updateObject" );
      return this.Session.LastPage;

    }//END method
Example #17
0
    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="ClientClientDataObjectObject">The customer object.</param>
    //  ------------------------------------------------------------------------------
    private void getClientDataObject ( Evado.Model.UniForm.AppData ClientClientDataObjectObject )
    {
      this.LogMethod ( "getClientClientDataObjectObject" );
      // 
      // Initialise the methods variables and objects.
      // 
      Evado.Model.UniForm.Command pageCommand = new Evado.Model.UniForm.Command ( );
      Evado.Model.UniForm.Field pageField = new Evado.Model.UniForm.Field ( );
      bool userHasEditAccess = this.UserHasEditAccess ( );

      //
      // Initialise the client ResultData object.
      //
      ClientClientDataObjectObject.Id = this.Session.Alert.Guid;
      ClientClientDataObjectObject.Title = EvLabels.Alert_Page_Title;

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

      //
      // If the user has edit access enable the page for the user.
      //
      if ( userHasEditAccess == true )
      {
        ClientClientDataObjectObject.Page.EditAccess = Evado.Model.UniForm.EditAccess.Enabled;
      }

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

      // 
      // Create the customer id object
      // 
      pageField = pageGroup.createReadOnlyTextField (
        EvAlert.AlertFieldNames.Alert_Id.ToString ( ),
        EvLabels.Label_Alert_Id,
        this.Session.Alert.ToOrgId );
      pageField.Layout = EuRecordGenerator.ApplicationFieldLayout;

      // 
      // Add from user name
      // 
      pageField = pageGroup.createReadOnlyTextField (
        EvAlert.AlertFieldNames.From_User.ToString ( ),
        EvLabels.Alert_Page_From_Label,
        this.Session.Alert.FromUser );
      pageField.Layout = EuRecordGenerator.ApplicationFieldLayout;

      // 
      // Add to user name
      // 
      if ( this.Session.Alert.ToUser != String.Empty )
      {
        pageField = pageGroup.createReadOnlyTextField (
          EvAlert.AlertFieldNames.To_User.ToString ( ),
          EvLabels.Alert_Page_To_Label,
          this.Session.Alert.ToUser );
        pageField.Layout = EuRecordGenerator.ApplicationFieldLayout;
      }

      // 
      // Add alert milestone name
      // 
      pageField = pageGroup.createReadOnlyTextField (
        EvAlert.AlertFieldNames.Alert_Subject.ToString ( ),
        EvLabels.Alert_Page_Subject_Label,
        this.Session.Alert.Subject );
      pageField.Layout = EuRecordGenerator.ApplicationFieldLayout;

      // 
      // Add alert message name
      // 
      pageField = pageGroup.createReadOnlyTextField (
        EvAlert.AlertFieldNames.Message.ToString ( ),
        EvLabels.Alert_Page_Message_Label,
        this.Session.Alert.Message );
      pageField.Layout = EuRecordGenerator.ApplicationFieldLayout;

      // 
      // Add alert message name
      // 
      pageField = pageGroup.createReadOnlyTextField (
        EvAlert.AlertFieldNames.Alert_State.ToString ( ),
        EvLabels.Alert_Page_Status,
        this.Session.Alert.StateDesc );

      pageField.Layout = EuRecordGenerator.ApplicationFieldLayout;

      // 
      // include the acknowledged content if it exists.
      // 
      if ( this.Session.Alert.Acknowledged !=  Evado.Model.Digital.EvcStatics.CONST_DATE_NULL )
      {
        pageField = pageGroup.createReadOnlyTextField (
          EvAlert.AlertFieldNames.Acknowledged_Date.ToString ( ),
          EvLabels.Alert_Page_Acknowledged_Date_Label,
          this.Session.Alert.Acknowledged.ToString ( "dd MMM yyy HH:mm" ) );

        pageField.Layout = EuRecordGenerator.ApplicationFieldLayout;

        pageField = pageGroup.createReadOnlyTextField (
          EvAlert.AlertFieldNames.Acknowledged_By.ToString ( ),
          EvLabels.Alert_Page_Acknowledged_By_Label,
          this.Session.Alert.AcknowledgedBy );

        pageField.Layout = EuRecordGenerator.ApplicationFieldLayout;
      }

      // 
      // include the clodes content if it exists.
      // 
      if ( this.Session.Alert.Closed !=  Evado.Model.Digital.EvcStatics.CONST_DATE_NULL )
      {

        pageField = pageGroup.createReadOnlyTextField (
          EvAlert.AlertFieldNames.Closed_Date.ToString ( ),
          EvLabels.Alert_Page_Closed_Date_Label,
          this.Session.Alert.Closed.ToString ( "dd MMM yyy HH:mm" ) );

        pageField.Layout = EuRecordGenerator.ApplicationFieldLayout;

        pageField = pageGroup.createReadOnlyTextField (
          EvAlert.AlertFieldNames.Closed_By.ToString ( ),
          EvLabels.Alert_Page_Closed_By_Label,
          this.Session.Alert.ClosedBy );

        pageField.Layout = EuRecordGenerator.ApplicationFieldLayout;
      }

      this.LogValue ( "Edit Access: " + userHasEditAccess );
      this.LogValue ( "Alert.Status: " + this.Session.Alert.State );

      //
      // Add the record access command.
      //
      pageGroup.addCommand ( this.getRecordCommand ( ) );
      
      // 
      // Add page commands if the user has edit access to them.
      // 
      if ( userHasEditAccess == true )
      {
        this.LogValue ( "User has edit access" );

        switch ( this.Session.Alert.State )
        {
          case EvAlert.AlertStates.Raised:
            {
              this.LogValue ( "Alert.Status: Raised" );
              // 
              // Add the save groupCommand
              // 
              pageCommand = pageGroup.addCommand (
                EvLabels.Alert_Save_Command_Title,
                EuAdapter.APPLICATION_ID,
                EuAdapterClasses.Alert.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Save_Object );

              pageCommand.AddParameter (
                 Evado.Model.Digital.EvcStatics.CONST_SAVE_ACTION,
                EvAlert.AlertSaveActionCodes.Save_Alert.ToString ( ));

              pageCommand.SetGuid( ClientClientDataObjectObject.Id );

              // 
              // Add acknowledge groupCommand.
              // 
              pageCommand = pageGroup.addCommand (
                EvLabels.Alert_Page_Acknowledge_Command,
                EuAdapter.APPLICATION_ID,
                EuAdapterClasses.Alert.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Save_Object );

              pageCommand.SetGuid ( ClientClientDataObjectObject.Id );

              pageCommand.AddParameter (
                 Evado.Model.Digital.EvcStatics.CONST_SAVE_ACTION,
                EvAlert.AlertSaveActionCodes.Acknowledge_Alert.ToString ( ) );

              // 
              // Add the close groupCommand.
              // 
              pageCommand = pageGroup.addCommand (
                EvLabels.Alert_Page_Close_Command,
                EuAdapter.APPLICATION_ID,
                EuAdapterClasses.Alert.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Save_Object );

              pageCommand.SetGuid ( ClientClientDataObjectObject.Id );

              pageCommand.AddParameter (
                 Evado.Model.Digital.EvcStatics.CONST_SAVE_ACTION,
                EvAlert.AlertSaveActionCodes.Close_Alert.ToString ( ));

              break;
            }//END raised state.

          case EvAlert.AlertStates.Acknowledged:
            {
              this.LogValue ( "Alert.Status: Acknowledged" );
              // 
              // Add the save groupCommand
              // 
              pageCommand = pageGroup.addCommand (
                EvLabels.Alert_Save_Command_Title,
                EuAdapter.APPLICATION_ID,
                EuAdapterClasses.Alert.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Save_Object );

              pageCommand.AddParameter (
                 Evado.Model.Digital.EvcStatics.CONST_SAVE_ACTION,
                EvAlert.AlertSaveActionCodes.Save_Alert.ToString ( ));

              pageCommand.SetGuid ( ClientClientDataObjectObject.Id );

              // 
              // Add the close groupCommand.
              // 
              pageCommand = pageGroup.addCommand (
                EvLabels.Alert_Page_Close_Command,
                EuAdapter.APPLICATION_ID,
                EuAdapterClasses.Alert.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Save_Object );

              pageCommand.SetGuid (  ClientClientDataObjectObject.Id );

              pageCommand.AddParameter (
                 Evado.Model.Digital.EvcStatics.CONST_SAVE_ACTION,
                EvAlert.AlertSaveActionCodes.Close_Alert.ToString ( ) );
              break;
            }//END acknowledge state.

        }//END Alert State switch

      }//END user edit access.

    }//END Method
Example #18
0
    }//END getListObject method.

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

      // 
      // If the user does not have monitor or ResultData manager roles exit the page.
      // 
      if ( this.Session.UserProfile.hasMultiSiteAccess == false
        && this.Session.UserProfile.hasRecordAccess == false )
      {
        this.LogIllegalAccess (
          this.ClassNameSpace + "getObject",
          this.Session.UserProfile );

        this.ErrorMessage = EvLabels.Record_Access_Error_Message;

        return this.Session.LastPage;
      }

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

      // 
      // if the parameter value exists then set the customerId
      // 
      alertGuid = PagCommand.GetGuid();
      this.LogValue ( "alertGuid: " + alertGuid );

      // 
      // return if not trial id
      // 
      if ( alertGuid == Guid.Empty )
      {
        return clientDataObject;
      }

      this.LogValue ( "Alert Guid: " + alertGuid );

      try
      {
        // 
        // Retrieve the customer object from the database via the DAL and BLL layers.
        // 
        if ( this.Session.Alert.Guid != alertGuid )
        {
          this.Session.Alert = this._Bll_Alerts.getItem ( alertGuid );

          this.LogValue ( this._Bll_Alerts.Log );
        }
        this.LogValue ( "SessionObjects.Alert.AlertId: " + this.Session.Alert.AlertId );

        // 
        // return the client ResultData object for the customer.
        // 
        this.getClientDataObject ( clientDataObject );

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

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

      return this.Session.LastPage;

    }//END getObject method
Example #19
0
    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    #endregion

    #region Class public methods

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

      try
      {
        // 
        // Initialise the methods variables and objects.
        // 
        Evado.Model.UniForm.AppData clientDataObject = new Evado.Model.UniForm.AppData ( );

        var pageId = PageCommand.GetPageId<EdStaticPageIds> ( );

        this.LogDebug ( "Page Id {0}.", pageId );
        //
        // Load the customer group.
        //
        this.getAdsCustomerGroup ( );

        // 
        // Determine the method to be called
        // 
        switch ( PageCommand.Method )
        {
          case Evado.Model.UniForm.ApplicationMethods.List_of_Objects:
          case Evado.Model.UniForm.ApplicationMethods.Get_Object:
          case Evado.Model.UniForm.ApplicationMethods.Create_Object:
          case Evado.Model.UniForm.ApplicationMethods.Save_Object:
          case Evado.Model.UniForm.ApplicationMethods.Delete_Object:
            {
              switch ( pageId )
              {
                case EdStaticPageIds.User_Registration_Page:
                default:
                  {
                    clientDataObject = this.getDataObject_RegistrationPage ( PageCommand );
                    break;
                  }
                case EdStaticPageIds.Demo_User_Exit_Page:
                  {
                    this.LogValue ( " Save Object method" );

                    clientDataObject = this.getDataObject_ExitPage ( PageCommand );
                    break;
                  }
              }
              break;
            }
        }//END Switch

        // 
        // Handle returned exceptions.
        // 
        if ( clientDataObject == null )
        {
          clientDataObject = this.Session.LastPage;
          this.LogDebug ( " null application data returned." );
        }

        if ( this.ErrorMessage != String.Empty )
        {
          this.LogDebug ( "Append error message" );
          clientDataObject.Message = this.ErrorMessage;
        }

        // 
        // return the client ResultData object.
        // 
        this.LogMethodEnd ( "getClientDataObject" );
        return clientDataObject;

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

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

    }//END updateObject method
Example #20
0
    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    #endregion

    #region Class public methods

    // ==================================================================================
    /// <summary>
    /// This method gets the trial site object.
    /// 
    /// </summary>
    /// <param name="PageCommand">Evado.Model.UniForm.Command object</param>
    /// <returns>Evado.Model.UniForm.AppData</returns>
    //  ----------------------------------------------------------------------------------
    public Evado.Model.UniForm.AppData getClientDataObject ( Evado.Model.UniForm.Command PageCommand )
    {
      this.LogMethod ( "getTrialAlertObject" );
      this.LogValue ( "UserProfile.CommonName: " + this.Session.UserProfile.CommonName );
      this.LogValue ( "PageCommand " + PageCommand.getAsString ( false, false ) );

      try
      {
        // 
        // Initialise the methods variables and objects.
        // 
        Evado.Model.UniForm.AppData clientDataObject = new Evado.Model.UniForm.AppData ( );

        // 
        // Determine the method to be called
        // 
        switch ( PageCommand.Method )
        {
          case Evado.Model.UniForm.ApplicationMethods.List_of_Objects:
            {
              clientDataObject = this.getListObject ( PageCommand );

              break;
            }
          case Evado.Model.UniForm.ApplicationMethods.Get_Object:
            {
              clientDataObject = this.getObject ( PageCommand );

              break;
            }
          case Evado.Model.UniForm.ApplicationMethods.Create_Object:
            {
              clientDataObject = this.createObject ( PageCommand );

              break;
            }
          case Evado.Model.UniForm.ApplicationMethods.Save_Object:
          case Evado.Model.UniForm.ApplicationMethods.Delete_Object:
            {
              // 
              // Update the object values
              // 
              clientDataObject = this.updateObject ( PageCommand );

              //
              // if the alert is acknowledged the user needs to be diverted to the 
              // relevant object.
              //
              this.generateRedirection ( clientDataObject );

              break;
            }

        }//END Switch

        // 
        // Handle returned exceptions.
        // 
        if ( clientDataObject == null )
        {
          this.LogValue ( " null application data returned." );

          clientDataObject = this.Session.LastPage;
        }

        //
        // If an errot message exist display it.
        //
        if ( this.ErrorMessage != String.Empty )
        {
          clientDataObject.Message = this.ErrorMessage;
        }

        // 
        // return the client ResultData object.
        // 
        return clientDataObject;

      }
      catch ( Exception Ex )
      {
        this.LogException ( Ex );
      }
      return this.Session.LastPage;

    }//END getTrialAlertObject method
Example #21
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
    }//END method

    // ==================================================================================
    /// <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 updateObject ( 
      Evado.Model.UniForm.Command PageCommand )
    {
      this.LogMethod ( "updateObject" );
      this.LogValue ( "PageEvado.Model.UniForm.Command: " + PageCommand.getAsString ( false, false ) );

      this.LogValue ( "Guid: " + this.Session.Trial.Guid );
      this.LogValue ( "ProjectId: " + this.Session.Trial.TrialId );
      this.LogValue ( "Title: " + this.Session.Trial.Title );
      try
      {
        //
        // Initialise the methods variables and objects.
        //
        this.Session.AncillaryRecord.Action = EvAncillaryRecords.ACTION_SAVE;

        // 
        // Log access to page.
        // 
        this.LogPageAccess (
          "Evado.UniForm.Clinical.SubjectRecords.updateObject",
          this.Session.UserProfile );

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

        //
        // Initialise the binary file object to retrieve binary files associated with the visit.
        // 
        EuBinaryFiles binaryFiles = new EuBinaryFiles (
                this.ApplicationObjects,
                this.ServiceUserProfile,
                this.Session,
                this.UniForm_BinaryFilePath,
                this.UniForm_BinaryServiceUrl,
                this._FileRepositoryPath,
                this.ClassParameters );

        this.LogClass ( binaryFiles.Log );

        // 
        // Get the save action value.
        // 
        String stSaveAction = PageCommand.GetParameter (  Evado.Model.Clinical.EvcStatics.CONST_SAVE_ACTION );
        if ( stSaveAction != String.Empty )
        {
          this.Session.AncillaryRecord.Action = stSaveAction;
        }
        this.LogValue ( "AncillaryRecord.Action: " + this.Session.AncillaryRecord.Action );

        //
        // if the guid is set to new object reset it to empty to add a new record.
        //
        if ( this.Session.AncillaryRecord.Guid ==  Evado.Model.Clinical.EvcStatics.CONST_NEW_OBJECT_ID )
        {
          this.Session.AncillaryRecord.Guid = Guid.NewGuid ( );
          this.Session.AncillaryRecord.SubjectId = this.Session.Subject.SubjectId;
          this.Session.AncillaryRecord.ProjectId = this.Session.Subject.TrialId;
          this.Session.AncillaryRecord.Action = EvAncillaryRecords.ACTION_NEW;
        }

        if (
          this.Session.AncillaryRecord.RecordDate ==  Evado.Model.Clinical.EvcStatics.CONST_DATE_NULL )
        {
          this.Session.AncillaryRecord.RecordDate = DateTime.Now;
        }

        // 
        // Initialise the update variables.
        // 
        this.Session.AncillaryRecord.UpdatedByUserId = this.Session.UserProfile.UserId;
        this.Session.AncillaryRecord.UserCommonName = this.Session.UserProfile.CommonName;
        // 
        // Update the object.
        // 
        this.updateObjectValue ( PageCommand.Parameters );

        //
        // save the binary files to the file repository.
        // 
        binaryFiles.addBinaryData (
          PageCommand,
          this.Session.Subject.Guid,
          this.Session.Subject.SubjectId,
          this.Session.AncillaryRecord.Guid,
          this.Session.AncillaryRecord.RecordId,
          Guid.Empty, String.Empty );

        this.LogValue ( "BinaryFiles: " + binaryFiles.Log );

        // 
        // update the object.
        // 
        EvEventCodes result = this._Bll_AncillaryRecords.saveItem ( this.Session.AncillaryRecord );

        // 
        // get the debug ResultData.
        // 
        this.LogValue ( this._Bll_AncillaryRecords.DebugLog );

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

          switch ( result )
          {
            case EvEventCodes.Data_Duplicate_Id_Error:
              {
                this.ErrorMessage =
                  String.Format (
                    EvLabels.Activity_Duplicate_Identifier_Error_Message,
                    this.Session.Activity.ActivityId );
                break;
              }
            case EvEventCodes.Identifier_Project_Id_Error:
              {
                this.ErrorMessage = EvLabels.Project_Identifier_Empty_Error_Message;
                break;
              }
            case EvEventCodes.Identifier_Subject_Id_Error:
              {
                this.ErrorMessage = EvLabels.Subject_Identifier_Empty_Error_Message;
                break;
              }
            default:
              {
                this.ErrorMessage = EvLabels.Ancilliary_Record_Update_Error_Message;
                break;
              }
          }
          return this.Session.LastPage;
        }

        return new Model.UniForm.AppData();

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

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

    }//END method
Example #23
0
    }//END Method

    #endregion

    // =====================================================================================
    /// <summary>
    /// This method generates the commands associated with the selected menu item.
    /// </summary>
    /// <param name="MenuItem">The menu object</param>
    /// <returns>ClientClientDataObjectEvado.Model.UniForm.Command object.</returns>
    //  ------------------------------------------------------------------------------------
    public Evado.Model.UniForm.Command getMenuItemCommandObject ( EvMenuItem MenuItem )
    {
      this.resetAdapterLog ( );
      this.LogMethod ( "getMenuCommandObject" );
      this.LogDebug ( "PageId: {0}, Title: {1}, Group:  ",
        MenuItem.PageId, MenuItem.Title, MenuItem.Group );

      Evado.Model.UniForm.Command pageCommand = new Evado.Model.UniForm.Command (
        "Title",
        Evado.Model.UniForm.CommandTypes.Normal_Command,
        EuAdapter.ADAPTER_ID, String.Empty,
        Evado.Model.UniForm.ApplicationMethods.Get_Object );


      EdStaticPageIds pageId = EdStaticPageIds.Null;

      if ( EvStatics.tryParseEnumValue<EdStaticPageIds> ( MenuItem.PageId, out pageId ) == true )
      {
        #region Admin menu items

        //
        // Administration page commands
        //
        switch ( pageId )
        {
          case EdStaticPageIds.Application_Profile:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Application_Properties.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Get_Object );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.Database_Version:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Application_Properties.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Get_Object );

              pageCommand.SetPageId ( EdStaticPageIds.Database_Version );

              return pageCommand;
            }

          case EdStaticPageIds.Email_Templates_Page:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Email_Templates.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Get_Object );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.Application_Event_View:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Events.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.Application_Event:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Events.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Get_Object );

              pageCommand.SetPageId ( MenuItem.PageId );

              // 
              // Add the groupCommand parameters.
              // 
              pageCommand.SetGuid (
                this.Session.MenuItem.Guid );

              return pageCommand;
            }

          case EdStaticPageIds.Organisation_View:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Organisations.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.Organisation_Page:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Organisations.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Get_Object );

              // 
              // Add the groupCommand parameters.
              // 
              pageCommand.SetGuid ( this.Session.MenuItem.Guid );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.User_View:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Users.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.User_Profile_Update_Page:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Users.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Get_Object );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.Menu_View:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Menu.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

        }//END  admin page switch statement

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

        #region applilcation configuration
        //
        // Project configuration menu commands.
        //
        switch ( pageId )
        {
          case EdStaticPageIds.Alert_View:
            {
              pageCommand = new Model.UniForm.Command (
               MenuItem.Title,
               EuAdapter.ADAPTER_ID,
               EuAdapterClasses.Alert.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.Binary_File_List_Page:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Binary_File.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.Selection_List_View:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Selection_Lists.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.Selection_List_Page:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Selection_Lists.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Get_Object );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }


          case EdStaticPageIds.Record_Layout_View:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Record_Layouts.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.Entity_Layout_View:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Entity_Layouts.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }
        }//END  admin page switch statement

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

        #region project analysis and reporting menu items.
        //
        // Project analysis and reporting menu commands.
        //
        switch ( pageId )
        {
          case EdStaticPageIds.Data_Charting_Page:
            {
              this.LogValue ( MenuItem.PageId + " ADDED" );
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Analysis.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }
          case EdStaticPageIds.Record_Query_Page:
            {
              this.LogValue ( MenuItem.PageId + " ADDED" );
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Analysis.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }
          case EdStaticPageIds.Audit_Configuration_Page:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Application_Properties.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Get_Object );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }
          case EdStaticPageIds.Audit_Records_Page:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Application_Properties.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Get_Object );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }
          case EdStaticPageIds.Audit_Record_Items_Page:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Application_Properties.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Get_Object );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }
        }

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

        #region reporting menu items.
        //
        // Project analysis and reporting menu commands.
        //
        switch ( pageId )
        {
          case EdStaticPageIds.Report_Template_View:
            {
              this.LogValue ( MenuItem.PageId + " ADDED" );
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.ReportTemplates.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }
          case EdStaticPageIds.Report_Template_Page:
            {
              this.LogValue ( MenuItem.PageId + " ADDED" );
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.ReportTemplates.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Get_Object );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }
          case EdStaticPageIds.Operational_Report_List:
            {
              this.LogValue ( MenuItem.PageId + " ADDED" );
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Reports.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.Operational_Report_Page:
            {
              this.LogValue ( MenuItem.PageId + " ADDED" );
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Reports.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Get_Object );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }
        }//END switch statement

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

        #region record menu items.
        //
        // Project records menu commands.
        //
        switch ( pageId )
        {

          //  ------------------------------------------------------------------------------
          // milestone ancillary records pages.
          // 
          case EdStaticPageIds.Ancillary_Record_View:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Ancillary_Record.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.Records_View:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Records.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.Record_Export_Page:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Records.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.Record_Admin_Page:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Records.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }


          case EdStaticPageIds.Record_Page:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Records.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Get_Object );

              pageCommand.SetPageId ( MenuItem.PageId );

              pageCommand.SetGuid ( this.Session.Record.Guid );

              if ( this.Session.Entity != null )
              {
                pageCommand.AddParameter ( EdRecord.RecordFieldNames.TypeId,
                  this.Session.Entity.TypeId );
              }
              return pageCommand;
            }

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

          #region Entity commands
          //
          // Entitity menu commands
          //
          case EdStaticPageIds.Entity_View:
          case EdStaticPageIds.Entity_Query_View:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Entities.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.Entity_Export_Page:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Entities.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.Entity_Admin_Page:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Entities.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.List_of_Objects );

              pageCommand.SetPageId ( MenuItem.PageId );

              return pageCommand;
            }

          case EdStaticPageIds.Entity_Page:
            {
              pageCommand = new Model.UniForm.Command (
                MenuItem.Title,
                EuAdapter.ADAPTER_ID,
                EuAdapterClasses.Entities.ToString ( ),
                Evado.Model.UniForm.ApplicationMethods.Get_Object );

              pageCommand.SetPageId ( MenuItem.PageId );

              pageCommand.SetGuid ( this.Session.Entity.Guid );

              if ( this.Session.Entity != null )
              {
                pageCommand.AddParameter ( EdRecord.RecordFieldNames.TypeId,
                  this.Session.Entity.TypeId );
              }
              return pageCommand;
            }

        }//END switch
      }

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


      return null;

    }//END convertMenuItem method