/// <summary> /// Store News Media Content /// </summary> /// <param name="newsMedia">newsMedia</param> /// <returns>Returns the news media content</returns> public NewsMedia StoreNewsMedia(NewsMedia newsMedia) { NewsMediaManagementComponent nmmc = new NewsMediaManagementComponent(); return nmmc.StoreNewsMedia(newsMedia); }
/// <summary> /// Deletes the News Media Content /// </summary> /// <param name="newsMedia">newsMedia</param> /// <returns>Returns the flag if deleted</returns> public Boolean DeleteNewsMedia(NewsMedia newsMedia) { NewsMediaManagementComponent nmmc = new NewsMediaManagementComponent(); return nmmc.DeleteNewsMedia(newsMedia); }
/// <summary> /// Deletes the News Media Content /// </summary> /// <param name="newsMedia">newsMedia</param> /// <returns>Returns the flag if deleted</returns> public Boolean DeleteNewsMedia(NewsMedia newsMedia) { var newsMediaManagementDAC = new NewsMediaManagementDAC(); Boolean returnFlag = newsMediaManagementDAC.Delete(newsMedia); return returnFlag; }
/// <summary> /// Append NewsMedia With ASF (Advanced Systems Format) /// </summary> /// <param name="newsmedia">NewsMedia</param> /// <returns>Returns News Media Appended with ASF</returns> public NewsMedia AppendASF (NewsMedia media) { string locationURL = media.LocationURL; MediaStreamASF mediaStream = new MediaStreamASF (); mediaStream.AppendASF (locationURL,media.LicenseURL,media.LicenseIssuerURL); return media; }
/// <summary> /// Create News Media Content /// </summary> /// <param name="newsMedia">newsMedia</param> /// <returns>Returns the news media content</returns> public NewsMedia Create(NewsMedia newsMedia) { using(var database = new DbContext(CONNECTION_NAME)) { database.Set<NewsMedia>().Add(newsMedia); database.SaveChanges(); return newsMedia; } }
/// <summary> /// Update News Media Content /// </summary> /// <param name="newsMedia">newsMedia</param> /// <returns>Returns the news media content</returns> public NewsMedia UpdateNewsMedia(NewsMedia newsMedia) { var newsMediaManagementDAC = new NewsMediaManagementDAC(); using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required)) { newsMediaManagementDAC.Update(newsMedia); ts.Complete(); } return newsMedia; }
/// <summary> /// Update News Media Content /// </summary> /// <param name="newsMedia">newsMedia</param> /// <returns>Returns the news media content</returns> public NewsMedia Update(NewsMedia newsMedia) { using (var database = new DbContext(CONNECTION_NAME)) { var entryMedia = database.Entry<NewsMedia>(newsMedia); entryMedia.State = EntityState.Unchanged; entryMedia.Property("Status").IsModified = true; entryMedia.Property("Remarks").IsModified = true; entryMedia.Property("IsCompleted").IsModified = true; database.SaveChanges(); } }
/// <summary> /// Update News Media Content /// </summary> /// <param name="newsMedia">newsMedia</param> /// <returns>Returns the news media content</returns> public NewsMedia UpdateNewsMedia(NewsMedia newsMedia) { NewsMediaManagementComponent nmmc = new NewsMediaManagementComponent(); return nmmc.UpdateNewsMedia(newsMedia); }
/// <summary> /// Deletes the News Media Content /// </summary> /// <param name="newsMedia">newsMedia</param> /// <returns>Returns the flag if deleted</returns> public Boolean Delete(NewsMedia newsMedia) { using (var database = new DbContext(CONNECTION_NAME)) { var entryMedia = database.Entry<NewsMedia>(newsMedia); return database.DeleteObject(entryMedia); } }