@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");
Your Tickets
Your tickets for order #@orderId are included below.
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
|
Time:
@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);
Ticket @ticketIndex of @count
|
@if (sectionShortDescription != null) {
Section: @sectionShortDescription
|
}
@if (sectionShortDescription != null && sectionShortDescription != "GA - AG") {
Row: @seatRow
|
Seat: @seatNumber
|
}
@Raw(Model.GetQRCode(barcode, 40, "#838dc8"))
@*@barcode*@
|
}
}
|