Beispiel #1
0
        public ProductDTO GetCampProductDetails(int eventId, int camperContactId, string token)
        {
            var formId                   = _configurationWrapper.GetConfigIntValue("SummerCampFormID");
            var formFieldId              = _configurationWrapper.GetConfigIntValue("SummerCampForm.FinancialAssistance");
            var me                       = _contactRepository.GetMyProfile(token);
            var campEvent                = _eventRepository.GetEvent(eventId);
            var eventProduct             = _productRepository.GetProductForEvent(eventId);
            var eventProductOptionPrices = _productRepository.GetProductOptionPricesForProduct(eventProduct.ProductId).OrderByDescending(m => m.DaysOutToHide).ToList();
            var invoiceDetails           = _invoiceRepository.GetInvoiceDetailsForProductAndCamper(eventProduct.ProductId, camperContactId);
            var answer                   = _formSubmissionRepository.GetFormResponseAnswer(formId, camperContactId, formFieldId, eventId);
            var financialAssistance      = (!string.IsNullOrEmpty(answer) && Convert.ToBoolean(answer));
            var paymentDetail            = invoiceDetails.Status ? _paymentService.GetPaymentDetails(0, invoiceDetails.Value.InvoiceId, token) : null;
            var campProductInfo          = new ProductDTO
            {
                InvoiceId           = invoiceDetails.Status ? invoiceDetails.Value.InvoiceId : 0,
                ProductId           = eventProduct.ProductId,
                ProductName         = eventProduct.ProductName,
                BasePrice           = eventProduct.BasePrice,
                DepositPrice        = eventProduct.DepositPrice.Value,
                Options             = ConvertProductOptionPricetoDto(eventProductOptionPrices, eventProduct.BasePrice, campEvent.EventStartDate),
                BasePriceEndDate    = campEvent.EventStartDate,
                FinancialAssistance = financialAssistance,
                PaymentDetail       = paymentDetail
            };

            return(campProductInfo);
        }
Beispiel #2
0
        public IObservable <Dictionary <string, object> > GetApplicationData(int contactId)
        {
            var formId = _configWrapper.GetConfigIntValue("GroupLeaderFormId");
            var referenceFormFieldId     = _configWrapper.GetConfigIntValue("GroupLeaderFormReferenceContact");
            var studentLeaderFormFieldId = _configWrapper.GetConfigIntValue("GroupLeaderStudentFieldId");

            return(Observable.Return <MpParticipant>(_participantRepository.GetParticipant(contactId)).Zip(
                       Observable.Return <MpMyContact>(_contactRepository.GetContactById(contactId)),
                       Observable.Return <string>(_formSubmissionRepository.GetFormResponseAnswer(formId, contactId, referenceFormFieldId, null)),
                       Observable.Return <string>(_formSubmissionRepository.GetFormResponseAnswer(formId, contactId, studentLeaderFormFieldId, null)),
                       (participant, contact, referenceAnswer, studentAnswer) => new Dictionary <string, object>
            {
                { "participant", participant },
                { "contact", contact },
                { "referenceContactId", referenceAnswer ?? "0" },
                { "studentLeaderRequest", studentAnswer ?? "false" }
            }));
        }