@*using statement required for access to Constituencies object type when making REST call to CRM/Constituencies*@
@using System;
@using System.Linq;
@using System.Web;
@using System.Collections.Generic;
@using Tessitura.Service.Client.Templates;
@using Tessitura.Service.Client.Web;
@using Tessitura.Service.Client.CRM;
@using Tessitura.Service.Client.Txn;
@using System.Globalization;
@using Tessitura.Service.Client.CRM;
@using System.Text.RegularExpressions;
@using Tessitura.Service.Client.Custom;
@using Tessitura.Service.Client.Utils;
@{
var hasConstituent = Model.OrderProductView.Constituent != null;
var hasAddress = Model.Address != null;
var hasElectronicAddress = Model.ElectronicAddress != null;
var hasBooking = Model.Booking != null;
var isInSpecialConstituency = false;
var constituencyMessage = Model.GetPropertyValue("ConstituencyMessage") ?? "Thank you for being a part of Friend's Circle!";
var constituency = Model.GetPropertyValue("Constituency") ?? "FRC";
var hasState = hasAddress && Model.Address.State != null;
var state = hasState ? ", " + Model.Address.State.StateCode : "";
var electronicAddress = hasElectronicAddress ? Model.ElectronicAddress.Address : "";
var hasProducts = Model.OrderProductView.Products != null && Model.OrderProductView.Products.Count > 0;
var hasPaymentPlans = Model.OrderProductView.PaymentPlans != null && Model.OrderProductView.PaymentPlans.Count > 0;
var hasPayments = Model.OrderProductView.Payments != null && Model.OrderProductView.Payments.Count > 0;
var PaymentPlans = "No";
var cards = new List {"VISA", "MasterCard", "American Express", "Discover", "Debit"};
}
@if (hasConstituent)
{
var url = "CRM/Constituencies?constituentId=" + Model.OrderProductView.Constituent.Id + "&includeAffiliations=true";
var constituencies = Model.RestClient.AtUrl(url).Get().ResponseObject;
isInSpecialConstituency = constituencies != null && (constituencies as Constituencies).Count(x => x.ConstituencyType.ShortDescription == constituency) > 0;
}
Thank you for your purchase!
|
Order Date: @Model.OrderProductView.OrderDateTime.ToString("yyyy-MM-dd h:mm tt")
Order Number: @Model.OrderProductView.Id
@if (hasConstituent)
{
Customer Number:
@Model.OrderProductView.Constituent.Id
}
|
Your Account Information:
@if (isInSpecialConstituency)
{
@constituencyMessage
}
@if (hasConstituent)
{
@Model.OrderProductView.Constituent.DisplayName
}
@electronicAddress
|
Keep this email handy — it includes everything you need to access your tickets and account. Log in to your NAC Account.
|
|
@{
/* Ticket Delivery Method */
// display ticket delivery info
Ticket Delivery Method
|
@if (hasProducts)
{
var giftCertificatesDeliveryMethod = (Model.OrderProductView.Products as OrderProductViewProducts).Where(x => x.ProductClass.Description == "Gift Certificate");
/* Delivery method - suppress for Gift certs */
if (giftCertificatesDeliveryMethod != null && giftCertificatesDeliveryMethod.Count() > 0)
{
@* show nothing in delivery info area *@
} else {
@if (Model.OrderProductView.DeliveryMethod.Id == -1)
{
@* DM: Hold at Box Office *@
You have selected: Hold at Box Office
Go to the NAC Box Office to pick up your ticket(s). If picking up your ticket(s) on show day, it’s best to arrive 30 to 45 minutes before your show starts.
If you prefer to manage your ticket(s) yourself, please contact the Box Office at 844 985-2787 to modify your delivery method.
}
else if (Model.OrderProductView.DeliveryMethod.Id == 2)
{
@* DM: Print at Home *@
You have selected: Print at Home tickets
You will receive a separate email containing your print at home tickets.
If you do not receive an email with your tickets, or if you prefer to manage your ticket(s) yourself, please contact the Box Office at 844 985-2787.
}
else if (Model.OrderProductView.DeliveryMethod.Id == 3)
{
@* DM: Tickets in Hand *@
Your tickets have been printed at the NAC Box Office
}
else if (Model.OrderProductView.DeliveryMethod.Id == 5)
{
@* DM: Mobile Tickets *@
You have selected: Mobile tickets
Your smartphone is your ticket. You can access mobile tickets and manage your account details anytime through your NAC Account.
Add your ticket(s) to your mobile wallet and present them on your screen when you arrive.
}
else if (Model.OrderProductView.DeliveryMethod.Id == 1 && hasAddress)
{
@* DM: Standard Mail *@
You have selected: Standard mail
Your tickets will be mailed to your address on file:
@Model.Address.Street1
@Model.Address.City@state
@Model.Address.PostalCode
}
else if (Model.OrderProductView.DeliveryMethod.Id == 555 && hasAddress)
{
@* DM: Courier *@
You have selected: Courier
Your tickets will be couriered to your address on file:
@Model.Address.Street1
@Model.Address.City@state
@Model.Address.PostalCode
}
}
}
|
|
}
@if (hasProducts)
{
var perfs = (Model.OrderProductView.Products as OrderProductViewProducts).Where(x => x.ProductClass.Description == "Performance");
var packages = (Model.OrderProductView.Products as OrderProductViewProducts).Where(x => x.ProductClass.Description == "Package");
var contributions = (Model.OrderProductView.Products as OrderProductViewProducts).Where(x => x.ProductClass.Description == "Contribution");
var contributionTotal = contributions.Sum(x => x.Contribution.Amount);
var memberships = (Model.OrderProductView.Products as OrderProductViewProducts).Where(x => x.ProductClass.Description == "Membership");
var membershipTotal = memberships.Sum(x => x.Membership.Amount);
var giftCertificates = (Model.OrderProductView.Products as OrderProductViewProducts).Where(x => x.ProductClass.Description == "Gift Certificate");
var giftCertificateTotal = giftCertificates.Sum(x => -x.GiftCertificate.Amount);
var subTotal = string.Format("{0:C}", Model.OrderProductView.TotalPurchaseAmount + Model.OrderProductView.TotalContributionAmount);
/* Events */
// If the order has performances, loop through them and display them in a table
if (perfs != null && perfs.Count() > 0)
{
Events
|
Description |
Section |
Row |
Seat |
Price |
Total |
@{
var performanceTotal = @perfs.Sum(x => x.Performance.LineItem.TotalDue);
}
@foreach (var product in perfs)
{
var performance = product.Performance.LineItem.Performance;
var performanceType = performance.Type.Id;
var performanceDateTime = performance.PerformanceDateTime.ToString("yyyy-MM-dd h:mm tt");
var parsedDate = DateTime.Parse(performanceDateTime, CultureInfo.InvariantCulture).ToString("yyyy-MM-dd ");
var parsedWeek = performance.PerformanceDateTime.ToString("yyyy-MM-dd");
var isTimedEntryPerf = performanceType != null && performanceType.ToString() == "7";
var priceZoneDescription = "";
var priceTypeDesc = GetPriceTypesDescription(product.Performance.LineItem.SubLineItems);
var isSummerCamp = false;
var performanceId = product.Performance.LineItem.Performance.Id;
var keywordsUrl = "TXN/ProductKeywords?productionElementIds=" + performanceId;
var keywordDataCall = Model.RestClient.AtUrl(keywordsUrl).Get();
foreach (var subLineItem in product.Performance.LineItem.SubLineItems){
priceZoneDescription = subLineItem.Zone.Description;
}
if(keywordDataCall.IsSuccessful && keywordDataCall.ResponseObject.Count > 0){
var keywords = keywordDataCall.ResponseObject[0].Keywords;
foreach (var keyword in keywords){
if(keyword.Id == 116){
isSummerCamp = true;
}
}
}
@performance.Description
@performance.Facility.Description
@if(@isTimedEntryPerf){
Date:
@parsedDate
Entry time: @priceZoneDescription
} else {
if(@isSummerCamp){
Week of @parsedWeek
} else {
@performanceDateTime
}
}
|
|
|
|
|
|
@Raw(priceTypeDesc)
|
@if(!@isSummerCamp){
foreach (var subLineItem in product.Performance.LineItem.SubLineItems)
{
var seatSection = string.IsNullOrEmpty(subLineItem.Seat.Section.ShortDescription) ? "TBD" : subLineItem.Seat.Section.ShortDescription;
@seatSection
}
}
|
@foreach (var subLineItem in product.Performance.LineItem.SubLineItems)
{
var seatRow = string.IsNullOrEmpty(subLineItem.Seat.Row) ? "TBD" : subLineItem.Seat.Row;
var seatSection = string.IsNullOrEmpty(subLineItem.Seat.Section.ShortDescription) ? "TBD" : subLineItem.Seat.Section.ShortDescription;
@if(@seatSection != "GA - AG"){
@seatRow
}
}
|
@foreach (var subLineItem in product.Performance.LineItem.SubLineItems)
{
var seatNumber = string.IsNullOrEmpty(subLineItem.Seat.Number) ? "TBD" : subLineItem.Seat.Number;
var seatSection = string.IsNullOrEmpty(subLineItem.Seat.Section.ShortDescription) ? "TBD" : subLineItem.Seat.Section.ShortDescription;
@if(@seatSection != "GA - AG"){
@seatNumber
}
}
|
@foreach (var subLineItem in product.Performance.LineItem.SubLineItems)
{
var amount = string.Format("{0:C}", subLineItem.DueAmount);
@amount
}
|
@string.Format("{0:C}", product.Performance.LineItem.TotalDue)
|
}
Total Single Tickets Cost:
|
@string.Format("{0:C}", performanceTotal)
|
|
|
}
/* PACKAGES */
// If the order has packages, loop through them and display them in a table
if (packages != null && packages.Count() > 0)
{
Packages
|
Description |
Section |
Row |
Seat |
Price |
Total |
@{
var packageTotal = packages.Sum(x => x.Package.LineItems.Sum(y => y.TotalDue));
}
@foreach (var product in packages)
{
foreach (var lineItem in product.Package.LineItems)
{
if (lineItem.Performance == null)
{
@lineItem.Package.Description
|
}
else
{
var performance = lineItem.Performance;
var performanceType = performance.Type.Id;
var performanceDateTime = performance.PerformanceDateTime.ToString();
var parsedDate = DateTime.Parse(performanceDateTime, CultureInfo.InvariantCulture).ToString("yyyy-MM-dd ");
var isTimedEntryPerf = performanceType != null && performanceType.ToString() == "7";
var priceZoneDescription = "";
foreach (var subLineItem in lineItem.SubLineItems){
priceZoneDescription = subLineItem.Zone.Description;
}
@performance.Description
@performance.Facility.Description
@if(@isTimedEntryPerf){
Date: @parsedDate
Entry time: @priceZoneDescription
} else{
@performance.PerformanceDateTime
}
|
@foreach (var subLineItem in lineItem.SubLineItems)
{
var seatSection = string.IsNullOrEmpty(subLineItem.Seat.Section.ShortDescription) ? "TBD" : subLineItem.Seat.Section.ShortDescription;
@seatSection
}
|
@foreach (var subLineItem in lineItem.SubLineItems)
{
var seatRow = string.IsNullOrEmpty(subLineItem.Seat.Number) ? "TBD" : subLineItem.Seat.Row;
var seatSection = string.IsNullOrEmpty(subLineItem.Seat.Section.ShortDescription) ? "TBD" : subLineItem.Seat.Section.ShortDescription;
@if(@seatSection != "GA - AG"){
@seatRow
}
}
|
@foreach (var subLineItem in lineItem.SubLineItems)
{
var seatNumber = string.IsNullOrEmpty(subLineItem.Seat.Number) ? "TBD" : subLineItem.Seat.Number;
var seatSection = string.IsNullOrEmpty(subLineItem.Seat.Section.ShortDescription) ? "TBD" : subLineItem.Seat.Section.ShortDescription;
@if(@seatSection != "GA - AG"){
@seatNumber
}
}
|
@foreach (var subLineItem in lineItem.SubLineItems)
{
var amount = string.Format("{0:C}", subLineItem.DueAmount);
@amount
}
|
@string.Format("{0:C}", lineItem.TotalDue)
|
}
}
}
Total Packages Cost:
|
@string.Format("{0:C}", packageTotal)
|
Total Subscription Tickets:
|
@string.Format("{0:C}", packageTotal) |
Total Additional Ticket(s):
|
@string.Format("{0:C}", Model.OrderProductView.TotalPurchaseAmount - packageTotal) |
|
|
}
/* CONTRIBUTIONS */
// If the order has contributions, loop through them and display them in a table
if (contributions != null && contributions.Count() > 0)
{
Contributions
|
Description |
Total |
@foreach (var contribution in contributions)
{
@contribution.Contribution.Fund.Description
|
@string.Format("{0:C}", contribution.Contribution.Amount)
|
}
Total Contribution Cost:
|
@string.Format("{0:C}", contributionTotal)
|
|
|
}
if (memberships != null && memberships.Count() > 0)
{
Memberships
|
Description |
Total |
@foreach (var membership in memberships)
{
@membership.Membership.MembershipLevel.Description
|
@string.Format("{0:C}", membership.Membership.Amount)
|
}
Total Membership Cost:
|
@string.Format("{0:C}", membershipTotal)
|
|
|
}
if (giftCertificates != null && giftCertificates.Count() > 0)
{
Digital Gift Cards
|
Description |
Total |
@foreach (var giftCertificate in giftCertificates)
{
var amount = -giftCertificate.GiftCertificate.Amount;
Digital Gift Card Code: @giftCertificate.GiftCertificate.GiftCertificateNumber
|
@string.Format("{0:C}", amount)
|
}
Total Digital Gift Card Cost:
|
@string.Format("{0:C}", giftCertificateTotal)
|
|
|
}
Order Subtotal:
|
@subTotal
|
Handling Fee:
|
@string.Format("{0:C}", Model.OrderProductView.TotalFeeAmount)
|
Total:
|
@string.Format("{0:C}", Model.OrderProductView.TotalDueAmount)
|
Total Paid:
|
@string.Format("{0:C}", Model.OrderProductView.TotalPaidAmount) |
Balance Due:
|
@string.Format("{0:C}", Model.OrderProductView.TotalDueAmount - Model.OrderProductView.TotalPaidAmount) |
@if (hasPayments)
{
decimal paymentMethodCount = Model.OrderProductView.Payments.Count;
decimal paymentMethodIndex = 0;
string sum = "";
string paymentMethod = "";
string last4 = "";
Method(s) of Payment:
|
@foreach (var paymentsByMethod in (Model.OrderProductView.Payments as OrderProductViewPayments).GroupBy(item => item.PaymentMethod.AliasDescription))
{
paymentMethodIndex = paymentMethodIndex + 1;
@foreach (var item in paymentsByMethod)
{
@{
sum = string.Format("{0:C}", item.Amount);
paymentMethod = item.PaymentMethod.AliasDescription;
if(item.LastFourCreditCardNumber != null){
last4 = item.LastFourCreditCardNumber.Substring(item.LastFourCreditCardNumber.Length - 4);
Credit Card
}
if (@paymentMethod == "Gift Certificate"){
Digital Gift Card
} else if(cards.Contains(paymentMethod, StringComparer.OrdinalIgnoreCase) == false) {
@paymentMethod
}
if (@last4 != "")
{
(@last4)
;
} @sum
}
|
}
}
|
}
@if (hasPaymentPlans){
PaymentPlans = "Yes";
Payment Plan?
|
@PaymentPlans
|
}
|
}
@if (hasBooking)
{
Booking
|
@Model.Booking.Description
|
Confirmation: @Model.Booking.ConfirmationText
|
@if (Model.Booking.Assignments != null && Model.Booking.Assignments.Count > 0)
{
Resources |
Type |
Description |
Count |
Start |
End |
@foreach (var assignment in @Model.Booking.Assignments)
{
var description = @assignment.Resource != null ? @assignment.Resource.Description : "TBD";
@assignment.ResourceType.Description |
@description |
@assignment.Schedule.Count |
@assignment.Schedule.StartDateTime |
@assignment.Schedule.EndDateTime |
if (assignment.ConfirmationText != null)
{
|
@assignment.ConfirmationText |
}
}
|
}
|
}
|
|