public Ticket CreateTicket(ITicketDetailsFactory factory) { _ticketDetailsFactory = factory; ticket = new SimpleTicket(_ticketDetailsFactory); ticket.CreateTicketDetails(); return(ticket); }
public Ticket CreateTicket(ITicketDetailsFactory factory) { Ticket monthTicket = new MonthTicket(factory); monthTicket.CreateTicketDetails(); return(monthTicket); }
public Ticket CreateTicket(ITicketDetailsFactory detailFactory) { _ticketDetailsFactory = detailFactory; Ticket ticket = new PeriodTicket(_ticketDetailsFactory); ticket.CreateTicketDetails(); return(ticket); }
public Ticket CreateTicket(ITicketDetailsFactory factory) { Ticket ticket = null; if (factory is MonthTicketDetails) { ticket = new MonthTicket(factory); } if (factory is SimpleTicketDetails) { ticket = new SimpleTicket(factory); } if (factory is PeriodTicketDetails) { ticket = new PeriodTicket(factory); } ticket.CreateTicketDetails(); return(ticket); }
public SimpleTicket(ITicketDetailsFactory simpleTicketDetailsFactory) { _simpleTicketDetailsFactory = simpleTicketDetailsFactory; TicketType = "Simple Ticket"; CreatedDate = DateTime.Now; }
public MonthTicket(ITicketDetailsFactory factory) { monthTicketDetailsFactory = factory; TicketType = "Month Ticket"; CreatedDate = DateTime.Now; }
public PeriodTicket(ITicketDetailsFactory factory) { TicketType = "Period Ticket"; CreatedDate = DateTime.Now; _detailsFactory = factory; }