コード例 #1
0
        public PreQualificationViewModel SaveAnswer(PreQualificationViewModel model)
        {
            var tempCart         = model.RequestValidationModel.TempCart;
            var preQualification = _preQualificationResultRepository.Get(tempCart.Id) ?? new PreQualificationResult()
            {
                TempCartId = tempCart.Id, EventId = tempCart.EventId.Value
            };

            if (model.SkipPreQualificationQuestion)
            {
                preQualification.SkipPreQualificationQuestion = true;
            }
            else
            {
                preQualification.HighBloodPressure     = model.HighBloodPressure;
                preQualification.Smoker                = model.Smoker;
                preQualification.HeartDisease          = model.HeartDisease;
                preQualification.Diabetic              = model.Diabetic;
                preQualification.ChestPain             = model.ChestPain;
                preQualification.DiagnosedHeartProblem = model.DiagnosedHeartProblem;
                preQualification.HighCholestrol        = model.HighCholestrol;
                preQualification.OverWeight            = model.OverWeight;
                preQualification.AgreedWithPrequalificationQuestion = model.AgreedWithPrequalificationQuestion;
            }
            preQualification.DateCreated = DateTime.Now;
            _preQualificationResultRepository.Save(preQualification);
            return(model);
        }
コード例 #2
0
        private long SavePreQualification(PreQualificationResult preQualificationResult)
        {
            try
            {
                preQualificationResult.DateCreated  = DateTime.Now;
                preQualificationResult.IsActive     = true;
                preQualificationResult.SignUpModeId = (int)SignUpMode.CallCenter;
                preQualificationResult = _preQualificationResultRepository.Save(preQualificationResult);
            }
            catch (Exception exception)
            {
                _logger.Error(string.Format("while save PreQualification Result from CallCenter CustomerId: {0} EventId :{1}  message: {2} \n\t strack trace {3} ",
                                            preQualificationResult.CustomerId, preQualificationResult.EventId, exception.Message, exception.StackTrace), exception);
            }


            return(preQualificationResult.Id);
        }