Пример #1
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.
Пример #2
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.
Пример #3
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
Пример #4
0
    }//END getListObject method.
    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="Page">Evado.Model.UniForm.Page.</param>
    //  ------------------------------------------------------------------------------
    private void getListObject_Selection_Group ( 
      Evado.Model.UniForm.Page Page )
    {
      this.LogMethod ( "getListObject_Selection_Group" );
      //
      // Initialise the methods variables and objects.
      //
      Evado.Model.UniForm.Field groupField = new Model.UniForm.Field ( );
      Evado.Model.UniForm.Command command = new Model.UniForm.Command ( );
      List<EvOption> optionList = new List<EvOption>();

      // 
      // Create the new pageMenuGroup.
      // 
      Evado.Model.UniForm.Group pageGroup = Page.AddGroup (
        EvLabels.Alert_List_Selection_Group_Title,
        Evado.Model.UniForm.EditAccess.Enabled );
      pageGroup.Layout = Evado.Model.UniForm.GroupLayouts.Full_Width;

      //
      // generate the alert state option list.
      //
      optionList = EvAlert.getTypeList ( );

      //
      // create the alert type selection
      //
      groupField = pageGroup.createSelectionListField (
        EuAlerts.CONST_ALERT_TYPE,
        EvLabels.Alert_List_Alert_Type_Field_Label,
        this.Session.AlertType.ToString(),
        optionList );
      groupField.Layout = EuRecordGenerator.ApplicationFieldLayout;
      groupField.AddParameter ( Evado.Model.UniForm.FieldParameterList.Snd_Cmd_On_Change, 1 );

      //
      // generate the alert types option list.
      //
      optionList = EvAlert.getStateList ( );

      //
      // create the alert type selection field.
      //
      groupField = pageGroup.createSelectionListField (
        EuAlerts.CONST_ALERT_STATE,
        EvLabels.Alert_List_Alert_State_Field_Label,
        this.Session.AlertState.ToString ( ),
        optionList );
      groupField.Layout = EuRecordGenerator.ApplicationFieldLayout;
      groupField.AddParameter ( Evado.Model.UniForm.FieldParameterList.Snd_Cmd_On_Change, 1 );


      // 
      // Add the selection groupCommand
      // 
      command = pageGroup.addCommand (
        EvLabels.Alert_List_Selection_Command_Title,
        EuAdapter.APPLICATION_ID,
        EuAdapterClasses.Alert.ToString ( ),
         Evado.Model.UniForm.ApplicationMethods.Custom_Method );
      command.setCustomMethod ( Evado.Model.UniForm.ApplicationMethods.List_of_Objects );


    }//END getListObject_Selection_Group method