コード例 #1
0
        private static void ImportAuditorium(AuditoriumDTO auditoriumDto)
        {
            string cinemaName = auditoriumDto.CinemaName;

            InputDataValidator.ValidateStringMaxLength(cinemaName, Constants.MaxCinemaNameLength);

            string townName = auditoriumDto.CinemaTownName;

            TownValidator.CheckTownExisting(townName);

            int townId   = TownService.GetTownId(townName);
            int cinemaId = CinemaService.GetCinemaId(cinemaName, townId);

            CinemaValidator.CheckCinemaExisting(cinemaName, townId);

            byte number = auditoriumDto.Number;

            AuditoriumValidator.ValidateAuditoriumDoesNotExist(number, cinemaId, cinemaName);



            AuditoriumService.AddAuditorium(number, cinemaId);

            Console.WriteLine(string.Format(Constants.ImportSuccessMessages.AuditoriumAddedSuccess, number, cinemaName, townName));
        }