コード例 #1
0
 public Ticket CreateTicket(ITicketDetailsFactory factory)
 {
     _ticketDetailsFactory = factory;
     ticket = new SimpleTicket(_ticketDetailsFactory);
     ticket.CreateTicketDetails();
     return(ticket);
 }
コード例 #2
0
        public Ticket CreateTicket(ITicketDetailsFactory factory)
        {
            Ticket monthTicket = new MonthTicket(factory);

            monthTicket.CreateTicketDetails();
            return(monthTicket);
        }
コード例 #3
0
        public Ticket CreateTicket(ITicketDetailsFactory detailFactory)
        {
            _ticketDetailsFactory = detailFactory;
            Ticket ticket = new PeriodTicket(_ticketDetailsFactory);

            ticket.CreateTicketDetails();
            return(ticket);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 public SimpleTicket(ITicketDetailsFactory simpleTicketDetailsFactory)
 {
     _simpleTicketDetailsFactory = simpleTicketDetailsFactory;
     TicketType  = "Simple Ticket";
     CreatedDate = DateTime.Now;
 }
コード例 #6
0
 public MonthTicket(ITicketDetailsFactory factory)
 {
     monthTicketDetailsFactory = factory;
     TicketType  = "Month Ticket";
     CreatedDate = DateTime.Now;
 }
コード例 #7
0
 public PeriodTicket(ITicketDetailsFactory factory)
 {
     TicketType      = "Period Ticket";
     CreatedDate     = DateTime.Now;
     _detailsFactory = factory;
 }