Exemple #1
0
        private void ImportCinema(CinemaDto cinemaDto)
        {
            string townName = cinemaDto.TownName;

            InputDataValidator.ValidateStringMaxLength(townName, Constants.MaxTownNameLength);

            string cinemaName = cinemaDto.Name;

            InputDataValidator.ValidateStringMaxLength(cinemaName, Constants.MaxCinemaNameLength);

            townService.AddTownIfNotExisting(townName);
            int townId = townService.GetTownId(townName);

            cinemaValidator.ValidateCinemaDoesNotExist(cinemaName, townId);

            cinemaService.AddCinema(cinemaName, townId);

            Console.WriteLine(string.Format(Constants.ImportSuccessMessages.CinemaAddedSuccess, cinemaName));
        }