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

        // =====================================================================================
        /// <summary>
        /// This class returns a list of options based on the state and Guid values
        /// </summary>
        /// <param name="State">EvFormFieldSelectionList.SelectionListStates: The selection list state.</param>
        /// <param name="SelectByGuid">Boolean: True, if the selection is based on Guid.</param>
        /// <returns>List of EvOption: a list of option data objects</returns>
        /// <remarks>
        /// This method consists of the followings steps:
        ///
        /// 1. Define the sql query parameters and sql query string.
        ///
        /// 2. Execute the sql query string and store the results on data table.
        ///
        /// 3. Loop through the table and extract the data row to the option object.
        ///
        /// 4. Add the Option object values to the Options list.
        ///
        /// 5. Return the Options list.
        /// </remarks>
        //  ---------------------------------------------------------------------------------
        public List <EvOption> getList(
            EdPageLayout.States State,
            bool SelectByGuid)
        {
            this.LogMethod("getList method.");
            this._Log.AppendLine("State: " + State);
            this._Log.AppendLine("SelectByUid: " + SelectByGuid.ToString( ));

            //
            // Initialise the local variables
            //
            List <EvOption> list   = new List <EvOption> ( );
            EvOption        option = new EvOption( );

            list.Add(option);

            //
            // get the list of selectionLists
            //
            var selectionList = this.getView(State);

            //
            // Iterate through the results extracting the role information.
            //
            for (int count = 0; count < selectionList.Count; count++)
            {
                EdPageLayout item = selectionList [count];
                //
                // If SelectByGuid = True then optionId is to be the objects TestReport UID
                //
                if (SelectByGuid == true)
                {
                    option = new EvOption(item.Guid.ToString( ),
                                          String.Format("{0} - {1} ", item.PageId, item.Title));
                }

                //
                // If SelectByGuid = False then optionId is to be the objects ListId.
                //
                else
                {
                    option = new EvOption(item.PageId,
                                          String.Format("{0} - {1} ", item.PageId, item.Title));
                }

                list.Add(option);

                if (count > this.ClassParameters.MaxResultLength)
                {
                    break;
                }
            } //END interation loop.

            //
            // Return the ArrayList.
            //
            return(list);
        }//END getList class
        } // Close getSourceList method.

        // =====================================================================================
        /// <summary>
        /// This class returns a list of report objects based on the passed parameters.
        /// </summary>
        /// <param name="IsSelectionList">Bool: True the list is a selection list.</param>
        /// <returns>List of EvReport: the list of report data object containing the template.</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Execute the ReportSourceList methods
        ///
        /// 2. Return the Report list.
        /// </remarks>
        // -------------------------------------------------------------------------------------
        public List <EvOption> getSourceOptionList(bool IsSelectionList)
        {
            this.LogMethod("getSourceOptionList method. ");
            this.LogDebug("IsSelectionList: " + IsSelectionList);

            //
            // Initialise local variables and objects.
            //
            List <EvReportSource> sourceList = new List <EvReportSource> ( );
            List <EvOption>       optionList = new List <EvOption> ( );
            EvOption option = new EvOption( );

            //
            // Add an empty option for a selection lists.
            //
            if (IsSelectionList == true)
            {
                optionList.Add(option);
            }

            //
            // Retrieve the list of report source objects.
            //
            sourceList = this._dalReportTemplates.getSourceList( );

            this.LogClass(this._dalReportTemplates.Log);

            this.LogDebug("Source list count: " + sourceList.Count);

            //
            // convert the list to an option list.
            //
            foreach (EvReportSource source in sourceList)
            {
                option = new EvOption(source.SourceId, source.Name);
                optionList.Add(option);
            }

            //
            // Return the list containing the option objects.
            //
            return(optionList);
        } // Close getSourceOptionList method.
        //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
        #endregion

        #region Class methods

        //==================================================================================
        /// <summary>
        /// This method creates a list of query options.
        /// </summary>
        /// <param name="IsSelectionList">bool: true if a selection list.</param>
        /// <returns>List of EvOption objects.</returns>
        //-----------------------------------------------------------------------------------
        public List <EvOption> QueryOptionList(bool IsSelectionList)
        {
            //
            // Initialise local variables and objects.
            //
            List <EvOption> optionList = new List <EvOption> ( );
            EvOption        option     = new EvOption( );

            //
            // exit if query list is null.
            //
            if (QueryList == null)
            {
                return(optionList);
            }

            //
            // Add an empty option for a selection lists.
            //
            if (IsSelectionList == true)
            {
                optionList.Add(option);
            }

            //
            // Create the option list.
            //
            foreach (EdReportQuery query in QueryList)
            {
                option = new EvOption(query.QueryId, query.QueryTitle);

                if (query.DataType != EdReport.DataTypes.Text)
                {
                    option.Description += " (" + query.DataType + ")";
                }

                optionList.Add(option);
            }


            return(optionList);
        }//ENdc QueryOptionList method
        }//ENdc QueryOptionList method

        //==================================================================================
        /// <summary>
        /// This method creates a list of query options.
        /// </summary>
        /// <param name="IsSelectionList">bool: true if a selection list.</param>
        /// <returns>List of EvOption objects.</returns>
        //-----------------------------------------------------------------------------------
        public List <EvOption> ColumnOptionList(bool IsSelectionList)
        {
            //
            // Initialise local variables and objects.
            //
            List <EvOption> optionList = new List <EvOption> ( );
            EvOption        option     = new EvOption( );

            //
            // exit if query list is null.
            //
            if (ColumnList == null)
            {
                return(optionList);
            }

            //
            // Add an empty option for a selection lists.
            //
            if (IsSelectionList == true)
            {
                optionList.Add(option);
            }

            //
            // Create the option list.
            //
            foreach (EdReportColumn column in ColumnList)
            {
                option = new EvOption(column.ColumnId, column.HeaderText);

                if (column.DataType != EdReport.DataTypes.Text)
                {
                    option.Description += " (" + column.DataType + ")";
                }

                optionList.Add(option);
            }


            return(optionList);
        }//END ColumnOptionList method
    }//End getView method.

    // =====================================================================================
    /// <summary>
    /// This class returns an option list based on the passed parameters. 
    /// </summary>
    /// <param name="Type">EvOrganisation.OrganisationTypes: an organization type</param>
    /// <param name="IsCurrent">Boolean: true, if the current organization is selected</param>
    /// <returns>List of EvOption: a list of option data object</returns>
    /// <remarks>
    /// This method consists of the following steps: 
    /// 
    /// 1. Set the IsTrue string to 0, if not the selection type.
    /// 
    /// 2. Define the sql query string and execute the sql query string to a datatable
    /// 
    /// 3. Loop through the table and extract the row data to the option object. 
    /// 
    /// 4. Add the option object value to the options list. 
    /// 
    /// 5. Return the options list.
    /// </remarks>
    // -------------------------------------------------------------------------------------
    public List<EvOption> getList (
      String Type )
    {
      this.LogMethod ( "getList" );
      this.LogDebug ( "Type: " + Type );
      //
      // Initialize the method variable and objects.
      //
      List<EvOption> list = new List<EvOption> ( );
      EvOption option = new EvOption ( );
      list.Add ( option );

      //
      // Get the list of organisations
      //
      var organisationList = this.getOrganisationList ( Type );

      //
      // iterate through the organisation list creating the selection list.
      //
      foreach ( EdOrganisation org in organisationList )
      {
        option = new EvOption (
          org.OrgId,
          String.Format ( "{0} - {1}, Type: {2}", org.OrgId, org.Name, org.OrgType ) );

        list.Add ( option );
      }

      this.LogDebug ( "Option list count: " + list.Count );

      // 
      // Return the Organisation selection visitSchedule.
      // 
      this.LogMethodEnd ( "getList" );
      return list;

    }//END getList method
