//  =================================================================================
    /// <summary>
    ///   This method generates the streamed video form field object as html markup.
    /// </summary>
    /// <param name="GroupField">Evado.UniForm.Model.PageGroup object.</param>
    //  ---------------------------------------------------------------------------------
    private void getStreamedVideoField (
      Evado.UniForm.Model.Group PageGroup )
    {
      this.LogMethod ( "getStreamedVideoField" );

      //
      // if there is not video donot create the video field.
      //
      if ( this.AdapterObjects.Settings.DemoRegistrationVideoUrl == String.Empty )
      {
        return;
      }

      // 
      // Initialise local variables.
      // 
      Evado.UniForm.Model.Field groupField = PageGroup.createField ( );
      groupField.Type = Evado.Model.EvDataTypes.Streamed_Video;
      groupField.Value = this.AdapterObjects.Settings.DemoRegistrationVideoUrl;
      groupField.Description = String.Empty;

      int iWidth = 800;
      int iHeight = 0;

      this.LogDebug ( "iWidth: " + iWidth );
      this.LogDebug ( "iHeight: " + iHeight );
      if ( iWidth > 0 )
      {
        groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Width, iWidth.ToString ( ) );
      }
      if ( iHeight > 0 )
      {
        groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Height, iHeight.ToString ( ) );
      }

      this.LogDebug ( "Value: " + groupField.Value );

      return;

    }//END getStreamedVideoField method.
    }//END getOrganisationList method.

    // ==================================================================================
    /// <summary>
    /// This methods returns a pageMenuGroup object contains a selection of organisations.
    /// </summary>
    /// <param name="PageObject">Application</param>
    /// <returns>Evado.UniForm.Model.Group object</returns>
    //  ---------------------------------------------------------------------------------
    public void getOrganisationSelection (
      Evado.UniForm.Model.Page PageObject )
    {
      this.LogMethod ( "getOrganisationSelection" );

      // 
      // initialise the methods variables and objects.
      // 
      List<Evado.Model.EvOption> optionList = new List<Evado.Model.EvOption> ( );
      Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field ( );

      Evado.UniForm.Model.Group pageGroup = PageObject.AddGroup (
        EdLabels.Organisation_List_Selection_Group,
        Evado.UniForm.Model.EditAccess.Enabled );
      pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;

      //
      // get the list of organisations.
      //
      optionList = this.AdapterObjects.Settings.GetOrgTypeList ( true );

      // 
      // Set the selection to the current site org id.
      // 
      groupField = pageGroup.createSelectionListField (
        EdOrganisation.FieldNames.Org_Type,
        EdLabels.Config_OrgType_List_Field_Label,
        this.Session.SelectedOrganisationType.ToString ( ),
        optionList );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );

      // 
      // Create a custom groupCommand to process the selection.
      // 
      Evado.UniForm.Model.Command customCommand = pageGroup.addCommand (
        EdLabels.Organisation_Selection_Command_Title,
        EuAdapter.ADAPTER_ID,
        EuAdapterClasses.Organisations.ToString ( ),
        Evado.UniForm.Model.ApplicationMethods.Custom_Method );

      // 
      // Set the custom groupCommand parameter.
      // 
      customCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.List_of_Objects );


      this.LogMethodEnd ( "getOrganisationSelection" );

    }//END getOrganisationSelection method
