Пример #1
0
 internal static void Selectedoptions(SurveyOptionsDBModel _options)
 {
     AdressSelBool    = _options.CalAddressScore;
     AgeSelBool       = _options.CalAgeScore;
     SocialSelBool    = _options.CalSocialScore;
     twofactorSelBool = _options.CalTwoFactorScore;
     surveyObj        = _options;
 }
Пример #2
0
        public IActionResult GetSurveyOptions(string SurveyName)
        {
            var Survey = _unitOfWork.SurveyRepository.GetSurveyOptionsOnName(SurveyName);

            if (Survey != null)
            {
                SurveyOptionsDBModel surveyOpt = new SurveyOptionsDBModel();
                surveyOpt.SurveyId          = Survey.SurveyId;
                surveyOpt.Survey_Name       = Survey.Survey_Name;
                surveyOpt.Survey_Active     = Survey.Survey_Active;
                surveyOpt.CalAddressScore   = Survey.CalAddressScore;
                surveyOpt.CalAgeScore       = Survey.CalAgeScore;
                surveyOpt.CalSocialScore    = Survey.CalSocialScore;
                surveyOpt.CalTwoFactorScore = Survey.CalTwoFactorScore;
                BLL.CalculateScore.Selectedoptions(surveyOpt);
                return(Ok(Survey));
            }
            else
            {
                return(BadRequest("Itsnull"));
            }
        }
Пример #3
0
        //-------------------------------------------------------------------------------------------------------------------------



        //--------------------------------------------------------------------------------------------------------------------------

        public void storetoDB(ViewModels.ParticipantViewModel Participantvalues, ScoreModel score, GeoLocProps geo, UserAgent.UserAgent useragent, MapPoint mapCoords)
        {
            ParticipantDBViewModel dbModel = CertifyParticipant.storingtoDB(Participantvalues, score, geo, useragent, mapCoords);

            Participant participant = Mapper.Map <Participant>(dbModel);


            SurveyOptionsDBModel surveymodel = CalculateScore.getthesurveyObject();

            DAL.Models.Survey surveydal = new DAL.Models.Survey();
            //defining the survey object
            surveydal.Survey_Name       = surveymodel.Survey_Name;
            surveydal.Survey_Active     = surveymodel.Survey_Active;
            surveydal.SurveyId          = surveymodel.SurveyId;
            surveydal.CalAddressScore   = surveymodel.CalAddressScore;
            surveydal.CalAgeScore       = surveymodel.CalAgeScore;
            surveydal.CalSocialScore    = surveymodel.CalSocialScore;
            surveydal.CalTwoFactorScore = surveymodel.CalTwoFactorScore;

            _unitOfWork.ParticipantRepository.InsertSurveyParticipant(participant);

            _unitOfWork.ParticipantRepository.InsertSurveyParticipantTable(participant, surveydal);
        }