Esempio n. 1
0
        public static ResponseSet GenerateAndSaveResponseSet(ResponseSetType type, Survey survey)
        {
            var responseSet = GenerateResponseSet(type, survey);

            repository.AddResponseSetToDB(responseSet);
            return(responseSet);
        }
        public ResponseSet CreateNewResponseSetWithAnswers(System.Collections.Generic.IEnumerable<DataAccessModels.Category> categories, int surveyID, string responseSetName)
        {
            var responseSet = new ResponseSet
               {
                   DateSaved = DateTime.Now,
                   IsSubmitted = false,
                   SurveyID = surveyID,
                   UserID = Membership.CurrentUser.ID,
                   SystemID = GenerateUniqueID(),
                   Name = responseSetName,
                   IsCompleted = false,
                   Progress = 0,
               };

            using (var responseSetRepository = new ResponseSetRepository())
            {
                responseSetRepository.AddResponseSetToDB(responseSet);
            }

            return UpdateResponseSetWithAnswers(categories, responseSet.ID);
        }
Esempio n. 3
0
        public ResponseSet CreateNewResponseSetWithAnswers(System.Collections.Generic.IEnumerable <DataAccessModels.Category> categories, int surveyID, string responseSetName)
        {
            var responseSet = new ResponseSet
            {
                DateSaved   = DateTime.Now,
                IsSubmitted = false,
                SurveyID    = surveyID,
                UserID      = Membership.CurrentUser.ID,
                SystemID    = GenerateUniqueID(),
                Name        = responseSetName,
                IsCompleted = false,
                Progress    = 0,
            };

            using (var responseSetRepository = new ResponseSetRepository())
            {
                responseSetRepository.AddResponseSetToDB(responseSet);
            }

            return(UpdateResponseSetWithAnswers(categories, responseSet.ID));
        }