コード例 #1
0
        private EventCustomer SaveEventCustomer(OrganizationRoleUser organizationRoleUser)
        {
            var eventAppointmentService = IoC.Resolve <IEventAppointmentService>();
            var appointment             = eventAppointmentService.CreateAppointment(AppointmentSlotIds, organizationRoleUser.Id);

            var eventCustomer = new EventCustomer
            {
                AppointmentId        = appointment.Id,
                EventId              = EventId.Value,
                CustomerId           = CustomerId.Value,
                DataRecorderMetaData = new DataRecorderMetaData
                {
                    DataRecorderCreator = organizationRoleUser,
                    DateCreated         = DateTime.Now
                },
                OnlinePayment   = false,
                MarketingSource = MarketingSource,
                NoShow          = false,
                LeftWithoutScreeningReasonId = null,
                LeftWithoutScreeningNotesId  = null,
                TestConducted        = false,
                HIPAAStatus          = RegulatoryState.Unknown,
                PcpConsentStatus     = RegulatoryState.Unknown,
                EnableTexting        = Customer.EnableTexting,
                PreferredContactType = Customer.PreferredContactType,
            };

            IUniqueItemRepository <EventCustomer> itemRepository = new EventCustomerRepository();

            eventCustomer = itemRepository.Save(eventCustomer);

            return(eventCustomer);
        }
コード例 #2
0
        private EventCustomer UpdateEventCustomer(OrganizationRoleUser organizationRoleUser)
        {
            IEventCustomerRepository eventCustomerRepository = new EventCustomerRepository();
            var eventAppointmentService = IoC.Resolve <IEventAppointmentService>();

            try
            {
                var eventCustomer = eventCustomerRepository.GetCancelledEventForUser(Customer.CustomerId, EventId.Value);
                var appointment   = eventAppointmentService.CreateAppointment(AppointmentSlotIds, organizationRoleUser.Id);
                eventCustomer.AppointmentId = appointment.Id;
                eventCustomer.NoShow        = false;
                eventCustomer.LeftWithoutScreeningReasonId = null;
                eventCustomer.LeftWithoutScreeningNotesId  = null;
                eventCustomer.EnableTexting = Customer.EnableTexting;
                IUniqueItemRepository <EventCustomer> itemRepository = new EventCustomerRepository();
                eventCustomer = itemRepository.Save(eventCustomer);

                return(eventCustomer);
            }
            catch (Exception)
            {
                return(null);
            }
        }