}//END getWidthList method

        // =====================================================================================
        /// <summary>
        /// This class returns the Option list for the item.
        ///
        /// Written by: Ross Anderson
        /// Date: 24/08/2005
        /// </summary>
        /// <returns>ArrayList: a list of options</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Initialize a return list
        ///
        /// 2. Add a null option as first item for a selection list.
        ///
        /// 3. Loop ten rounds to add the width to the return list.
        /// </remarks>
        // -------------------------------------------------------------------------------------
        public static List <Evado.Model.EvOption> getRowLengthList( )
        {
            //
            // Initialize a return list.
            //
            List <Evado.Model.EvOption> List = new List <Evado.Model.EvOption> ( );

            Evado.Model.EvOption Option = new Evado.Model.EvOption( );

            //
            // Loop five rounds to add the width to the return list.
            //
            for (int count = 0; count < 10; count++)
            {
                string stRow = count.ToString( );
                Option = new Evado.Model.EvOption(stRow, stRow);
                List.Add(Option);
            }

            //
            // Loop ten rounds to add the width to the return list.
            //
            for (int Count = 0; Count < 20; Count++)
            {
                string sWidth = (Count * 2 + 10).ToString( );
                Option = new Evado.Model.EvOption(sWidth, sWidth);
                List.Add(Option);
            }
            //
            //Return the completed Array List.
            //
            return(List);
        }//END getWidthList method
        // =====================================================================================
        /// <summary>
        /// This class provides a list of trial types.
        ///
        /// </summary>
        /// <returns>IList containing selection List for items in record table</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Initialize a return list of record item table name
        ///
        /// 2. Create an option list
        ///
        /// 3. Add items from the option list to the return list
        /// </remarks>
        //  ------------------------------------------------------------------------------------
        public static List <Evado.Model.EvOption> getRecordItemTablesNameList( )
        {
            //
            // Initialize a return list of record item table name
            //
            List <Evado.Model.EvOption> list = new List <Evado.Model.EvOption>();

            //
            // Create an option list
            //
            Evado.Model.EvOption option = new Evado.Model.EvOption();
            list.Add(option);

            //
            // Add items from the option list to the return list
            //
            option = Evado.Model.EvStatics.getOption(DataChangeTableNames.EvFormFields);
            list.Add(option);



            //
            // Return the list.
            //
            return(list);
        }
        }//END getTypeList method

        // =====================================================================================
        /// <summary>
        /// This class returns the Option list for the item.
        ///
        /// Written by: Ross Anderson
        /// Date: 24/08/2005
        /// </summary>
        /// <returns>ArrayList: a list of options</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Initialize a return list
        ///
        /// 2. Add a null option as first item for a selection list.
        ///
        /// 3. Loop ten rounds to add the width to the return list.
        /// </remarks>
        // -------------------------------------------------------------------------------------
        public static List <Evado.Model.EvOption> getWidthList( )
        {
            //
            // Initialize a return list.
            //
            List <Evado.Model.EvOption> List = new List <Evado.Model.EvOption> ( );

            //
            // Add a null option as first item for a selection list.
            //
            Evado.Model.EvOption Option = new Evado.Model.EvOption("0", String.Empty);
            List.Add(Option);

            //
            // Loop ten rounds to add the width to the return list.
            //
            for (int Count = 0; Count < 10; Count++)
            {
                string sWidth = (Count * 5 + 5).ToString();
                Option = new Evado.Model.EvOption(sWidth, sWidth);
                List.Add(Option);
            }
            //
            //Return the completed Array List.
            //
            return(List);
        }//END getWidthList method
        }//END getAsHtml method

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

        #region static methods

        // =====================================================================================
        /// <summary>
        /// This class provides a list of trial types.
        ///
        /// </summary>
        /// <returns>List: containing selection List for configuration table</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Initilize a return list of Configuration table name
        ///
        /// 2. Create an option list
        ///
        /// 3. Add items from option list to the return list
        /// </remarks>
        //  ------------------------------------------------------------------------------------
        public static List <Evado.Model.EvOption> getConfigurationTablesNameList( )
        {
            //
            // Initilize a return list of Configuration table name object
            //
            List <Evado.Model.EvOption> list = new List <Evado.Model.EvOption>();

            //
            // Create an option list
            //
            Evado.Model.EvOption option = new Evado.Model.EvOption();
            list.Add(option);

            //
            // Add items from option list to the return list
            //

            option = Evado.Model.EvStatics.getOption(DataChangeTableNames.EvAlerts);
            list.Add(option);

            option = Evado.Model.EvStatics.getOption(DataChangeTableNames.EvForms);
            list.Add(option);

            option = Evado.Model.EvStatics.getOption(DataChangeTableNames.EdApplicationSettings);
            list.Add(option);

            option = Evado.Model.EvStatics.getOption(DataChangeTableNames.EvUserProfiles);
            list.Add(option);

            //
            // Return the list.
            //
            return(list);
        }//END getConfigurationTablesNameList method