Esempio n. 3
0
    }//END method

    // ==================================================================================
    /// <summary>
    /// This methods returns a pageMenuGroup object contains a selection of applicationEvents.
    /// </summary>
    /// <param name="PageObject">Evado.UniForm.Model.Page object</param>
    /// <returns>Evado.UniForm.Model.Group object</returns>
    //  ---------------------------------------------------------------------------------
    public void getSelectionGroup (
      Evado.UniForm.Model.Page PageObject )
    {
      this.LogMethod ( "getSelectionGroup" );

      this.LogValue ( "EventStartDate: " + this.Session.EventStartDate );
      this.LogValue ( "EventFinishDate: " + this.Session.EventFinishDate );

      // 
      // initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field ( );
      DateTime rangeStartDate = EvStatics.getDateTime ( "1 jan 2020" );
      DateTime rangeFinishDate = DateTime.Now.AddDays ( 1 );

      //
      // create the selection group.
      //
      Evado.UniForm.Model.Group selectionGroup = PageObject.AddGroup (
        EdLabels.ApplicationEvent_Selection_Group_Title,
        Evado.UniForm.Model.EditAccess.Enabled );
      selectionGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;

      // 
      // Set the selection to the start date
      // 
      groupField = selectionGroup.createDateField (
        EuApplicationEvents.CONST_START_DATE_FIELD_ID,
        EdLabels.ApplicationEvent_Start_Date_Selection_Field_Label,
        this.Session.EventStartDate,
        rangeStartDate, rangeFinishDate );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );

      // 
      // Set the selection to the start date
      // 
      groupField = selectionGroup.createDateField (
        EuApplicationEvents.CONST_FINISH_DATE_FIELD_ID,
        EdLabels.ApplicationEvent_Finish_Date_Selection_Field_Label,
        this.Session.EventFinishDate,
        rangeStartDate, rangeFinishDate );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );

      //
      // get the list of event codes.
      //
      if ( this.AdapterObjects.EventCodeSelectionList.Count == 0 )
      {
        this.AdapterObjects.EventCodeSelectionList = Evado.Model.EvStatics.getOptionsFromEnum ( typeof ( EvEventCodes ), true );

        Evado.Digital.Model.EvcStatics.sortOptionListValues ( this.AdapterObjects.EventCodeSelectionList );
      }

      // 
      // Set the selection to the event id
      // 
      groupField = selectionGroup.createSelectionListField (
        EuApplicationEvents.CONST_EVENT_FIELD_ID,
        EdLabels.ApplicationEvent_Event_Id_Selection_Field_Label,
        this.Session.EventId.ToString ( ),
        this.AdapterObjects.EventCodeSelectionList );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );


      //
      // get the list of event ids.
      //
      List<EvOption> optionList = Evado.Model.EvStatics.getOptionsFromEnum ( typeof ( EvApplicationEvent.EventType ), true );
      // 
      // Set the selection to the type id
      // 
      groupField = selectionGroup.createSelectionListField (
        EuApplicationEvents.CONST_TYPE_FIELD_ID,
        EdLabels.ApplicationEvent_Type_Selection_Field_Label,
        this.Session.EventType,
        optionList );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );

      // 
      // Set the selection to the USER Name
      // 
      Evado.Digital.Model.EvcStatics.sortOptionListValues ( this.Session.EventUserSelectionList );

      groupField = selectionGroup.createSelectionListField (
        EuApplicationEvents.CONST_USER_FIELD_ID,
        EdLabels.ApplicationEvent_UserName_Selection_Field_Label,
        this.Session.EventUserName,
        this.Session.EventUserSelectionList );
      groupField.Layout = EuAdapter.DefaultFieldLayout;

      groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );


      // 
      // Create a custom groupCommand to process the selection.
      // 
      Evado.UniForm.Model.Command customCommand = selectionGroup.addCommand (
        EdLabels.ApplicationEvent_Selection_Command_Title,
        EuAdapter.ADAPTER_ID,
        EuAdapterClasses.Events.ToString ( ),
        Evado.UniForm.Model.ApplicationMethods.Custom_Method );

      // 
      // Set the custom groupCommand parameter.
      // 
      customCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.List_of_Objects );

    }//END getSelectionGroup method
