Beispiel #1
0
        // =====================================================================================
        /// <summary>
        /// This method gets an ArrayList contain the DatabaseUpdates objects
        /// </summary>
        /// <param name="Version">EvDataBaseUpdate.UpdateVersionList: A sorting order of the list</param>
        /// <param name="OrderBy">EvDataBaseUpdate.DataBaseUpdateOrderBy: A sorting order of the list</param>
        /// <returns>List of EvDataBaseUpdate: a list of database update objects</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Execute the method for retrieving a selection list of Application event objects.
        ///
        /// 2. Return the selection list.
        /// </remarks>
        // -------------------------------------------------------------------------------------
        public List <EvDataBaseUpdate> getUpdateList(
            EvDataBaseUpdate.UpdateVersionList Version,
            EvDataBaseUpdate.UpdateOrderBy OrderBy)
        {
            this.LogMethod("getUpdateList method. ");
            //
            // Execute the selectionList method.
            //
            List <EvDataBaseUpdate> view = this._DalDatabaseUpdates.getUpdateList(Version, OrderBy);

            this.LogClass(this._DalDatabaseUpdates.Log);

            this.LogMethodEnd("getUpdateList");

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

        #endregion

        #region Class Query method section

        // ==================================================================================
        /// <summary>
        /// This class gets a List containing a selectionList of ApplicationEvent data objects.
        /// </summary>
        /// <param name="Version">EvDataBaseUpdate.UpdateVersionList: A sorting order of the list</param>
        /// <param name="OrderBy">EvDataBaseUpdate.DataBaseUpdateOrderBy: The sorting order enumeration.</param>
        /// <returns>List of EvDataBaseUpdate: a view of database update list</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Initialize a status string and a return view of database update list.
        ///
        /// 2. Define the query string.
        ///
        /// 3. Execute the query against the database.
        ///
        /// 4. Iterate through the results extracting the role information.
        ///
        /// 5. Extract the table row
        ///
        /// 6. Append the value to the visit
        ///
        /// 7. Return the view
        /// </remarks>
        // ----------------------------------------------------------------------------------
        public List <EvDataBaseUpdate> getUpdateList(
            EvDataBaseUpdate.UpdateVersionList Version,
            EvDataBaseUpdate.UpdateOrderBy OrderBy)
        {
            //
            // Initialize a status string and a return database update view list.
            //
            this.LogMethod("getUpdateList method. ");
            this.LogDebug("Version: " + Version);
            this.LogDebug("OrderBy: " + OrderBy);
            List <EvDataBaseUpdate> view = new List <EvDataBaseUpdate> ( );

            //
            // Define the query string.
            //
            string sqlQueryString = _sqlQuery_View;

            switch (Version)
            {
            case EvDataBaseUpdate.UpdateVersionList.Version_2:
            {
                sqlQueryString += "WHERE DBU_Version LIKE '%R2%' \r\n";
                break;
            }

            case EvDataBaseUpdate.UpdateVersionList.Version_3:
            {
                sqlQueryString += "WHERE DBU_Version LIKE '%R3%' \r\n";
                break;
            }

            case EvDataBaseUpdate.UpdateVersionList.Version_4:
            {
                sqlQueryString += "WHERE DBU_Version LIKE '%R4%' \r\n";
                break;
            }

            case EvDataBaseUpdate.UpdateVersionList.Version_4_1:
            {
                sqlQueryString += "WHERE DBU_Version LIKE '%R4.1%' \r\n";
                break;
            }

            case EvDataBaseUpdate.UpdateVersionList.Version_4_2:
            {
                sqlQueryString += "WHERE DBU_Version LIKE '%R4.2%' \r\n";
                break;
            }

            case EvDataBaseUpdate.UpdateVersionList.Version_4_3:
            {
                sqlQueryString += "WHERE DBU_Version LIKE '%R4.3%' \r\n";
                break;
            }

            case EvDataBaseUpdate.UpdateVersionList.Version_4_4:
            {
                sqlQueryString += "WHERE DBU_Version LIKE '%R4.4%' \r\n";
                break;
            }

            case EvDataBaseUpdate.UpdateVersionList.Version_4_5:
            {
                sqlQueryString += "WHERE DBU_Version LIKE '%R4.5%' \r\n";
                break;
            }

            case EvDataBaseUpdate.UpdateVersionList.Version_4_6:
            {
                sqlQueryString += "WHERE DBU_Version LIKE '%R4.6%' \r\n";
                break;
            }

            case EvDataBaseUpdate.UpdateVersionList.Version_4_7:
            {
                sqlQueryString += "WHERE DBU_Version LIKE '%R4.7%' \r\n";
                break;
            }

            case EvDataBaseUpdate.UpdateVersionList.Version_4_8:
            {
                sqlQueryString += "WHERE DBU_Version LIKE '%R4.8%' \r\n";
                break;
            }

            case EvDataBaseUpdate.UpdateVersionList.Version_5:
            {
                sqlQueryString += "WHERE DBU_Version LIKE '%R5%' \r\n";
                break;
            }

            case EvDataBaseUpdate.UpdateVersionList.Version_6:
            {
                sqlQueryString += "WHERE DBU_Version LIKE '%R6%' \r\n";
                break;
            }

            case EvDataBaseUpdate.UpdateVersionList.Version_7:
            {
                sqlQueryString += "WHERE DBU_Version LIKE '%R7%' \r\n";
                break;
            }
            }

            switch (OrderBy)
            {
            case EvDataBaseUpdate.UpdateOrderBy.Date:
            {
                sqlQueryString += " ORDER BY DBU_Update_Date, DBU_Update_No ;";
                break;
            }

            case EvDataBaseUpdate.UpdateOrderBy.Version:
            {
                sqlQueryString += " ORDER BY DBU_Version, DBU_Update_Date  ;";
                break;
            }

            default:
            {
                sqlQueryString += " ORDER BY DBU_Update_No ;";
                break;
            }
            }
            this.LogDebug(sqlQueryString);
            //
            // Execute the query against the database.
            //
            using (DataTable table = EvSqlMethods.RunQuery(sqlQueryString, null))
            {
                //
                // 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];

                    EvDataBaseUpdate update = this.readDataRow(row);

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

            //
            // Pass back the result arrray.
            //
            return(view);
        }//END getView method.