public ActionResult ItemizedReceipt(long eventId = 0, long customerId = 0) { CustomerItemizedReceiptModel model = null; if (customerId < 1 || eventId < 1) { return(View(model)); } try { model = _customerReceiptModelService.GetItemizedRecieptModel(customerId, eventId); } catch (ArgumentException) { model = null; } return(View(model)); }
public CustomerItemizedReceiptModel Create(Customer customer, Host host, Order order, EventPackage package, IEnumerable <EventTest> tests, IEnumerable <OrderedPair <long, long> > orderItemIdTestIdPair, IEnumerable <OrderedPair <long, string> > products) { var model = new CustomerItemizedReceiptModel { CustomerName = customer.NameAsString, CustomerId = customer.CustomerId, Address = customer.Address, OrderAmount = order.DiscountedTotal, PaidAmount = order.TotalAmountPaid, PaymentMode = string.Join(", ", order.PaymentsApplied.Select(pa => pa.PaymentType.Name).Distinct()), Host = host.OrganizationName, HostAddress = host.Address, DisplayCode = customer.CustomerId.ToString(), EventId = order.EventId.HasValue ? order.EventId.Value : 0, Package = package != null ? package.Package.Name : string.Empty, Items = CreateReceiptItems(order, package, tests, orderItemIdTestIdPair, products) }; return(model); }