/// <summary>
        /// This method creates an instance of a
        /// 'FindFieldSetFieldStoredProcedure' object and
        /// creates the sql parameter[] array needed
        /// to execute the procedure 'FieldSetField_Find'.
        /// </summary>
        /// <param name="fieldSetField">The 'FieldSetField' to use to
        /// get the primary key parameter.</param>
        /// <returns>An instance of an FetchUserStoredProcedure</returns>
        public static new FindFieldSetFieldStoredProcedure CreateFindFieldSetFieldStoredProcedure(FieldSetField fieldSetField)
        {
            // Initial Value
            FindFieldSetFieldStoredProcedure findFieldSetFieldStoredProcedure = null;

            // verify fieldSetField exists
            if (fieldSetField != null)
            {
                // Instanciate findFieldSetFieldStoredProcedure
                findFieldSetFieldStoredProcedure = new FindFieldSetFieldStoredProcedure();

                // if fieldSetField.FindByFieldSetId is true
                if (fieldSetField.FindByFieldSetId)
                {
                    // Change the procedure name
                    findFieldSetFieldStoredProcedure.ProcedureName = "FieldSetField_FindByFieldSetId";

                    // Create the @FieldSetId parameter
                    findFieldSetFieldStoredProcedure.Parameters = SqlParameterHelper.CreateSqlParameters("@FieldSetId", fieldSetField.FieldSetId);
                }
                else
                {
                    // Now create parameters for this procedure
                    findFieldSetFieldStoredProcedure.Parameters = CreatePrimaryKeyParameter(fieldSetField);
                }
            }

            // return value
            return(findFieldSetFieldStoredProcedure);
        }
        /// <summary>
        /// This method finds a  'FieldSetField' object.
        /// This method uses the 'FieldSetField_Find' procedure.
        /// </summary>
        /// <returns>A 'FieldSetField' object.</returns>
        /// </summary>
        public FieldSetField FindFieldSetField(FindFieldSetFieldStoredProcedure findFieldSetFieldProc, DataConnector databaseConnector)
        {
            // Initial Value
            FieldSetField fieldSetField = null;

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

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

                    // if row exists
                    if (row != null)
                    {
                        // Load FieldSetField
                        fieldSetField = FieldSetFieldReader.Load(row);
                    }
                }
            }

            // return value
            return(fieldSetField);
        }
示例#3
0
        /// <summary>
        /// This method finds a 'FieldSetField' object.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'FieldSetField' to delete.
        /// <returns>A PolymorphicObject object with a Boolean value.
        internal PolymorphicObject FindFieldSetField(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            FieldSetField fieldSetField = null;

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

                // verify the first parameters is a 'FieldSetField'.
                if (parameters[0].ObjectValue as FieldSetField != null)
                {
                    // Get FieldSetFieldParameter
                    FieldSetField paramFieldSetField = (FieldSetField)parameters[0].ObjectValue;

                    // verify paramFieldSetField exists
                    if (paramFieldSetField != null)
                    {
                        // Now create findFieldSetFieldProc from FieldSetFieldWriter
                        // The DataWriter converts the 'FieldSetField'
                        // to the SqlParameter[] array needed to find a 'FieldSetField'.
                        findFieldSetFieldProc = FieldSetFieldWriter.CreateFindFieldSetFieldStoredProcedure(paramFieldSetField);
                    }

                    // Verify findFieldSetFieldProc exists
                    if (findFieldSetFieldProc != null)
                    {
                        // Execute Find Stored Procedure
                        fieldSetField = this.DataManager.FieldSetFieldManager.FindFieldSetField(findFieldSetFieldProc, dataConnector);

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

            // return value
            return(returnObject);
        }
        /// <summary>
        /// This method creates an instance of a
        /// 'FindFieldSetFieldStoredProcedure' object and
        /// creates the sql parameter[] array needed
        /// to execute the procedure 'FieldSetField_Find'.
        /// </summary>
        /// <param name="fieldSetField">The 'FieldSetField' to use to
        /// get the primary key parameter.</param>
        /// <returns>An instance of an FetchUserStoredProcedure</returns>
        public static FindFieldSetFieldStoredProcedure CreateFindFieldSetFieldStoredProcedure(FieldSetField fieldSetField)
        {
            // Initial Value
            FindFieldSetFieldStoredProcedure findFieldSetFieldStoredProcedure = null;

            // verify fieldSetField exists
            if (fieldSetField != null)
            {
                // Instanciate findFieldSetFieldStoredProcedure
                findFieldSetFieldStoredProcedure = new FindFieldSetFieldStoredProcedure();

                // Now create parameters for this procedure
                findFieldSetFieldStoredProcedure.Parameters = CreatePrimaryKeyParameter(fieldSetField);
            }

            // return value
            return(findFieldSetFieldStoredProcedure);
        }