public void Post([FromBody] VIPTicket value) { using (var session = _documentStore.LightweightSession()) { session.Store(value); session.SaveChanges(); } }
public ParkingService() { parking = Parking.GetInstance; VIPTicket vip = new VIPTicket(); RegularTicket regular = new RegularTicket(); ValueTicket value = new ValueTicket(); ticketList.Add(vip); ticketList.Add(regular); ticketList.Add(value); }
private void CreateTicket(int index)//Här anropas event om den valda kund är under 18 år { if (ListManager.CustomerList[index].Age < 18) { ErrorMsg += new PrintErrorMsg(GUI.AgeError); ErrorMsg?.Invoke(); } else { VIPTicket newTicket = new VIPTicket(); newTicket.Buyer = ListManager.CustomerList[index]; newTicket.Price = InputControllers.PriceController(); GUI.ShowVIPlevels(); int choice = InputControllers.VIPChoice(); newTicket.VIPLevel = (VIPTicket.Level)choice; ListManager.TicketList.Add(newTicket); } }
public override Ticket CreateTicket(TicketType type) { Ticket ticket = null; switch (type) { case TicketType.Entrance: ticket = new EntranceTicket(colors, FactoryType.Commercial); break; case TicketType.Default: ticket = new DefaultTicket(colors + 5, FactoryType.Commercial); break; case TicketType.VIP: ticket = new VIPTicket(colors + 10, FactoryType.Commercial); break; } return(ticket); }
public static bool NormalVIPAndMaxVIP(VIPTicket ticket)//Visar två nivåer av VIPLevel ( VIP och maxVIP) { return((ticket.VIPLevel == VIPTicket.Level.maxVIP) || (ticket.VIPLevel == VIPTicket.Level.VIP)); }
public static bool IsMoreThanFiveHundred(VIPTicket ticket) { return(ticket.Price > 500); }