예제 #1
0
        internal void ShowContributors(Role role)
        {
            AbstractPersonRepository     pRepo  = _personRepository;
            AbstractFilmPersonRepository fpRepo = _filmPersonRepository;
            List <Guid>   ids   = fpRepo.ListPersonIdsForilmIdAndRole(CurrentFilm.Id, role);
            List <string> names = new List <string>();

            foreach (Guid id in ids)
            {
                Person p = pRepo.GetById(id);
                names.Add(p.FullName);
            }
            if (names.Count > 0)
            {
                StringChooser chooser = new StringChooser(names);
                chooser.Show();
            }
            else
            {
                string[] contribkind = { "contributors", "actors", "composers", "directors", "scriptwriters" };

                string kind = contribkind[(int)role];

                ReportIt("There are (as yet) no " + kind + " defined for this film");
            }
        }
예제 #2
0
        internal void ShowContributors(Role role)
        {
            FilmPersonRepository filmPersonRepo = _factory.CreateFilmPersonRepository();
            PersonRepository     personRepo     = _factory.CreatePersonRepository();
            List <Guid>          ids            = filmPersonRepo.ListPersonIdsForFilmIdAndRole(CurrentFilm.Id, role) as List <Guid>;
            List <string>        fullNames      = new List <string>();

            foreach (Guid g in ids)
            {
                Person p = personRepo.GetById(g);
                fullNames.Add(p.FullName);
            }
            StringChooser chooser = new StringChooser(fullNames);

            chooser.Show();
        }
예제 #3
0
        private Person ChooseAUniquePerson(List <Person> candidates)
        {
            Person        result    = null;
            List <string> fullNames = new List <string>();

            foreach (Person p in candidates)
            {
                fullNames.Add(p.FullName);
            }
            StringChooser chooser = new StringChooser(fullNames);

            chooser.Show();
            if (chooser.Accept)
            {
                result = _personRepository.GetByFullName(chooser.ChosenString);
            }
            return(result);
        }
예제 #4
0
        internal void ShowCountries()
        {
            AbstractFilmCountryRepository fcRepo = _filmCountryRepository;
            AbstractCountryRepository     cRepo  = _countryRepository;
            List <Guid>   ids   = fcRepo.ListCountryIdsForFilmId(CurrentFilm.Id);
            List <string> names = new List <string>();

            foreach (Guid id in ids)
            {
                Country c = cRepo.GetById(id);
                names.Add(c.Name);
            }
            if (names.Count > 0)
            {
                StringChooser chooser = new StringChooser(names);
                chooser.Show();
            }
            else
            {
                ReportIt("No countries are defined for " + CurrentFilm.Title);
            }
        }
예제 #5
0
        internal void ShowCountries()
        {
            FilmCountryRepository fcRepo = _factory.CreateFilmCountryRepository();
            CountryRepository     cRepo  = _factory.CreateCountryRepository();
            List <Guid>           ids    = fcRepo.ListCountryIdsForFilmId(CurrentFilm.Id) as List <Guid>;
            List <string>         names  = new List <string>();

            foreach (Guid g in ids)
            {
                Country c = cRepo.GetById(g);
                names.Add(c.Name);
            }
            if (names.Count == 0)
            {
                FilmMessageBox box = new FilmMessageBox("There are as yet no countries defined for this film.");
                box.Show();
            }
            else
            {
                StringChooser chooser = new StringChooser(names);
                chooser.Show();
            }
        }