Exemplo n.º 1
0
        private void AddMovieView_Load(object sender, EventArgs e)
        {
            var persons =
                _personDao
                .GetAllPersons()
                .Select(personDto => $"{personDto.Name}/{personDto.Id}")
                .OrderBy(s => s);

            castPerson.DataSource = persons.ToList();
            crewPerson.DataSource = persons.ToList();

            var genresData = _genresDao.GetAllGenres();

            foreach (var genre in genresData)
            {
                genres.Items.Add($"{genre.Name}/{genre.GenreId}");
            }

            var countriesData = _countriesDao.GetAllCountries();

            foreach (var country in countriesData)
            {
                countries.Items.Add($"{country.Name}/{country.CountryId}");
            }

            var jobsData = _crewDao.GetAllJobs().OrderBy(x => x);

            crewJob.DataSource = jobsData.ToList();
        }
Exemplo n.º 2
0
        private void ReloadPersons()
        {
            person.Items.Clear();
            var persons =
                _personDao
                .GetAllPersons()
                .Select(personDto => $"{personDto.Name}/{personDto.Id}")
                .OrderBy(s => s);

            foreach (var person1 in persons)
            {
                person.Items.Add(person1);
            }
        }
Exemplo n.º 3
0
        private void allPerson_Click(object sender, EventArgs e)
        {
            var persons = _personDao.GetAllPersons();

            personView.DataSource = persons.Select(x => new { x.Id, x.Name }).ToList();
        }