コード例 #1
0
        /// <summary>
        /// This method creates an instance of a
        /// 'FindUserInterfaceStoredProcedure' object and
        /// creates the sql parameter[] array needed
        /// to execute the procedure 'UserInterface_Find'.
        /// </summary>
        /// <param name="userInterface">The 'UserInterface' to use to
        /// get the primary key parameter.</param>
        /// <returns>An instance of an FetchUserStoredProcedure</returns>
        public static new FindUserInterfaceStoredProcedure CreateFindUserInterfaceStoredProcedure(UserInterface userInterface)
        {
            // Initial Value
            FindUserInterfaceStoredProcedure findUserInterfaceStoredProcedure = null;

            // verify userInterface exists
            if (userInterface != null)
            {
                // Instanciate findUserInterfaceStoredProcedure
                findUserInterfaceStoredProcedure = new FindUserInterfaceStoredProcedure();

                // if userInterface.FindByProjectId is true
                if (userInterface.FindByProjectId)
                {
                    // Change the procedure name
                    findUserInterfaceStoredProcedure.ProcedureName = "UserInterface_FindByProjectId";

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

            // return value
            return(findUserInterfaceStoredProcedure);
        }
コード例 #2
0
        /// <summary>
        /// This method finds a  'UserInterface' object.
        /// This method uses the 'UserInterface_Find' procedure.
        /// </summary>
        /// <returns>A 'UserInterface' object.</returns>
        /// </summary>
        public UserInterface FindUserInterface(FindUserInterfaceStoredProcedure findUserInterfaceProc, DataConnector databaseConnector)
        {
            // Initial Value
            UserInterface userInterface = null;

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

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

                    // if row exists
                    if (row != null)
                    {
                        // Load UserInterface
                        userInterface = UserInterfaceReader.Load(row);
                    }
                }
            }

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

            // locals
            UserInterface userInterface = null;

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

                // verify the first parameters is a 'UserInterface'.
                if (parameters[0].ObjectValue as UserInterface != null)
                {
                    // Get UserInterfaceParameter
                    UserInterface paramUserInterface = (UserInterface)parameters[0].ObjectValue;

                    // verify paramUserInterface exists
                    if (paramUserInterface != null)
                    {
                        // Now create findUserInterfaceProc from UserInterfaceWriter
                        // The DataWriter converts the 'UserInterface'
                        // to the SqlParameter[] array needed to find a 'UserInterface'.
                        findUserInterfaceProc = UserInterfaceWriter.CreateFindUserInterfaceStoredProcedure(paramUserInterface);
                    }

                    // Verify findUserInterfaceProc exists
                    if (findUserInterfaceProc != null)
                    {
                        // Execute Find Stored Procedure
                        userInterface = this.DataManager.UserInterfaceManager.FindUserInterface(findUserInterfaceProc, dataConnector);

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

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

            // verify userInterface exists
            if (userInterface != null)
            {
                // Instanciate findUserInterfaceStoredProcedure
                findUserInterfaceStoredProcedure = new FindUserInterfaceStoredProcedure();

                // Now create parameters for this procedure
                findUserInterfaceStoredProcedure.Parameters = CreatePrimaryKeyParameter(userInterface);
            }

            // return value
            return(findUserInterfaceStoredProcedure);
        }