Esempio n. 6
0
        }//End getRecordItemSelectionList method.

        //  ==================================================================================
        /// <summary>
        /// This class returns a list of Form options objects
        /// </summary>
        /// <param name="TrialId">String: a trial identifier</param>
        /// <returns>List of EvOption: a list of Form options objects</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Execute the method for retrieving the form objects list.
        ///
        /// 2. Loop through the form object list and add object's values to the options list.
        ///
        /// 3. Return the options list.
        /// </remarks>
        //  ----------------------------------------------------------------------------------
        private List <EvOption> GetFormsList(  )
        {
            this._DebugLog.AppendLine("Evado.Digital.Bll.Clinical.EvDataChanges.GetFormsList");
            //
            // Initialise the methods variables.
            //
            EdRecordLayouts forms = new EdRecordLayouts( );
            List <EvOption> list  = new List <EvOption> ( );

            //
            // Add the blank first testReport.
            //
            EvOption option = new EvOption( );

            list.Add(option);

            //
            // Get the form objects list .
            //
            List <EdRecord> view = forms.getLayoutList(EdRecordTypes.Null,
                                                       EdRecordObjectStates.Null);

            this._DebugLog.AppendLine(forms.Log);

            //
            // Iterate through the form objects list.
            //
            foreach (EdRecord form in view)
            {
                option = new EvOption(form.Guid.ToString( ),
                                      form.Title + " (" + form.Design.Version + " " + form.StateDesc + ")");
                list.Add(option);
            }

            return(list);
        }//END GetFormsList method
