private void AddRowToEventBasicInfoTypedView(int eventCustomerId, decimal paymentAmount, bool isDebit, CustomerEventSignUpMode signUpMode, bool isPodActive, string eventName) { // Order of parameters matches order in typed view in database. _eventBasicInfoTypedView.Rows.Add(3, eventCustomerId, 0, 0, 0, signUpMode, 0, DateTime.MinValue, 0, eventName, DateTime.MinValue, DateTime.MinValue, 0, 0, 0, paymentAmount, 0, isDebit, 19, 20, 21, 22, isPodActive); }
private void AddRowToEventBasicInfoTypedView(int eventCustomerId, decimal paymentAmount, CustomerEventSignUpMode customerEventSignUpMode) { AddRowToEventBasicInfoTypedView(eventCustomerId, paymentAmount, false, customerEventSignUpMode, true, string.Empty); }
public EventCustomerAggregate CreateEventCustomerAggregate(EventCustomer eventCustomer) { // Collect all the required data from different repositories. var eventData = _eventRepository.GetById(eventCustomer.EventId); var eventHost = _hostRepository.GetHostForEvent(eventCustomer.EventId); var appointment = _appointmentRepository.GetById(eventCustomer.AppointmentId.Value); var customer = _customerRepository.GetCustomer(eventCustomer.CustomerId); var order = _orderRepository.GetOrder(customer.CustomerId, eventData.Id); var activeOrderDetail = _orderController.GetActiveOrderDetail(order); if (eventHost == null || appointment == null || order == null || activeOrderDetail == null) { return(null); } var package = _packageRepository.GetById(activeOrderDetail.OrderItem.ItemId); string packageName = ""; if (package != null) { packageName = package.Package.Name; } var sourceCode = activeOrderDetail.SourceCodeOrderDetail != null?_sourceCodeRepository.GetSourceCodeById(activeOrderDetail.SourceCodeOrderDetail.SourceCodeId) : null; var paymentTypes = string.Join(",", order.PaymentsApplied.Select(pa => pa.PaymentType.Name).ToArray()); CustomerEventSignUpMode signUpMode = GetEventSignUpMode(eventCustomer); return(new EventCustomerAggregate { AppointmentId = eventCustomer.AppointmentId.Value, AppointmentTime = appointment.StartTime, CustomerAddress = customer.Address, CustomerId = customer.CustomerId, CustomerSignupDate = customer.DateCreated, EventAddress = eventHost.Address, EventCustomerId = eventCustomer.Id, EventDate = eventData.EventDate, EventId = eventData.Id, EventName = eventData.Name, EventSignupDate = eventCustomer.DataRecorderMetaData != null ? eventCustomer.DataRecorderMetaData.DateCreated : default(DateTime), EventStatus = eventData.Status, FirstName = customer.Name != null ? customer.Name.FirstName : string.Empty, IsPaid = order.TotalAmountPaid >= order.DiscountedTotal, LastName = customer.Name != null ? customer.Name.LastName : string.Empty, MarketingSource = eventCustomer.MarketingSource, MiddleName = customer.Name != null ? customer.Name.MiddleName : string.Empty, PackageName = packageName, PackageCost = activeOrderDetail.Price, PaidAmount = order.TotalAmountPaid, PaymentAmount = order.UndiscountedTotal, PaymentNet = order.DiscountedTotal, PaymentType = paymentTypes, SignUpMarketingSource = eventCustomer.MarketingSource, SignUpMode = signUpMode, SourceCode = sourceCode != null ? sourceCode.CouponCode : string.Empty, UnpaidAmount = order.TotalAmountPaid - order.DiscountedTotal }); }