/// <summary> /// Updates the specified video in the database /// </summary> /// <param name="conn">Open connection to the database</param> /// <param name="video">Video object being updated in the database</param> public static void UpdateVideo(SqlConnection conn, Business.Video video) { try { SqlDbObject.ExecuteNonQuery("UpdateVideo", CommandType.StoredProcedure, video.GetMediaItemParametersForStoredProcedure(true), conn); } catch (System.Exception e) { throw new UpdateSqlDbObjectException("Could not update video in database", e); } }
/// <summary> /// Adds the specified video to the database and returns the Id that was generated /// </summary> /// <param name="conn">Open connection to the database</param> /// <param name="video">Video object being added to the database</param> /// <returns>New unique identifier of the video</returns> public static Int64 AddVideo(SqlConnection conn, Business.Video video) { try { return((Int64)SqlDbObject.ExecuteScalar("AddVideo", CommandType.StoredProcedure, video.GetMediaItemParametersForStoredProcedure(false), conn)); } catch (System.Exception e) { throw new AddSqlDbObjectException("Could not add video to database", e); } }