/// <summary> /// Retrieves a list of language items from the database. /// </summary> /// <param name="reader">The reader to be used to retrieve the data records.</param> /// <param name="baseTableName">The base table name of the language item.</param> /// <param name="baseTableID">The base table id of the language item.</param> /// <param name="targetTableName">The target table name of the language item.</param> /// <param name="order">The order in which the data records are to be sorted.</param> /// <returns>The list of language items.</returns> /// <exception cref="ArgumentNullException">Thrown when the given reader, base table name, base table id, target table name or order is null.</exception> public static List <LanguageItem> RetrieveList(DBReader reader, string baseTableName, string baseTableID, string targetTableName, string order = "ID") { if (reader == null) { throw new ArgumentNullException(nameof(reader)); } if (String.IsNullOrEmpty(baseTableName)) { throw new ArgumentNullException(nameof(baseTableName)); } if (String.IsNullOrEmpty(baseTableID)) { throw new ArgumentNullException(nameof(baseTableID)); } if (String.IsNullOrEmpty(targetTableName)) { throw new ArgumentNullException(nameof(targetTableName)); } if (String.IsNullOrEmpty(order)) { throw new ArgumentNullException(nameof(order)); } // Liste laden reader.Query = $"SELECT ID " + $"FROM {baseTableName}_{targetTableName} " + $"WHERE {baseTableName}ID=\"{baseTableID}\"" + $"ORDER BY {order}"; List <LanguageItem> list = new List <LanguageItem>(); if (reader.Retrieve(true) > 0) { list.Capacity = reader.Table.Rows.Count; foreach (DataRow row in reader.Table.Rows) { LanguageItem item = new LanguageItem(); item.BaseTableName = baseTableName; item.TargetTableName = targetTableName; item.ID = row["ID"].ToString(); item.Retrieve(false); list.Add(item); } } return(list); }
/// <summary> /// Retrieves the additional information of the movie from the database. /// </summary> /// <returns>The number of data records retrieved.</returns> public override int RetrieveAdditionalInformation() { int count = 0; // InfoBox data Genres = GenreItem.RetrieveList(Reader, $"Movie", ID, "Genre"); count += Genres.Count; Certifications = CertificationItem.RetrieveList(Reader, $"Movie", ID, "Certification"); count += Certifications.Count; Countries = CountryItem.RetrieveList(Reader, $"Movie", ID, "Country"); count += Countries.Count; Languages = LanguageItem.RetrieveList(Reader, $"Movie", ID, "Language"); count += Languages.Count; Runtimes = RuntimeItem.RetrieveList(Reader, $"Movie", ID, "Runtime"); count += Runtimes.Count; SoundMixes = SoundMixItem.RetrieveList(Reader, $"Movie", ID, "SoundMix"); count += SoundMixes.Count; Colors = ColorItem.RetrieveList(Reader, $"Movie", ID, "Color"); count += Colors.Count; AspectRatios = AspectRatioItem.RetrieveList(Reader, $"Movie", ID, "AspectRatio"); count += AspectRatios.Count; Cameras = CameraItem.RetrieveList(Reader, $"Movie", ID, "Camera"); count += Cameras.Count; Laboratories = LaboratoryItem.RetrieveList(Reader, $"Movie", ID, "Laboratory"); count += Laboratories.Count; FilmLengths = FilmLengthItem.RetrieveList(Reader, $"Movie", ID, "FilmLength"); count += FilmLengths.Count; NegativeFormats = NegativeFormatItem.RetrieveList(Reader, $"Movie", ID, "NegativeFormat"); count += NegativeFormats.Count; CinematographicProcesses = CinematographicProcessItem.RetrieveList(Reader, $"Movie", ID, "CinematographicProcess"); count += CinematographicProcesses.Count; PrintedFilmFormats = PrintedFilmFormatItem.RetrieveList(Reader, $"Movie", ID, "PrintedFilmFormat"); count += PrintedFilmFormats.Count; // Cast and crew data Directors = PersonItem.RetrieveList(Reader, $"Movie", ID, "Director"); count += Directors.Count; Writers = PersonItem.RetrieveList(Reader, $"Movie", ID, "Writer"); count += Writers.Count; Cast = CastPersonItem.RetrieveList(Reader, $"Movie", ID, "Cast"); count += Cast.Count; Producers = PersonItem.RetrieveList(Reader, $"Movie", ID, "Producer"); count += Producers.Count; Music = PersonItem.RetrieveList(Reader, $"Movie", ID, "Music"); count += Music.Count; Cinematography = PersonItem.RetrieveList(Reader, $"Movie", ID, "Cinematography"); count += Cinematography.Count; FilmEditing = PersonItem.RetrieveList(Reader, $"Movie", ID, "FilmEditing"); count += FilmEditing.Count; Casting = PersonItem.RetrieveList(Reader, $"Movie", ID, "Casting"); count += Casting.Count; ProductionDesign = PersonItem.RetrieveList(Reader, $"Movie", ID, "ProductionDesign"); count += ProductionDesign.Count; ArtDirection = PersonItem.RetrieveList(Reader, $"Movie", ID, "ArtDirection"); count += ArtDirection.Count; SetDecoration = PersonItem.RetrieveList(Reader, $"Movie", ID, "SetDecoration"); count += SetDecoration.Count; CostumeDesign = PersonItem.RetrieveList(Reader, $"Movie", ID, "CostumeDesign"); count += CostumeDesign.Count; MakeupDepartment = PersonItem.RetrieveList(Reader, $"Movie", ID, "MakeupDepartment"); count += MakeupDepartment.Count; ProductionManagement = PersonItem.RetrieveList(Reader, $"Movie", ID, "ProductionManagement"); count += ProductionManagement.Count; AssistantDirectors = PersonItem.RetrieveList(Reader, $"Movie", ID, "AssistantDirector"); count += AssistantDirectors.Count; ArtDepartment = PersonItem.RetrieveList(Reader, $"Movie", ID, "ArtDepartment"); count += ArtDepartment.Count; SoundDepartment = PersonItem.RetrieveList(Reader, $"Movie", ID, "SoundDepartment"); count += SoundDepartment.Count; SpecialEffects = PersonItem.RetrieveList(Reader, $"Movie", ID, "SpecialEffects"); count += SpecialEffects.Count; VisualEffects = PersonItem.RetrieveList(Reader, $"Movie", ID, "VisualEffects"); count += VisualEffects.Count; Stunts = PersonItem.RetrieveList(Reader, $"Movie", ID, "Stunts"); count += Stunts.Count; ElectricalDepartment = PersonItem.RetrieveList(Reader, $"Movie", ID, "ElectricalDepartment"); count += ElectricalDepartment.Count; AnimationDepartment = PersonItem.RetrieveList(Reader, $"Movie", ID, "AnimationDepartment"); count += AnimationDepartment.Count; CastingDepartment = PersonItem.RetrieveList(Reader, $"Movie", ID, "CastingDepartment"); count += CastingDepartment.Count; CostumeDepartment = PersonItem.RetrieveList(Reader, $"Movie", ID, "CostumeDepartment"); count += CostumeDepartment.Count; EditorialDepartment = PersonItem.RetrieveList(Reader, $"Movie", ID, "EditorialDepartment"); count += EditorialDepartment.Count; LocationManagement = PersonItem.RetrieveList(Reader, $"Movie", ID, "LocationManagement"); count += LocationManagement.Count; MusicDepartment = PersonItem.RetrieveList(Reader, $"Movie", ID, "MusicDepartment"); count += MusicDepartment.Count; ContinuityDepartment = PersonItem.RetrieveList(Reader, $"Movie", ID, "ContinuityDepartment"); count += ContinuityDepartment.Count; TransportationDepartment = PersonItem.RetrieveList(Reader, $"Movie", ID, "TransportationDepartment"); count += TransportationDepartment.Count; OtherCrew = PersonItem.RetrieveList(Reader, $"Movie", ID, "OtherCrew"); count += OtherCrew.Count; Thanks = PersonItem.RetrieveList(Reader, $"Movie", ID, "Thanks"); count += Thanks.Count; // Company data ProductionCompanies = CompanyItem.RetrieveList(Reader, $"Movie", ID, "ProductionCompany"); count += ProductionCompanies.Count; Distributors = DistributorCompanyItem.RetrieveList(Reader, $"Movie", ID, "Distributor"); count += Distributors.Count; SpecialEffectsCompanies = CompanyItem.RetrieveList(Reader, $"Movie", ID, "SpecialEffectsCompany"); count += SpecialEffectsCompanies.Count; OtherCompanies = CompanyItem.RetrieveList(Reader, $"Movie", ID, "OtherCompany"); count += OtherCompanies.Count; // Production data FilmingLocations = LocationItem.RetrieveList(Reader, $"Movie", ID, "FilmingLocation"); count += FilmingLocations.Count; FilmingDates = TimespanItem.RetrieveList(Reader, $"Movie", ID, "FilmingDate"); count += FilmingDates.Count; ProductionDates = TimespanItem.RetrieveList(Reader, $"Movie", ID, "ProductionDate"); count += ProductionDates.Count; // Image data Posters = ImageItem.RetrieveList(Reader, $"Movie", ID, "Poster"); count += Posters.Count; Covers = ImageItem.RetrieveList(Reader, $"Movie", ID, "Cover"); count += Covers.Count; Images = ImageItem.RetrieveList(Reader, $"Movie", ID, "Image"); count += Images.Count; // Text data Descriptions = TextItem.RetrieveList(Reader, $"Movie", ID, "Description"); count += Descriptions.Count; Reviews = TextItem.RetrieveList(Reader, $"Movie", ID, "Review"); count += Reviews.Count; // other data Awards = AwardItem.RetrieveList(Reader, $"Movie", ID, "Award"); count += Awards.Count; Weblinks = WeblinkItem.RetrieveList(Reader, $"Movie", ID, "Weblink"); count += Weblinks.Count; return(count); }