コード例 #1
0
        /// <summary>
        /// This method finds a  'StreetName' object.
        /// This method uses the 'StreetName_Find' procedure.
        /// </summary>
        /// <returns>A 'StreetName' object.</returns>
        /// </summary>
        public StreetName FindStreetName(FindStreetNameStoredProcedure findStreetNameProc, DataConnector databaseConnector)
        {
            // Initial Value
            StreetName streetName = null;

            // Verify database connection is connected
            if ((databaseConnector != null) && (databaseConnector.Connected))
            {
                // First Get Dataset
                DataSet streetNameDataSet = this.DataHelper.LoadDataSet(findStreetNameProc, databaseConnector);

                // Verify DataSet Exists
                if (streetNameDataSet != null)
                {
                    // Get DataTable From DataSet
                    DataRow row = this.DataHelper.ReturnFirstRow(streetNameDataSet);

                    // if row exists
                    if (row != null)
                    {
                        // Load StreetName
                        streetName = StreetNameReader.Load(row);
                    }
                }
            }

            // return value
            return(streetName);
        }
コード例 #2
0
        /// <summary>
        /// This method finds a 'StreetName' object.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'StreetName' to delete.
        /// <returns>A PolymorphicObject object with a Boolean value.
        internal PolymorphicObject FindStreetName(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            StreetName streetName = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Create Find StoredProcedure
                FindStreetNameStoredProcedure findStreetNameProc = null;

                // verify the first parameters is a 'StreetName'.
                if (parameters[0].ObjectValue as StreetName != null)
                {
                    // Get StreetNameParameter
                    StreetName paramStreetName = (StreetName)parameters[0].ObjectValue;

                    // verify paramStreetName exists
                    if (paramStreetName != null)
                    {
                        // Now create findStreetNameProc from StreetNameWriter
                        // The DataWriter converts the 'StreetName'
                        // to the SqlParameter[] array needed to find a 'StreetName'.
                        findStreetNameProc = StreetNameWriter.CreateFindStreetNameStoredProcedure(paramStreetName);
                    }

                    // Verify findStreetNameProc exists
                    if (findStreetNameProc != null)
                    {
                        // Execute Find Stored Procedure
                        streetName = this.DataManager.StreetNameManager.FindStreetName(findStreetNameProc, dataConnector);

                        // if dataObject exists
                        if (streetName != null)
                        {
                            // set returnObject.ObjectValue
                            returnObject.ObjectValue = streetName;
                        }
                    }
                }
                else
                {
                    // Raise Error Data Connection Not Available
                    throw new Exception("The database connection is not available.");
                }
            }

            // return value
            return(returnObject);
        }
コード例 #3
0
        /// <summary>
        /// This method creates an instance of a
        /// 'FindStreetNameStoredProcedure' object and
        /// creates the sql parameter[] array needed
        /// to execute the procedure 'StreetName_Find'.
        /// </summary>
        /// <param name="streetName">The 'StreetName' to use to
        /// get the primary key parameter.</param>
        /// <returns>An instance of an FetchUserStoredProcedure</returns>
        public static FindStreetNameStoredProcedure CreateFindStreetNameStoredProcedure(StreetName streetName)
        {
            // Initial Value
            FindStreetNameStoredProcedure findStreetNameStoredProcedure = null;

            // verify streetName exists
            if (streetName != null)
            {
                // Instanciate findStreetNameStoredProcedure
                findStreetNameStoredProcedure = new FindStreetNameStoredProcedure();

                // Now create parameters for this procedure
                findStreetNameStoredProcedure.Parameters = CreatePrimaryKeyParameter(streetName);
            }

            // return value
            return(findStreetNameStoredProcedure);
        }