/// <summary> /// This method inserts a 'Image' object. /// </summary> /// <param name='List<PolymorphicObject>'>The 'Image' to insert. /// <returns>A PolymorphicObject object with a Boolean value. internal PolymorphicObject InsertImage(List <PolymorphicObject> parameters, DataConnector dataConnector) { // Initial Value PolymorphicObject returnObject = new PolymorphicObject(); // locals Image image = null; // If the data connection is connected if ((dataConnector != null) && (dataConnector.Connected == true)) { // Create Insert StoredProcedure InsertImageStoredProcedure insertImageProc = null; // verify the first parameters is a(n) 'Image'. if (parameters[0].ObjectValue as Image != null) { // Create Image Parameter image = (Image)parameters[0].ObjectValue; // verify image exists if (image != null) { // Now create insertImageProc from ImageWriter // The DataWriter converts the 'Image' // to the SqlParameter[] array needed to insert a 'Image'. insertImageProc = ImageWriter.CreateInsertImageStoredProcedure(image); } // Verify insertImageProc exists if (insertImageProc != null) { // Execute Insert Stored Procedure returnObject.IntegerValue = this.DataManager.ImageManager.InsertImage(insertImageProc, dataConnector); } } else { // Raise Error Data Connection Not Available throw new Exception("The database connection is not available."); } } // return value return(returnObject); }