Example #5
0
        // ==================================================================================
        /// <summary>
        /// This method creates a list of selection options for the passed category.
        /// If category is empty then all options are returned.
        /// </summary>
        /// <param name="Category">String selection option category</param>
        /// <returns>List of Evado.Model.EvOption objects</returns>
        // ----------------------------------------------------------------------------------
        public List <Evado.Model.EvOption> GetOptionList(String Category, bool ForSelectionList)
        {
            //
            // Initialise the methods variables and objecs.
            //
            List <Evado.Model.EvOption> optionList = new List <Evado.Model.EvOption> ( );

            //
            // Add an empty selection option. 'Null' indicated that nothing is selected.
            //
            if (ForSelectionList == true)
            {
                optionList.Add(new Evado.Model.EvOption("Null", ""));
            }

            //
            // iterate through the list creating the list categories.
            //
            foreach (Item item in this.Items)
            {
                //
                // skip non matching categories.
                //
                if (item.Category != Category &&
                    Category != String.Empty)
                {
                    continue;
                }

                //
                // define the option
                //
                Evado.Model.EvOption option = new Evado.Model.EvOption(item.Value, item.Description);

                //
                // append the option if it not aready in the list.
                //
                if (optionList.Contains(option) == false)
                {
                    optionList.Add(new Evado.Model.EvOption(item.Category));
                }
            }

            //
            // Return category option list.
            //
            return(optionList);
        }
        }//End getOptionsFromEnum method

        //  ==============================================================================================
        /// <summary>
        /// This class obtains a list of selection options made of the names of the enumeration.
        /// </summary>
        /// <param name="enumObject">Object: an enumeration object</param>
        /// <returns>Object: a selection option object</returns>
        /// <remarks>
        /// This class consists of the following steps:
        ///
        /// 1. Create a string name of enumObject
        ///
        /// 2. Initialize an option object with a replacing of "_" character with a blank character
        /// </remarks>
        //  ------------------------------------------------------------------------------------------------
        public static Evado.Model.EvOption getOption(Object enumObject)
        {
            //
            // Create a string name of enumeObject
            //
            String name = enumObject.ToString();

            //
            // Initialize a return option object
            //
            Evado.Model.EvOption option = new Evado.Model.EvOption(name, name.Replace("_", " "));

            //
            // Return a selection option object.
            //
            return(option);
        }//END getEvOption method
        // =====================================================================================
        /// <summary>
        /// This method returns the Option list for the item.
        ///
        /// Written by: Ross Anderson
        /// Date: 24/08/2005
        /// </summary>
        /// <returns>List of Evado.Model.EvOptions</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Initialize a return list
        ///
        /// 2. Add a null option as first item for a selection list.
        ///
        /// 3. Add items from option object to the return list.
        /// </remarks>
        // -------------------------------------------------------------------------------------
        public static List <Evado.Model.EvOption> getTypeList(Evado.Model.EvDataTypes Datatype)
        {
            //
            // Initialize a return list
            //
            List <Evado.Model.EvOption> List = new List <Evado.Model.EvOption> ( );

            //
            // Add a null option as first item for a selection list.
            //
            Evado.Model.EvOption Option = new Evado.Model.EvOption();
            List.Add(Option);

            //
            // Add items from option object to the return list.
            //
            Option = new Evado.Model.EvOption("YN", "Boolean Column");
            List.Add(Option);

            Option = new Evado.Model.EvOption("TXT", "Text Column");
            List.Add(Option);

            Option = new Evado.Model.EvOption("NUM", "Numeric Column");
            List.Add(Option);

            Option = new Evado.Model.EvOption("DT", "Date Column");
            List.Add(Option);

            Option = new Evado.Model.EvOption("RBL", "Radio Button Column");
            List.Add(Option);

            Option = new Evado.Model.EvOption("SL", "Selection List Column");
            List.Add(Option);

            if (Datatype == Evado.Model.EvDataTypes.Special_Matrix)
            {
                Option = new Evado.Model.EvOption("RO", "Read Only");
                List.Add(Option);
            }

            //
            //Return the completed Array List.
            //
            return(List);
        }//END getTypeList 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 Evado.Model.EvOption objects.</returns>
        //-----------------------------------------------------------------------------------
        public List <Evado.Model.EvOption> ColumnOptionList(bool IsSelectionList)
        {
            //
            // Initialise local variables and objects.
            //
            List <Evado.Model.EvOption> optionList = new List <Evado.Model.EvOption> ( );

            Evado.Model.EvOption option = new Evado.Model.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 Evado.Model.EvOption(column.ColumnId, column.HeaderText);

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

                optionList.Add(option);
            }


            return(optionList);
        }//END ColumnOptionList 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 Evado.Model.EvOption objects.</returns>
        //-----------------------------------------------------------------------------------
        public List <Evado.Model.EvOption> QueryOptionList(bool IsSelectionList)
        {
            //
            // Initialise local variables and objects.
            //
            List <Evado.Model.EvOption> optionList = new List <Evado.Model.EvOption> ( );

            Evado.Model.EvOption option = new Evado.Model.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 Evado.Model.EvOption(query.QueryId, query.QueryTitle);

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

                optionList.Add(option);
            }


            return(optionList);
        }//ENdc QueryOptionList method
