public override void SingUpTOCustomerExcursions(IExcursionsScheduleService excursionsScheduleService) { Choice("Please enter custome excursion id:"); string setting = ""; Console.WriteLine("Register one persone press 1.\n" + "Register many persone press another symbol"); setting = Console.ReadLine(); try { if (setting == "1") { excursionsScheduleService.SignUpToCustomExcursion(choice, mapper.Map <CustomerDTO>(CreateOne())); } else { excursionsScheduleService.SignUpToCustomExcursion(choice, mapper.Map <IEnumerable <CustomerDTO> >(CreateMany())); } }catch (ExcursionNotFoundException ex1) { Console.WriteLine(ex1.Message); } catch (SmallAgeCustomerException ex2) { Console.WriteLine(ex2.ToString()); } }
public override void GetExpositionScheduleExcursions(IExcursionsScheduleService excursionsScheduleService) { Choice("Please enter grafik or exposition Id :"); var scheduleExcursion = excursionsScheduleService.GetScheduledExcursionsInfo(choice); if (scheduleExcursion == null) { Console.WriteLine("Not found"); return; } Console.WriteLine(scheduleExcursion.ToString()); }
public void SetUp() { _fixture.Behaviors.Add(new OmitOnRecursionBehavior()); IMapper mapper = new MapperConfiguration(cfg => cfg.AddProfile <AutoMapping>()).CreateMapper();; using (var kernel = new NSubstituteMockingKernel()) { _expositionService = kernel.Get <IExpositionService>(); } _unitOfWork = Substitute.For <IUnitOfWork>(); _excursionsScheduleService = new ExcursionsScheduleService(_expositionService, mapper, _unitOfWork); }
static void Main(string[] args) { IKernel kernel = new StandardKernel(new PLModule(), new BLLModule("MuseumContext")); kernel.Load(Assembly.GetExecutingAssembly()); IMapper mapper = kernel.Get <IMapper>(); IExcursionsScheduleService excursionsSchedule = kernel.Get <IExcursionsScheduleService>(); IExpositionService exposition = kernel.Get <IExpositionService>(); IGrafikService grafik = kernel.Get <IGrafikService>(); IMenu menu = new Menu(mapper, excursionsSchedule, exposition, grafik); menu.MainMenu(); }
public override void GetExpositionCustomerExcursions(IExcursionsScheduleService excursionsScheduleService) { Choice("Please enter grafik or exposition Id :"); var customeExcursion = excursionsScheduleService.GetCustomExcursions(choice); if (customeExcursion == null) { Console.WriteLine("Not found"); return; } foreach (var item in customeExcursion) { Console.WriteLine(item.ToString()); } }
public Menu(IMapper mapper, IExcursionsScheduleService excursionsScheduleService, IExpositionService expositionService, IGrafikService grafikService) : base(excursionsScheduleService, expositionService, grafikService) { this.mapper = mapper; }
public CustomExcursionController(IMapper mapper, IExcursionsScheduleService excursionsScheduleService) { this.mapper = mapper; this.excursionsScheduleService = excursionsScheduleService; }
public abstract void SingUpTOCustomerExcursions(IExcursionsScheduleService excursionsScheduleService);
public abstract void GetExpositionCustomerExcursions(IExcursionsScheduleService excursionsScheduleService);
protected MenuTemplate(IExcursionsScheduleService excursionsScheduleService, IExpositionService expositionService, IGrafikService grafikService) { this.excursionsScheduleService = excursionsScheduleService; this.expositionService = expositionService; this.grafikService = grafikService; }