Esempio n. 7
0
        }//END getView method.

        // =====================================================================================
        /// <summary>
        /// This method returns a list of Subject Record object based on TrialId, SubjectId and useGuid condition
        /// </summary>
        /// <param name="ProjectId">String: A Project identifier</param>
        /// <param name="EntityId">String: A Subject identifier</param>
        /// <param name="useGuid">Boolean: true, if the Guid is used</param>
        /// <returns>List of EvOption: A list containing an Option object.</returns>
        /// <remarks>
        /// This method consists of following steps:
        ///
        /// 1. Define the sql query parameters and sql query string.
        ///
        /// 2. Execute the sql query string and store the results on datatable.
        ///
        /// 3. Loop through the table and extract the data row on Option object.
        ///
        /// 4. Add the Option object's values to the Options list.
        /// </remarks>
        //  ----------------------------------------------------------------------------------
        public List <EvOption> getList(string EntityId, bool useGuid)
        {
            this.LogMethod("getList, ");
            this.LogValue("SubjectId: " + EntityId);
            //
            // Define the local variables and objects.
            //
            List <EvOption> list = new List <EvOption>( );

            EvOption option = new EvOption( );

            //
            // If useGuid is equal to true, add option object to the list.
            //
            if (useGuid == true)
            {
                option = new EvOption(Guid.Empty.ToString( ), String.Empty);
            }
            list.Add(option);

            //
            // Define the query parameters.
            //
            SqlParameter [] cmdParms = new SqlParameter []
            {
                new SqlParameter(PARM_SubjectId, SqlDbType.NVarChar, 20),
            };
            cmdParms [0].Value = EntityId;

            //
            // Generate the SQL query string.
            //
            _sqlQueryString = _sqlQuery_View + " WHERE ( TrialId = @TrialId ) ";

            if (EntityId.Length > 0)
            {
                _sqlQueryString += " AND ( SubjectId = @SubjectId ) ";
            }
            _sqlQueryString += " ORDER BY RecordId";

            //_Status = "\r\n" + sqlQueryString;

            //
            //Execute the query against the database.
            //
            using (DataTable table = EvSqlMethods.RunQuery(_sqlQueryString, cmdParms))
            {
                //
                // Iterate through the table rows count list.
                //
                for (int count = 0; count < table.Rows.Count; count++)
                {
                    //
                    // Extract the table row.
                    //
                    DataRow row = table.Rows [count];

                    //
                    //  Process the query result.
                    //
                    if (useGuid == true)
                    {
                        option = new EvOption(
                            EvSqlMethods.getString(row, "TSR_Guid"),
                            EvSqlMethods.getString(row, "RecordId") + " - " + EvSqlMethods.getDateTime(row, "TSR_Subject"));
                    }
                    else
                    {
                        option = new EvOption(
                            EvSqlMethods.getString(row, "RecordId"),
                            EvSqlMethods.getString(row, "RecordId") + " - " + EvSqlMethods.getDateTime(row, "TSR_Subject"));
                    }

                    if (EntityId == String.Empty)
                    {
                        option.Description = "(" + EvSqlMethods.getString(row, "SubjectId") + ") " + option.Description;
                    }

                    //
                    // Append the EvOption object to the list.
                    //
                    list.Add(option);
                }
            }

            //
            // Return a list containing an EvOption object.
            //
            return(list);
        }//END getList method.