Example #10
0
        // =====================================================================================
        /// <summary>
        /// This class returns the Yes No Selection list for the item.
        /// </summary>
        /// <returns>ArrayList: a Yes No list</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Initialize a return list and an option object.
        ///
        /// 2. Add Yes/No options into a return list.
        /// </remarks>
        // -------------------------------------------------------------------------------------
        public static List <Evado.Model.EvOption> getYesNoList( )
        {
            //
            // Initialise a return list and an option object.
            //
            List <Evado.Model.EvOption> list = new List <Evado.Model.EvOption> ( );

            Evado.Model.EvOption option = new Evado.Model.EvOption( );
            list.Add(option);

            //
            // Add Yes/No option into a return array list
            //
            option = new Evado.Model.EvOption("Yes", "Yes");
            list.Add(option);
            option = new Evado.Model.EvOption("No", "No");
            list.Add(option);
            //
            //Return the completed Array List.
            //
            return(list);
        }//END getOptionList method
        }     //END getFormFieldColumns method

        //===================================================================================
        /// <summary>
        /// This method appends the column objects for a list of form fields.
        /// </summary>
        /// <param name="Field">Evado.Digital.Model.EvFormField object</param>
        /// <param name="ResultData"> Evado.Integration.Model.EiData object</param>
        /// <param name="Row"> Evado.Integration.Model.EiDataRow object</param>
        //-----------------------------------------------------------------------------------
        private void getCheckBoxFieldColumnValues(
            Evado.Digital.Model.EdRecordField Field,
            Evado.Integration.Model.EiData ResultData,
            Evado.Integration.Model.EiDataRow Row)
        {
            this.LogMethod("getCheckBoxFieldColumnValues method.");
            //
            // Iterate through the list of checkbox options
            //
            for (int count = 0; count < Field.Design.OptionList.Count; count++)
            {
                //
                // get the option
                //
                Evado.Model.EvOption option = Field.Design.OptionList [count];

                string fieldId = Field.FieldId + "_" + count + "_" + option.Value;

                //
                // Set the checkbox listing output.
                //
                int column = ResultData.getColumnNo(fieldId);

                this.writeProcessLog("Column: " + column + ",\t FieldId: " + fieldId + ", Type: " + Field.TypeId + ", Value: " + Field.ItemValue);

                if (column > -1)
                {
                    if (Field.ItemValue.Contains(option.Value) == true)
                    {
                        Row.updateValue(column, "True");
                    }
                    else
                    {
                        Row.updateValue(column, "False");
                    }
                }
            } //END option iteration loop.
        }     //END getFormFieldColumns method
        }         //END getFormFieldColumns

        //===================================================================================
        /// <summary>
        /// This method appends the column objects for a list of form fields.
        /// </summary>
        /// <param name="Field">Evado.Digital.Model.EvFormField object</param>
        /// <param name="ResultData"> Evado.Integration.Model.EiData object</param>
        //-----------------------------------------------------------------------------------
        //private void getCheckBoxFieldColumn (
        public void getCheckBoxFieldColumn(
            Evado.Digital.Model.EdRecordField Field,
            Evado.Integration.Model.EiData ResultData)
        {
            this.LogMethod("getCheckBoxFieldColumn method.");
            //
            // Iterate through the list of checkbox options
            //
            for (int count = 0; count < Field.Design.OptionList.Count; count++)
            {
                //
                // get the option
                //
                Evado.Model.EvOption option = Field.Design.OptionList [count];

                //
                //The default data type is text.
                //
                ResultData.AddColumn(
                    Evado.Integration.Model.EiDataTypes.Boolean,
                    Field.FieldId + "_" + count + "_" + option.Value);
            } //END option iteration loop.
        }     //END getFormFieldColumns method
