/// <summary> /// sets image information in the databse /// </summary> /// <param name="image">data to put into the database</param> /// <returns>number of changed rows</returns> public int SetSocialMediaImage(SocialMediaImage image) { SqlCommand query = new SqlCommand("" + $"INSERT INTO {Table} ({ColMessageID}, {ColURL}) " + $"VALUES (@{ColMessageID}, @{ColURL})"); // prepare values in statement query.Parameters.Add($"@{ColMessageID}", System.Data.SqlDbType.Int); query.Parameters.Add($"@{ColURL}", System.Data.SqlDbType.VarChar); query.Parameters[$"@{ColMessageID}"].Value = image.SocialMediaMessageID; query.Parameters[$"@{ColURL}"].Value = image.URL; return(_dbContext.ExecuteQuery(query)); }
/// <summary> /// Retrieves the rest of the images from the social media message. /// </summary> /// <param name="image">image to use to find the social media message</param> public void ShowImages(SocialMediaImage image) { new MediaWindow(new SocialMediaImageController().GetSocialMediaImages(image.SocialMediaMessageID)).Show(); }