//In Main: void NewCinemaMenu() { MenuTitle newCinemaMenu = "New Cinema Menu"; MenuItem[] newCinemaMenuItems = { }; ShowMenu(newCinemaMenu, newCinemaMenuItems); string cinemaName = IO_Handler.EnterString("Please, enter the name of the new cinema: "); if (ObjectContainer.CDB.Contains(ObjectContainer.CDB.Find(i => i.Name == cinemaName.ToUpper()))) { throw new Exception("This Cinema has already exists!"); } byte auditoriumCount = IO_Handler.EnterByte("Please, enter the number of auditoriums: "); new Cinema(cinemaName, auditoriumCount); CinemasMenuMethods[cinemaCounter++] = InCinemaMenu; IO_Handler.SuccessMessage($"New Cinema: \"{cinemaName}\" has been created with {auditoriumCount} Auditorium{(auditoriumCount>1?"s":"")} in it."); Thread.Sleep(sleepTime); }
} //Not implemented in PresentationLayer, so become obsolete: private Projection ReturnProjectionByName() { #region debug message #if DEBUG IO_Handler.LogItsCaller(); #endif #endregion string projectionName = ""; while (!OwnProjections.ContainsKey(projectionName)) { projectionName = IO_Handler.EnterString("Name of the movie you are looking for: ").ToUpper(); if (!OwnProjections.ContainsKey(projectionName)) { IO_Handler.ErrorMessage($"There is no such Projection in this Auditorium No#{Id} with the given name!"); Console.WriteLine("Please, pick one from the following:"); IO_Handler.PrintCollection(OwnProjections.Keys); } } Projection Result = OwnProjections[projectionName]; IO_Handler.SuccessMessage("Projection found!"); return(Result); } //Not implemented in PresentationLayer, so become obsolete:
public void AddNewProjection() { #region debug message #if DEBUG IO_Handler.LogItsCaller(); #endif #endregion if (OwnProjections.Count < 5) { string movieName = IO_Handler.EnterString($"{OwnerCinema}/{this}:\n" + $"Enter the name of the movie beeing projected: ").ToUpper(); if (OwnProjections.ContainsKey(movieName)) { throw new OperationCanceledException("Operation canceled: This movie has already beeing projected here!"); } byte movieLength = IO_Handler.EnterByte("Enter the length of this movie in minutes: "); Movie currentMovie = new Movie(movieName, movieLength); TestAndCreate(currentMovie); } else { IO_Handler.ErrorMessage("Projection Limit Reached"); } }