Example #13
0
        } // Close getView method.

        // ==================================================================================
        /// <summary>
        /// This class gets a ArrayList containing a selectionList of Menus data identifiers.
        /// </summary>
        /// <param name="PlatformId">string: (Optional) The Site identifier.</param>
        /// <returns>List of Evado.Model.EvOption: a list of groups</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Define the SQL query parameters and a query string.
        ///
        /// 2. Execute the query and store the results on datatable.
        ///
        /// 3. Loop through the table and extract data row to the Option object.
        ///
        /// 4. Add Option object's values to the Options list.
        ///
        /// 5. Return the Option list.
        ///
        /// </remarks>
        // ----------------------------------------------------------------------------------
        public List <Evado.Model.EvOption> getGroupList(
            String PlatformId)
        {
            this.LogMethod("getGroupList, ");
            this.LogDebug(" PlatformId: " + PlatformId);
            //
            // Initialize a debug log, a return list of options, an option object, site 1 and site 2
            //
            List <Evado.Model.EvOption> List = new List <Evado.Model.EvOption> ( );

            Evado.Model.EvOption option = new Evado.Model.EvOption( );

            //
            // Define the SQL query parameters.
            //
            SqlParameter [] cmdParms = new SqlParameter []
            {
                new SqlParameter(PARM_PLATFORM, SqlDbType.VarChar, 10),
            };
            cmdParms [0].Value = PlatformId;

            //
            // Define the query string.
            //
            _sqlQueryString = _sqlQuery_View + " WHERE ( MNU_PLATFORM = @PLATFORM)"
                              + " AND (MNU_GROUP_HEADER = 1) ORDER BY MNU_ORDER";

            this.LogDebug(_sqlQueryString);

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

                    //
                    // Process the results into the visitSchedule.
                    //
                    String stGroup = EvSqlMethods.getString(row, "MNU_GROUP");
                    String stTitle = EvSqlMethods.getString(row, "MNU_TITLE");

                    //
                    // if the group does not exist add it to the list.
                    //
                    if (GroupExists(List, stGroup) == false)
                    {
                        //
                        // Append the new Menus object to the array.
                        //
                        List.Add(new Evado.Model.EvOption(stGroup, stTitle));
                    }
                }
            }

            //
            // Pass back the result arrray.
            //
            return(List);
        }//END getGroupList method.
Example #14
0
 /// <summary>
 /// This method initialises the report quety object.
 /// </summary>
 public EdReportQuery( )
 {
     SelectionList [0] = new Evado.Model.EvOption( );
 }