@using System; @using System.Web; @using System.Collections.Generic; @using System.Linq; @using Tessitura.Service.Client.Txn; @using Tessitura.Service.Client.Templates; @using Tessitura.Service.Client.Web; @using System.Globalization; @{ var orderId = Model.GetPropertyValue("OrderId"); var newTicketNoForReprints = true; var ticketDesignId = 2079; var subLineItems = Model.GetPropertyValue("SubLineItems");

Vos billets

Les billets de la commande #@orderId sont inclus ci-dessous.

var request = new PrintOrderTicketsRequest{ TicketDesignId = ticketDesignId, NewTicketNoForReprints = newTicketNoForReprints, ReprintTickets = true, SubLineItems = subLineItems, PrinterType = "G" }; var url = string.Format("Txn/Orders/{0}/PrintTicketElements", orderId); var response = Model.RestClient.AtUrl(url).Post(request).ResponseObject; var count = response.Tickets.Count; var renderTicketElementsTable = false; // For debugging only! var ticketIndex = 0; foreach (var ticket in response.Tickets) { ticketIndex += 1; if(ticketIndex == count){ var ticketElements = ticket.TicketElements; var webPerformanceDescription = GetTicketElementValue(ticketElements, DesignElements.Ticket.Performance.WebPerformanceDescription); var eventTitle = GetTicketElementValue(ticketElements, DesignElements.Ticket.Performance.ProductionSeasonInfo2) + " " + GetTicketElementValue(ticketElements, DesignElements.Ticket.Performance.ProductionSeasonInfo3) + " " + GetTicketElementValue(ticketElements, DesignElements.Ticket.Performance.ProductionSeasonInfo4); var performanceId = "GetTicketElementValue(ticketElements, DesignElements.Ticket.Performance.PerformanceId)"; var performanceDate = GetTicketElementValue(ticketElements, DesignElements.Ticket.Performance.PerformanceDate); var performanceBeginTime = GetTicketElementValue(ticketElements, DesignElements.Ticket.Performance.PerformanceBeginTime); var priceZoneDescription = GetTicketElementValue(ticketElements, DesignElements.Ticket.Seat.PriceZoneDescription); var priceZoneTime = GetTicketElementValue(ticketElements, DesignElements.Ticket.Seat.PriceZoneTime); var parsedDate = DateTime.Parse(performanceBeginTime, CultureInfo.InvariantCulture).ToString("hh:mm tt"); var theatre = GetTicketElementValue(ticketElements, DesignElements.Ticket.Seat.Theatre);
@eventTitle
@theatre
Date: @performanceDate
Heure : @if(priceZoneTime != null & priceZoneDescription != null){ @priceZoneDescription } else { @performanceBeginTime }
} } ticketIndex = 0; foreach (var ticket in response.Tickets) { ticketIndex += 1; var ticketElements = ticket.TicketElements; var sectionDescription = GetTicketElementValue(ticketElements, DesignElements.Ticket.Seat.SectionAdditionalText); var sectionShortDescription = GetTicketElementValue(ticketElements, DesignElements.Ticket.Seat.SectionShortDescription); var seatRow = GetTicketElementValue(ticketElements, DesignElements.Ticket.Seat.SeatRow); var seatNumber = GetTicketElementValue(ticketElements, DesignElements.Ticket.Seat.SeatNumber); var priceTypeAlias = "GetTicketElementValue(ticketElements, DesignElements.Ticket.Seat.PriceTypeAlias)"; var priceZoneDescription = GetTicketElementValue(ticketElements, DesignElements.Ticket.Seat.PriceZoneDescription); var priceZoneTime = GetTicketElementValue(ticketElements, DesignElements.Ticket.Seat.PriceZoneTime); var orderNumber = "GetTicketElementValue(ticketElements, DesignElements.Ticket.Order.OrderNumber)"; var ticketNumber = GetTicketElementValue(ticketElements, DesignElements.Ticket.Seat.TicketNumber); var customerNumber = "GetTicketElementValue(ticketElements, DesignElements.Ticket.Account.ConstituentId)"; var barcode = GetTicketElementValue(ticketElements, DesignElements.Ticket.Seat.AccessControlBarcode); @if (sectionShortDescription != null) { } @if (sectionShortDescription != null && sectionShortDescription != "GA - AG") { }
Billet @ticketIndex de @count
Section: @sectionShortDescription
Rangée: @seatRow
Siège: @seatNumber
@Raw(Model.GetQRCode(barcode, 40, "#838dc8")) @*@barcode*@
} }
@functions{ public string GetTicketElementValue(List ticketElements, int EleNo) { var element = ticketElements.Find(x => x.EleNo == EleNo); if (element != null) { return element.Val; } return null; } }