コード例 #1
0
        public MobileResponseModel UpdateCustomerConsent(EventCustomerConsents customersConsent)
        {
            try
            {
                var data = _eventCustomerBriefListService.UpdateConsentsStatusforEventIdCustomerId(customersConsent);

                return(new MobileResponseModel
                {
                    IsSuccess = true,
                    Data = data
                });
            }
            catch (Exception ex)
            {
                _logger.Info(string.Format("While updating consent for multiple customers. \n Message : {0} \n Stack Trace : {1}", ex.Message, ex.StackTrace));

                return(new MobileResponseModel
                {
                    IsSuccess = true,
                    Message = ex.Message
                });
            }
        }
コード例 #2
0
        public EventCustomerConsents UpdateConsentsStatusforEventIdCustomerId(EventCustomerConsents model)
        {
            var eventCustomer = _eventCustomerRepository.Get(model.EventId, model.CustomerId);

            if (eventCustomer == null)
            {
                return(model);
            }

            if (model.Hipaa != null)
            {
                try
                {
                    _eventCustomerRepository.UpdateHippaStatus(eventCustomer.Id, (short)model.Hipaa.Status);
                    model.Hipaa.Message   = "Updated Successfully";
                    model.Hipaa.IsSuccess = true;
                }
                catch (Exception exception)
                {
                    model.Hipaa.Message   = exception.Message;
                    model.Hipaa.IsSuccess = false;
                }
            }
            if (model.PcpConsent != null)
            {
                try
                {
                    _eventCustomerRepository.UpdatePcpConsentStatus(eventCustomer.Id, (short)model.PcpConsent.Status);
                    model.PcpConsent.Message   = "Updated Successfully";
                    model.PcpConsent.IsSuccess = true;
                }
                catch (Exception exception)
                {
                    model.PcpConsent.Message   = exception.Message;
                    model.PcpConsent.IsSuccess = false;
                }
            }

            if (model.PartnerRelease != null)
            {
                try
                {
                    _eventCustomerRepository.UpdatePartnerReleaseStatus(eventCustomer.Id, (short)model.PartnerRelease.Status);
                    model.PartnerRelease.Message   = "Updated Successfully";
                    model.PartnerRelease.IsSuccess = true;
                }
                catch (Exception exception)
                {
                    model.PartnerRelease.Message   = exception.Message;
                    model.PartnerRelease.IsSuccess = false;
                }
            }

            if (model.AbnConsent != null)
            {
                try
                {
                    _eventCustomerRepository.UpdateAbnStatus(eventCustomer.Id, (short)model.AbnConsent.Status);
                    model.AbnConsent.Message   = "Updated Successfully";
                    model.AbnConsent.IsSuccess = true;
                }
                catch (Exception exception)
                {
                    model.AbnConsent.Message   = exception.Message;
                    model.AbnConsent.IsSuccess = false;
                }
            }

            if (model.InsuranceRelease != null)
            {
                try
                {
                    _eventCustomerRepository.UpdateInsuranceReleaseStatus(eventCustomer.Id, (short)model.InsuranceRelease.Status);
                    model.InsuranceRelease.Message   = "Updated Successfully";
                    model.InsuranceRelease.IsSuccess = true;
                }
                catch (Exception exception)
                {
                    model.InsuranceRelease.Message   = exception.Message;
                    model.InsuranceRelease.IsSuccess = false;
                }
            }

            return(model);
        }