}//END getDataObject method

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

    #region Class list methods

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

        //
        // 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 + "getListObject",
            this.Session.UserProfile );

          this.ErrorMessage = EdLabels.Illegal_Page_Access_Attempt;

          return this.Session.LastPage; ;
        }

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

        if ( PageCommand.hasParameter ( Evado.UniForm.Model.CommandParameters.Custom_Method ) == true )
        {
          this.Session.AdminOrganisationList = new List<EdOrganisation> ( );
        }

          //
        // fill the organisation list.
        //
        this.getOrganisationList ( );

        //
        // Initialise the list of organisations.
        //
        clientDataObject.Title = EdLabels.Organisation_List_Page_Title;
        clientDataObject.Page.Title = clientDataObject.Title;
        clientDataObject.Id = Guid.NewGuid ( );

        this.getOrganisationSelection ( clientDataObject.Page );
        // 
        // Add the trial organisation list to the page.
        // 
        this.getListGroup ( clientDataObject.Page );


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

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

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

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

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

    #region Class public methods

    // ==================================================================================
    /// <summary>
    /// This method gets the trial site object
    /// </summary>
    /// <param name="PageCommand">ClientPateEvado.UniForm.Model.Command object</param>
    /// <returns>ClientApplicationData</returns>
    //  ----------------------------------------------------------------------------------
    public override Evado.UniForm.Model.AppData getDataObject (
      Evado.UniForm.Model.Command PageCommand )
    {
      this.LogMethod ( "getDataObject" );
      this.LogValue ( "PageCommand Content: " + PageCommand.getAsString ( false, false ) );
      try
      {
        // 
        // Initialise the methods variables and objects.
        // 
        Evado.UniForm.Model.AppData clientDataObject = new Evado.UniForm.Model.AppData ( );

        if ( PageCommand.hasParameter ( EdOrganisation.FieldNames.Org_Type ) == true )
        {
          this.Session.SelectedOrganisationType = PageCommand.GetParameter ( EdOrganisation.FieldNames.Org_Type );
        }
        if ( PageCommand.hasParameter ( Evado.UniForm.Model.CommandParameters.Custom_Method ) == true )
        {
          this.Session.AdminOrganisationList = new List<EdOrganisation> ( );
        }
        this.LogValue ( "SelectedOrganisationType: " + this.Session.SelectedOrganisationType );

        // 
        // Determine the method to be called
        // 
        switch ( PageCommand.Method )
        {
          case Evado.UniForm.Model.ApplicationMethods.List_of_Objects:
            {
              clientDataObject = this.getListObject ( PageCommand );
              break;
            }
          case Evado.UniForm.Model.ApplicationMethods.Get_Object:
            {
              clientDataObject = this.getObject ( PageCommand );
              break;
            }
          case Evado.UniForm.Model.ApplicationMethods.Create_Object:
            {
              clientDataObject = this.createObject ( PageCommand );
              break;
            }
          case Evado.UniForm.Model.ApplicationMethods.Save_Object:
          case Evado.UniForm.Model.ApplicationMethods.Delete_Object:
            {
              // 
              // Update the object values
              // 
              clientDataObject = this.updateObject ( PageCommand );
              break;
            }

        }//END Switch

        // 
        // Handle returned exceptions.
        // 
        if ( clientDataObject == null )
        {
          this.LogDebug ( " 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.
        // 
        this.LogMethodEnd ( "getDataObject" );
        return clientDataObject;
      }
      catch ( Exception Ex )
      {
        this.LogException ( Ex );
      }
      this.LogMethodEnd ( "getDataObject" );
      return this.Session.LastPage;

    }//END getDataObject method
    }//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.UniForm.Model.Command object.</param>
    /// <returns>Application Data object</returns>
    //  ----------------------------------------------------------------------------------
    private EvEventCodes RegisterUserDetails (
      Evado.UniForm.Model.Command PageCommand )
    {
      this.LogMethod ( "RegisterUserDetails" );
      try
      {
        // 
        // Initialise the methods variables and objects.
        //      
        Evado.UniForm.Model.AppData clientDataObject = new Evado.UniForm.Model.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 ( EuUserRegistration.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
Esempio n. 4
0
    }//END getListObject method.


    // ==================================================================================
    /// <summary>
    /// This methods saves the event log selection parameters to the session object.
    /// </summary>
    //  ---------------------------------------------------------------------------------
    private void saveEventLogSelectionParameters (
      Evado.UniForm.Model.Command PageCommand )
    {
      this.LogMethod ( "saveEventLogSelectionParameters" );
      //
      // Retrieve the selection options.
      //
      String value = String.Empty;
      this.Session.EventId = EvEventCodes.Null;

      //
      // Start date selection
      //
      if ( PageCommand.hasParameter ( EuApplicationEvents.CONST_START_DATE_FIELD_ID ) == true )
      {
        var startDate = EvStatics.getDateTime ( PageCommand.GetParameter ( EuApplicationEvents.CONST_START_DATE_FIELD_ID ) );

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

        if ( this.Session.EventStartDate != startDate )
        {
          this.Session.EventStartDate = startDate;
          this.Session.ApplicationEventList = new List<EvApplicationEvent> ( );
        }
      }

      //
      // finish data selection.
      //
      if ( PageCommand.hasParameter ( EuApplicationEvents.CONST_FINISH_DATE_FIELD_ID ) == true )
      {
        var finishDate = EvStatics.getDateTime ( PageCommand.GetParameter ( EuApplicationEvents.CONST_FINISH_DATE_FIELD_ID ) );

        if ( this.Session.EventFinishDate != finishDate )
        {
          this.Session.EventFinishDate = finishDate;
          this.Session.ApplicationEventList = new List<EvApplicationEvent> ( );
        }
      }

      //
      // Event Identifier selection.
      //
      if ( PageCommand.hasParameter ( EuApplicationEvents.CONST_EVENT_FIELD_ID ) == true )
      {
        var eventId = PageCommand.GetParameter<EvEventCodes> ( EuApplicationEvents.CONST_EVENT_FIELD_ID );

        if ( eventId != this.Session.EventId )
        {
          this.Session.EventId = eventId;
          this.Session.ApplicationEventList = new List<EvApplicationEvent> ( );
        }
      }

      //
      // Event type selection.
      //
      this.Session.EventType = PageCommand.GetParameter ( EuApplicationEvents.CONST_TYPE_FIELD_ID );

      if ( PageCommand.hasParameter ( EuApplicationEvents.CONST_TYPE_FIELD_ID ) == true )
      {
        var eventId = PageCommand.GetParameter ( EuApplicationEvents.CONST_TYPE_FIELD_ID );

        if ( eventId != this.Session.EventType )
        {
          this.Session.EventType = eventId;
          this.Session.ApplicationEventList = new List<EvApplicationEvent> ( );
        }
      }

      //
      // user selection
      //
      this.Session.EventUserName = PageCommand.GetParameter ( EuApplicationEvents.CONST_USER_FIELD_ID );

      //
      // set the minimium event range.
      //
      if ( this.Session.EventStartDate == Evado.Digital.Model.EvcStatics.CONST_DATE_MIN_RANGE )
      {
        this.Session.EventStartDate =
         Evado.Digital.Model.EvcStatics.getDateTime ( DateTime.Now.ToString ( "dd MMM yyyy" ) );
        this.Session.EventFinishDate = this.Session.EventStartDate.AddDays ( 1 );
      }

      this.LogValue ( "EventId: " + this.Session.EventId );
      this.LogValue ( "EventType: " + this.Session.EventType );
      this.LogValue ( "EventUserName: "******"EventStartDate: " + this.Session.EventStartDate );
      this.LogValue ( "EventFinishDate: " + this.Session.EventFinishDate );
      this.LogValue ( "ApplicationEventList.Count: " + this.Session.ApplicationEventList.Count );
      this.LogMethodEnd ( "saveEventLogSelectionParameters" );

    }//END Method
Esempio n. 5
0
    }//END getClientDataObject method
    
    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    #endregion

    #region Class private list 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 getListObject (
      Evado.UniForm.Model.Command PageCommand )
    {
      this.LogMethod ( "getListObject" );
      this.LogDebug ( "MenuPlatformId: " + this.Session.MenuPlatformId );
      this.LogDebug ( "MenuGroupIdentifer: " + this.Session.MenuGroupIdentifier );
      try
      {
        // 
        // 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.hasAdministrationAccess == false )
        {
          this.LogIllegalAccess (
            this.ClassNameSpace + "getListObject",
            this.Session.UserProfile );

          this.ErrorMessage = EdLabels.Illegal_Page_Access_Attempt;

          return this.Session.LastPage;
        }

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

        //
        // if the customer command has been executed then refresh the menu list.
        //
        if ( PageCommand.hasParameter ( Evado.UniForm.Model.CommandParameters.Custom_Method ) == true )
        {
          this.AdapterObjects.MenuList = new List<EvMenuItem> ( );
        }

        // 
        // Get the selected pageMenuGroup identifier.
        // 
        if ( PageCommand.hasParameter ( EuSession.CONST_MENU_GROUP_ID ) == true )
        {
          this.Session.MenuGroupIdentifier = PageCommand.GetParameter ( EuSession.CONST_MENU_GROUP_ID );
        }
        this.LogValue ( "UPDATED: MenuGroupIdentifer: " + this.Session.MenuGroupIdentifier );

        // 
        // Get the selected pageMenuGroup identifier.
        // 
        if ( PageCommand.hasParameter ( EvMenuItem.MenuFieldNames.Platform.ToString ( ) ) == true )
        {
          this.Session.MenuPlatformId = PageCommand.GetParameter ( EvMenuItem.MenuFieldNames.Platform.ToString ( ) );
        }
        this.LogValue ( "UPDATED: MenuPlatformId: " + this.Session.MenuPlatformId );

        //
        // Update the global menu list, to pick up any changes that where made during an audit cycle.
        //
        this.loadGlobalMenu ( );

        //
        // ensure that all page layouts have menu groups headers.
        //
        this.updatePageLayoutGroups ( );

        //
        // Initialise the ResultData object.
        //
        clientDataObject.Title = EdLabels.Menu_Item_List;
        clientDataObject.Page.Title = clientDataObject.Title;
        clientDataObject.Id = Guid.NewGuid ( );

        // 
        // Add the save groupCommand
        // 
        clientDataObject.Page.addCommand (
          EdLabels.Menu_New_Item_Command_Title,
          EuAdapter.ADAPTER_ID,
          EuAdapterClasses.Menu.ToString ( ),
          Evado.UniForm.Model.ApplicationMethods.Create_Object );

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

        // 
        // Add the Menu Field list to the page.
        // 
        this.getList_Menu_List_Group (
          clientDataObject.Page,
          this.Session.MenuGroupIdentifier );

        this.LogDebug ( "Page.Title: " + clientDataObject.Page.Title );
        this.LogDebug ( "Page.CommandList.Count: " + clientDataObject.Page.CommandList.Count );

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

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

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

      return this.Session.LastPage;

    }//END getListObject method.
Esempio n. 6
0
    // ==============================================================================
    /// <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 getListObject (
      Evado.UniForm.Model.Command PageCommand )
    {
      this.LogMethod ( "getListObject" );
      this.LogDebug ( "Selected_EntityLayoutId: " + this.Session.Selected_EntityLayoutId );
      this.LogDebug ( "EntitySelectionState: " + this.Session.EntityStateSelection );
      this.LogDebug ( "EntitySelectionLayoutId: " + this.Session.Selected_EntityLayoutId );
      try
      {
        // 
        // Initialise the methods variables and objects.
        // 
        Evado.UniForm.Model.AppData clientDataObject = new Evado.UniForm.Model.AppData ( );
        this.EnableEntityEditButtonUpdate = false; 
        //
        // get the selected entity.
        //
        this.Session.EntityLayout = this.AdapterObjects.GetEntityLayout ( this.Session.Selected_EntityLayoutId );

        this.LogDebug ( "EntityLayout.ReadAccessRoles: " + this.Session.EntityLayout.Design.ReadAccessRoles );
        this.LogDebug ( "UserProfile.Roles: " + this.Session.UserProfile.Roles );

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

          this.ErrorMessage = EdLabels.Record_Access_Error_Message;

          return this.Session.LastPage; ;
        }
        // 
        // Log the user's access to page.
        // 
        this.LogPageAccess (
          this.ClassNameSpace + "getListObject",
          this.Session.UserProfile );

        this.LogDebug ( "LayoutId {0}", this.Session.EntityLayout.LayoutId );

        //
        // Set the parent entity variables.
        //
        this.ParentLayoutId = this.Session.Entity.LayoutId;
        this.ParentGuid = this.Session.Entity.Guid;
        if ( PageCommand.hasParameter ( EdRecord.FieldNames.ParentGuid ) == true )
        {
          this.ParentGuid = PageCommand.GetParameterAsGuid ( EdRecord.FieldNames.ParentGuid );
        }
        if ( PageCommand.hasParameter ( EdRecord.FieldNames.ParentLayoutId ) == true )
        {
          this.ParentLayoutId = PageCommand.GetParameter ( EdRecord.FieldNames.ParentLayoutId );
        }

        //
        // Execute the monitor list record query.
        //
        this.executeRecordQuery ( );

        // 
        // Initialise the client ResultData object.
        // 
        clientDataObject.Id = Guid.NewGuid ( );
        clientDataObject.Page.Id = clientDataObject.Id;
        clientDataObject.Page.PageDataGuid = clientDataObject.Id;
        clientDataObject.Title = EdLabels.Entity_View_Page_Title;

        if ( this.AdapterObjects.Settings.UseHomePageHeaderOnAllPages == true )
        {
          clientDataObject.Title = this.AdapterObjects.Settings.HomePageHeaderText;
        }
        else
        {
          clientDataObject.Title = this.Session.EntityLayout.Title;
        }

        clientDataObject.Page.Title = clientDataObject.Title;
        clientDataObject.Page.PageId = Evado.Digital.Model.EdStaticPageIds.Records_View.ToString ( );

        if ( this.Session.Entity.hasEditAccess ( this.Session.UserProfile.Roles ) == true )
        {
          clientDataObject.Page.EditAccess = Evado.UniForm.Model.EditAccess.Enabled;
        }
        this.LogValue ( "Page.EditAccess: " + clientDataObject.Page.EditAccess );

        // 
        // Create the new pageMenuGroup for query selection.
        // 
        this.getList_SelectionGroup ( clientDataObject.Page );

        // 
        // Create the pageMenuGroup containing commands to open the records.
        //         
        this.getEntity_ListGroup ( clientDataObject.Page );

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


        return clientDataObject;

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

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

      return this.Session.LastPage; ;

    }//END getListObject method.