Beispiel #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
        // =====================================================================================
        /// <summary>
        /// This class returns a list of formfield selection list objects based on state and OrderBy string
        /// </summary>
        /// <param name="State">EvFormFieldSelectionList.PageLayoutStates: the selection list state</param>
        /// <returns>List of EvFormFieldSelectionList: a list of formfield selection list objects</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Execute the method to retrieve the list of formfield selection list objects
        ///
        /// 2. Return the list of formfield selection list objects
        /// </remarks>
        // -------------------------------------------------------------------------------------
        public List <EdPageLayout> getView(
            EdPageLayout.States State)
        {
            this.LogMethod("getView");
            this.LogDebug("State: " + State);

            List <EdPageLayout> view = this._dal_SelectionLists.getView(State);

            this.LogClass(this._dal_SelectionLists.Log);

            return(view);
        }//End getMilestoneList method.
        }//End getMilestoneList method.

        // =====================================================================================
        /// <summary>
        /// This class returns a list of options for the formfield selection list objects
        /// </summary>
        /// <param name="State">EvFormFieldSelectionList.PageLayoutStates: a selectionlist state</param>
        /// <param name="SelectByGuid">Boolean: true, if the list is selected by unique identifier</param>
        /// <returns>List of EvOption: a list of options for the formfield selection list objects</returns>
        /// <remarks>
        /// This class consists of the following steps:
        ///
        /// 1. Execute the method for retrieving a list of options for the formfield selection list objects
        ///
        /// 2. Return a list of options for the formfield selection list objects.
        /// </remarks>
        // -------------------------------------------------------------------------------------
        public List <EvOption> getList
            (EdPageLayout.States State,
            bool SelectByGuid)
        {
            this.LogMethod("getList method.");
            this.LogDebug("State: " + State);

            List <EvOption> list = this._dal_SelectionLists.getList(State, SelectByGuid);

            this.LogClass(this._dal_SelectionLists.Log);

            return(list);
        }//END getList method
Beispiel #4
0
        }//END readDataRow method.

        #endregion

        #region SelectionList Queries

        // =====================================================================================
        /// <summary>
        /// This class returns the list of formfield selectionlist object using state and orderBy values
        /// </summary>
        /// <param name="State">EvFormFieldSelectionList.SelectionListStates: an enumeration state</param>
        /// <returns>List of EvFormFieldSelectionList: a list of formfield selectionlist object</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Define the sql query parameter and sql query string
        ///
        /// 2. Execute the sql query string with parameters and store the results on datatable.
        ///
        /// 3. Iterate through the table and extract datarow to the formfield selectionlist object
        ///
        /// 4. Add the object values to the Formfield selection list.
        ///
        /// 5. Return the Formfield selection list.
        /// </remarks>
        //  ---------------------------------------------------------------------------------
        public List <EdPageLayout> getView(
            EdPageLayout.States State)
        {
            //
            // Initialize the method status and a return list of formfield selectionlist object
            //
            this.LogMethod("getView method.");
            this._Log.AppendLine("State: " + State);

            List <EdPageLayout> view = new List <EdPageLayout> ( );
            String sqlQueryString    = String.Empty;

            //
            // Define the sql query parameter and load the query values.
            //
            SqlParameter [] cmdParms = new SqlParameter []
            {
                new SqlParameter(EdPageLayouts.PARM_STATE, SqlDbType.VarChar, 20)
            };
            cmdParms [0].Value = State.ToString( );

            //
            // Define the sql query string.
            //
            sqlQueryString = SQL_VIEW_QUERY;
            if (State != EdPageLayout.States.Null)
            {
                sqlQueryString += " WHERE ( " + EdPageLayouts.DB_STATE + " = " + EdPageLayouts.PARM_STATE + " ) "
                                  + " AND (" + EdPageLayouts.DB_DELETED + " = 0) "
                                  + " ORDER BY " + EdPageLayouts.DB_PAGE_ID + ";";
            }
            else
            {
                sqlQueryString += " WHERE (  " + EdPageLayouts.DB_STATE + " <> '" + EdPageLayout.States.Withdrawn + "' ) "
                                  + " AND (" + EdPageLayouts.DB_DELETED + " = 0) "
                                  + " ORDER BY " + EdPageLayouts.DB_PAGE_ID + ";";
            }


            this.LogDebug("SQL Query: " + 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];

                    EdPageLayout pageLayout = this.readDataRow(row);

                    //
                    // retrieve the parameter object values.
                    //
                    pageLayout.Parameters = this.LoadObjectParameters(pageLayout.Guid);

                    //
                    // Append the value to the visit
                    //
                    view.Add(pageLayout);
                } //END interation loop.
            }     //END using statement

            this.LogDebug(" view count: " + view.Count.ToString( ));
            //
            // return the Array object.
            //
            return(view);
        }// END getView method.