Ejemplo n.º 1
0
        }//END GetItem class.

        #endregion

        #region Class update methods

        // ==================================================================================
        /// <summary>
        /// This class adds a record to the binary file table.
        /// </summary>
        /// <param name="BinaryFile">EvBinaryFileMetaData: a binary file object</param>
        /// <returns>EvEventCodes: an event code for adding items to the binary file table</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Define sql query parameters and execute the storeprocedure for adding items.
        ///
        /// 2. Return the event code for adding new items.
        /// </remarks>
        // ----------------------------------------------------------------------------------
        public EvEventCodes addItem(EvBinaryFileMetaData BinaryFile)
        {
            this.LogMethod("addItem method. ");
            this.LogDebug(" BinaryFile.Version: " + BinaryFile.Version);
            this.LogDebug(" BinaryFile.FileEncrypted: " + BinaryFile.FileEncrypted);
            this.LogDebug(" BinaryFile.FileExists: " + BinaryFile.FileExists);
            this.LogDebug(" BinaryFile.Comments: " + BinaryFile.Comments);
            this.LogDebug(" BinaryFile.Language: " + BinaryFile.Language);
            //
            // Initialize a method debug status.
            //
            BinaryFile.FileExists = true;

            //
            // Define the SQL query parameters and load the query values.
            //
            SqlParameter [] _cmdParms = getItemsParameters( );
            SetParameters(_cmdParms, BinaryFile);

            this.LogDebug(EvSqlMethods.ListParameters(_cmdParms));

            //
            // Execute the update command.
            //
            if (EvSqlMethods.StoreProcUpdate(_storedProcedureAddItem, _cmdParms) == 0)
            {
                this.LogMethodEnd("addItem");
                return(EvEventCodes.Database_Record_Update_Error);
            }

            this.LogMethodEnd("addItem");
            return(EvEventCodes.Ok);
        }//END addItem method.