Esempio n. 8
0
    // ==============================================================================
    /// <summary>
    /// This method returns a client application ResultData object
    /// </summary>
    /// <param name="ClientDataObject">Evado.UniForm.Model.AppData object.</param>
    /// <returns>ClientApplicationData object</returns>
    //  ------------------------------------------------------------------------------
    private void getClientData (
      Evado.UniForm.Model.AppData ClientDataObject )
    {
      this.LogMethod ( "getDataObject" );
      // 
      // Initialise the methods variables and objects.
      // 
      Evado.UniForm.Model.Command pageCommand = new Evado.UniForm.Model.Command ( );
      Evado.UniForm.Model.Field pageField = new Evado.UniForm.Model.Field ( );
      List<EvOption> optionList = new List<EvOption> ( );
      EvOption option = new EvOption ( );

      ClientDataObject.Id = this.Session.MenuItem.Guid;
      ClientDataObject.Title = EdLabels.Menu_Item;

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

      // 
      // create the page pageMenuGroup
      // 
      Evado.UniForm.Model.Group pageGroup = ClientDataObject.Page.AddGroup (
        EdLabels.Menu_General_Group_Title,
        Evado.UniForm.Model.EditAccess.Inherited );
      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 (
        String.Empty,
        EdLabels.Menu_Platform_Field_Label,
        this.Session.MenuPlatformId,
        optionList );
      pageField.EditAccess = Evado.UniForm.Model.EditAccess.Disabled;

      // 
      // Create the customer id object
      // 
      optionList = this.AdapterObjects.PageIdentifiers;

      Evado.Digital.Model.EvcStatics.sortOptionListValues ( optionList );

      pageField = pageGroup.createSelectionListField (
        EvMenuItem.MenuFieldNames.Page_Id.ToString ( ),
        EdLabels.Menu_Page_Id_Field_Label,
        this.Session.MenuItem.PageId.ToString ( ),
        optionList );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create the customer name object
      // 
      pageField = pageGroup.createTextField (
        EvMenuItem.MenuFieldNames.Title.ToString ( ),
        EdLabels.Menu_Title_Field_Label,
        String.Empty,
        this.Session.MenuItem.Title,
        20 );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create the customer name object
      // 
      pageField = pageGroup.createNumericField (
        EvMenuItem.MenuFieldNames.Order.ToString ( ),
        EdLabels.Menu_Order_Field_Label,
        this.Session.MenuItem.Order,
        0,
        200 );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Create the customer name object
      // 
      optionList = this.AdapterObjects.Settings.GetRoleOptionList ( false );
      string roles = this.Session.MenuItem.RoleList;

      pageField = pageGroup.createCheckBoxListField (
        EvMenuItem.MenuFieldNames.Role_List.ToString ( ),
        EdLabels.Menu_Role_List_Field_Label,
        roles,
        optionList );

      pageField.Layout = EuAdapter.DefaultFieldLayout;

      pageField.Description = EdLabels.Menu_Role_List_Field_Description;

      // 
      // Create the customer name object
      // 
      pageField = pageGroup.createTextField (
        EvMenuItem.MenuFieldNames.Parameters.ToString ( ),
        EdLabels.Menu_Parameters_Field_Label,
        String.Empty,
        this.Session.MenuItem.Parameters,
        20 );
      pageField.Layout = EuAdapter.DefaultFieldLayout;

      // 
      // Add the save groupCommand
      // 
      pageCommand = pageGroup.addCommand (
        EdLabels.Menu_Save_Command_Title,
        EuAdapter.ADAPTER_ID,
        EuAdapterClasses.Menu.ToString ( ),
        Evado.UniForm.Model.ApplicationMethods.Save_Object );

      // 
      // Define the save and delete groupCommand parameters
      // 
      pageCommand.SetGuid ( ClientDataObject.Id );

      //
      // Add the delete groupCommand object.
      //
      pageCommand = pageGroup.addCommand (
         EdLabels.Menu_Delete_Command_Title,
         EuAdapter.ADAPTER_ID,
         EuAdapterClasses.Menu.ToString ( ),
         Evado.UniForm.Model.ApplicationMethods.Save_Object );

      // 
      // Define the save and delete groupCommand parameters
      // 
      pageCommand.SetGuid ( ClientDataObject.Id );

      pageCommand.AddParameter ( Evado.Digital.Model.EvcStatics.CONST_SAVE_ACTION, EuMenus.CONST_DELETE_ACTION );

    }//END Method
Esempio n. 9
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 );

    }
Esempio n. 10
0
 /// <summary>
 /// This method initialises the report quety object.
 /// </summary>
 public EvReportQuery( )
 {
     SelectionList [0] = new EvOption( );
 }