Esempio n. 1
0
    }//END getListObject method.

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

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

        this.ErrorMessage = EdLabels.Illegal_Page_Access_Attempt;

        return null;
      }

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

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

      try
      {
        // 
        // Retrieve the customer object from the database via the DAL and BLL layers.
        // 
        this._ApplicationEvent = this._Bll_ApplicationEvents.getItem ( objectGuid );

        this.LogClass ( this._Bll_ApplicationEvents.Log );

        this.LogValue ( "EventId: " + this._ApplicationEvent.EventId );
        // 
        // return the client ResultData object for the customer.
        // 
        this.getDataObject ( clientDataObject );

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

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

      return this.Session.LastPage;

    }//END getObject method
    }//END getListGroup method.


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

    #region Class get object methods

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

      //
      // Determine if the user has access to this page and log and error if they do not.
      //
      if ( this.Session.UserProfile.hasAdministrationAccess == false )
      {
        this.LogIllegalAccess (
          this.ClassNameSpace + "getObject",
          this.Session.UserProfile );

        this.ErrorMessage = EdLabels.Illegal_Page_Access_Attempt;

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

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

      //
      // get the organisation guid.
      //
      orgGuid = PageCommand.GetGuid ( );

      //
      // guid and object empty.
      //
      if ( orgGuid == Guid.Empty
        && this.Session.AdminOrganisation.Guid == Guid.Empty )
      {
        this.ErrorMessage = EdLabels.Organisation_Guid_Empty_Message;
        this.LogMethodEnd ( "getObject" );
        return this.Session.LastPage;
      }

      //
      // load the organisation
      //
      if ( this.getOrganisation ( orgGuid ) == false )
      {
        this.Session.LastPage.Message = this.ErrorMessage;
        this.LogMethodEnd ( "getObject" );
        return this.Session.LastPage;
      }

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

      //
      // return the client data object.
      //
      this.LogMethodEnd ( "getObject" );
      return clientDataObject;

    }//END getObject method
Esempio n. 3
0
    }//END getListObject method.

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

    #region Class private get object methods

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

      try
      {
        //
        // Determine if the user has access to this page and log and error if they do not.
        //
        if ( this.Session.UserProfile.hasAdministrationAccess == false )
        {
          this.LogIllegalAccess (
            this.ClassNameSpace + "getObject",
            this.Session.UserProfile );

          this.ErrorMessage = EdLabels.Illegal_Page_Access_Attempt;

          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
        // 
        menuGuid = PageCommand.GetGuid ( );
        this.LogDebug ( "Menu Guid: " + menuGuid );

        // 
        // return if not trial id
        // 
        if ( menuGuid == Guid.Empty )
        {
          this.ErrorMessage = EdLabels.MenuItem_Guid_Empty_Message;

          return this.Session.LastPage;
        }
        //
        // Retrieve the menu item from the global list of menut items.
        //
        this.Session.MenuItem = this.getMenuItem ( menuGuid );

        this.LogDebug ( "MenuItem.PageId: " + this.Session.MenuItem.PageId );

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

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

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

      return this.Session.LastPage;

    }//END getObject method