Esempio n. 4
0
    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="PageObject">Evado.UniForm.Model.Page object.</param>
    /// <returns>ClientApplicationData object</returns>
    //  ------------------------------------------------------------------------------
    private void getSelectionListGroup ( Evado.UniForm.Model.Page PageObject )
    {
      this.LogMethod ( "getSelectionListGroup" );
      // 
      // Initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.Field pageField = new Evado.UniForm.Model.Field ( );
      List<EvOption> optionList = new List<EvOption> ( );
      EvOption option = new EvOption ( );

      //
      // Define the selection group object.
      //
      Evado.UniForm.Model.Group pageGroup = PageObject.AddGroup (
        EdLabels.Menu_Selection,
        Evado.UniForm.Model.EditAccess.Enabled );
      pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width;

      //
      // Add the platform selection list
      //
      optionList.Add ( new EvOption (
        EuMenus.CONST_ADMIN_APPLICATION_IDENTIFIER,
        EdLabels.Menu_Admin_Platform_Option_Description ) );

      optionList.Add ( new EvOption (
        EuMenus.CONST_PRODUCTION_APPLICATION_IDENTIFIER,
        EdLabels.Menu_Production_Platform_Option_Description ) );

      pageField = pageGroup.createSelectionListField (
        EvMenuItem.MenuFieldNames.Platform.ToString ( ),
        EdLabels.Menu_Platform_Field_Label,
        this.Session.MenuPlatformId,
        optionList );
      pageField.Layout = EuAdapter.DefaultFieldLayout;
      pageField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );

      // 
      // Create the pageMenuGroup selection list.
      // 
      List<Evado.Model.EvOption> groupList = this.GetGroupList ( );

      if ( groupList.Count > 1 )
      {
        pageField = pageGroup.createSelectionListField (
          EuSession.CONST_MENU_GROUP_ID,
          EdLabels.Menu_Group_ID,
          this.Session.MenuGroupIdentifier,
          groupList );
        pageField.Layout = EuAdapter.DefaultFieldLayout;
        pageField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 );
      }

      //
      // Add the selection command
      //
      Evado.UniForm.Model.Command selectionCommand = pageGroup.addCommand (
        EdLabels.Menu_Selection_Menu,
        EuAdapter.ADAPTER_ID,
        EuAdapterClasses.Menu.ToString ( ),
        Evado.UniForm.Model.ApplicationMethods.Custom_Method );

      // 
      // Set the custom groupCommand parametet.
      // 
      selectionCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.List_of_Objects );

    }
        }//END static convertEvOptionsList method

        // =================================================================================
        /// <summary>
        ///  This static method convert a list of EvFormField into a list of ClientClientDataObjectFields
        /// </summary>
        /// <param name="FormField">The list of EvFormField objects.</param>
        /// <returns>List of ClientClientDataObjectFields</returns>
        // ---------------------------------------------------------------------------------
        private static Evado.UniForm.Model.Field generateTableField(Evado.Digital.Model.EdRecordField FormField)
        {
            //
            // Initialise the method variables and objects.
            //
            Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field(
                FormField.FieldId,
                FormField.Title,
                Evado.Model.EvDataTypes.Table);

            //
            // Initialise the field object.
            //
            if (FormField.Design.Instructions != String.Empty)
            {
                groupField.Description = FormField.Design.Instructions;
            }
            groupField.AddParameter(Evado.UniForm.Model.FieldParameterList.Width, "100");
            groupField.EditAccess = Evado.UniForm.Model.EditAccess.Inherited;
            groupField.Type       = Evado.Model.EvDataTypes.Table;
            groupField.Table      = new Evado.UniForm.Model.Table( );

            //
            // Initialise the table header
            //
            if (FormField.Table != null)
            {
                for (int column = 0; column < FormField.Table.Header.Length; column++)
                {
                    groupField.Table.Header [column].No     = FormField.Table.Header [column].No;
                    groupField.Table.Header [column].Text   = FormField.Table.Header [column].Text;
                    groupField.Table.Header [column].TypeId = FormField.Table.Header [column].TypeId;
                    groupField.Table.Header [column].Width  = FormField.Table.Header [column].Width;

                    //
                    // Proces the Options or Unit field value.
                    //
                    if (groupField.Table.Header [column].TypeId == Evado.Model.EvDataTypes.Numeric)
                    {
                        groupField.Table.Header [column].OptionsOrUnit = FormField.Table.Header [column].OptionsOrUnit;
                    }
                    if (groupField.Table.Header [column].TypeId == Evado.Model.EvDataTypes.Radio_Button_List ||
                        groupField.Table.Header [column].TypeId == Evado.Model.EvDataTypes.Selection_List)
                    {
                        groupField.Table.Header [column].OptionList = Evado.UniForm.Model.EuStatics.getStringAsOptionList(
                            FormField.Table.Header [column].OptionsOrUnit);
                    }
                }//END Column interation loop

                //
                // transfer the table values to the pagefield table object.
                //
                for (int inRow = 0; inRow < FormField.Table.Rows.Count; inRow++)
                {
                    Evado.UniForm.Model.TableRow row = new Evado.UniForm.Model.TableRow( );

                    for (int inColumn = 0; inColumn < FormField.Table.ColumnCount; inColumn++)
                    {
                        row.Column [inColumn] = FormField.Table.Rows [inRow].Column [inColumn];
                    }
                    groupField.Table.Rows.Add(row);
                }
            }

            //
            // returnt the page field object.
            //
            return(groupField);
        } //END generateTableField method.
        }//END static convertEvOptionsList method

        // =================================================================================
        /// <summary>
        ///  This static method convert a list of EvFormField into a list of ClientClientDataObjectFields
        /// </summary>
        /// <param name="FormField">The list of EvFormField objects.</param>
        /// <returns>List of ClientClientDataObjectFields</returns>
        // ---------------------------------------------------------------------------------
        public static Evado.UniForm.Model.Field convertEvFormfield(Evado.Digital.Model.EdRecordField FormField)
        {
            //
            // Initialise the method variables and objects.
            //
            Evado.UniForm.Model.Field pageField = new Evado.UniForm.Model.Field(
                FormField.FieldId,
                FormField.Title,
                Evado.Model.EvDataTypes.Null);
            pageField.Layout = Evado.UniForm.Model.FieldLayoutCodes.Left_Justified;

            if (FormField.Design.Instructions != String.Empty)
            {
                pageField.Description = FormField.Design.Instructions;
            }

            switch (FormField.TypeId)
            {
            case Evado.Model.EvDataTypes.Text:
            {
                pageField.Type  = Evado.Model.EvDataTypes.Text;
                pageField.Value = FormField.ItemValue;
                pageField.AddParameter(Evado.UniForm.Model.FieldParameterList.Width, "50");
                break;
            }

            case Evado.Model.EvDataTypes.Free_Text:
            {
                pageField.Type  = Evado.Model.EvDataTypes.Free_Text;
                pageField.Value = FormField.ItemText;
                pageField.AddParameter(Evado.UniForm.Model.FieldParameterList.Width, "50");
                pageField.AddParameter(Evado.UniForm.Model.FieldParameterList.Height, "5");
                break;
            }

            case Evado.Model.EvDataTypes.Date:
            {
                pageField.Type  = Evado.Model.EvDataTypes.Date;
                pageField.Value = FormField.ItemValue;
                pageField.AddParameter(Evado.UniForm.Model.FieldParameterList.Width, "12");
                break;
            }

            case Evado.Model.EvDataTypes.Time:
            {
                pageField.Type  = Evado.Model.EvDataTypes.Time;
                pageField.Value = FormField.ItemValue;
                pageField.AddParameter(Evado.UniForm.Model.FieldParameterList.Width, "6");
                break;
            }

            case Evado.Model.EvDataTypes.Numeric:
            {
                pageField.Type  = Evado.Model.EvDataTypes.Numeric;
                pageField.Value = FormField.ItemValue;

                pageField.AddParameter(
                    Evado.UniForm.Model.FieldParameterList.Min_Value,
                    FormField.Design.ValidationLowerLimit.ToString( ));

                pageField.AddParameter(
                    Evado.UniForm.Model.FieldParameterList.Max_Value,
                    FormField.Design.ValidationUpperLimit.ToString( ));

                pageField.AddParameter(
                    Evado.UniForm.Model.FieldParameterList.Width, "10");
                break;
            }

            case Evado.Model.EvDataTypes.Selection_List:
            case Evado.Model.EvDataTypes.External_Selection_List:
            {
                pageField.Type       = Evado.Model.EvDataTypes.Selection_List;
                pageField.Value      = FormField.ItemValue;
                pageField.OptionList = EuConversions.convertEvOptionsList(FormField.Design.OptionList, true);
                pageField.AddParameter(
                    Evado.UniForm.Model.FieldParameterList.Width, "50");
                break;
            }

            case Evado.Model.EvDataTypes.Radio_Button_List:
                // case Evado.Model.EvDataTypes.Horizontal_Radio_Buttons:
            {
                pageField.Type       = Evado.Model.EvDataTypes.Radio_Button_List;
                pageField.Value      = FormField.ItemValue;
                pageField.OptionList = EuConversions.convertEvOptionsList(FormField.Design.OptionList, true);
                pageField.AddParameter(
                    Evado.UniForm.Model.FieldParameterList.Width, "50");
                break;
            }

            case Evado.Model.EvDataTypes.Boolean:
            {
                pageField.Type  = Evado.Model.EvDataTypes.Boolean;
                pageField.Value = FormField.ItemValue;
                pageField.AddParameter(Evado.UniForm.Model.FieldParameterList.Width, "50");
                break;
            }

            case Evado.Model.EvDataTypes.Check_Box_List:
            {
                pageField.Type       = Evado.Model.EvDataTypes.Check_Box_List;
                pageField.Value      = FormField.ItemValue;
                pageField.OptionList = EuConversions.convertEvOptionsList(FormField.Design.OptionList, true);
                pageField.AddParameter(Evado.UniForm.Model.FieldParameterList.Width, "50");
                break;
            }

            case Evado.Model.EvDataTypes.Analogue_Scale:
            case Evado.Model.EvDataTypes.Horizontal_Radio_Buttons:
            {
                pageField.Type  = Evado.Model.EvDataTypes.Read_Only_Text;
                pageField.Value = FormField.ItemValue;
                pageField.AddParameter(Evado.UniForm.Model.FieldParameterList.Width, "50");
                break;
            }

            case Evado.Model.EvDataTypes.Table:
            case Evado.Model.EvDataTypes.Special_Matrix:
            {
                pageField = generateTableField(FormField);
                break;
            }

            default:
            {
                pageField = null;
                break;
            }
            }

            //
            // return the device option list.
            //
            return(pageField);
        }//END static convertEvOptionsList method