/// <summary>
 /// Adds a new survey to the database
 /// </summary>
 /// <param name="newSurvey">Survey object with information about what to add. Only Id must be ommited</param>
 public void AddSurvey(SurveyData newSurvey)
 {
     if (newSurvey.Surveys.Rows.Count > 0)
     {
         SurveyFactory.Create().AddSurvey(newSurvey);
     }
 }
        /// <summary>
        /// Import the given surveys into the DB
        /// </summary>
        public void ImportSurveys(NSurveyForm importSurveys, int userId, int folderId)
        {
            ISurvey survey = SurveyFactory.Create();

            this.TurnOverPrimaryKeys(importSurveys);
            survey.ImportSurveys(importSurveys, userId, folderId);
        }
 /// <summary>
 /// Move a page break Down
 /// </summary>
 /// <param name="surveyId">ID of the survey to which we add the page break</param>
 /// <param name="PageNumber">Page break to move down</param>
 public void MovePageBreakDown(int surveyId, int pageNumber)
 {
     if (pageNumber == 0)
     {
         pageNumber = 1;
     }
     SurveyFactory.Create().MovePageBreakDown(surveyId, pageNumber);
 }
示例#4
0
        /// <summary>
        /// Return a survey object that reflects the database poll
        /// </summary>
        /// <param name="surveyId">Id of the survey you need</param>
        /// <returns>A SurveyData dataset object with the current database values</returns>
        public SurveyData GetSurveyById(int surveyId, string languageCode)
        {
            SurveyData surveyById = SurveyFactory.Create().GetSurveyById(surveyId, languageCode);

            if (surveyById.Surveys.Rows.Count == 0)
            {
                throw new SurveyNotFoundException();
            }
            return(surveyById);
        }
示例#5
0
        /// <summary>
        /// Get the actions that is set for the given survey
        /// </summary>
        public int GetSurveyUnAuthentifiedUserAction(int surveyId)
        {
            int surveyUnAuthentifiedUserAction = SurveyFactory.Create().GetSurveyUnAuthentifiedUserAction(surveyId);

            if (surveyUnAuthentifiedUserAction == -1)
            {
                return(1);
            }
            return(surveyUnAuthentifiedUserAction);
        }
示例#6
0
        /// <summary>
        /// Returns all the survey, questions, answers
        /// for a survey
        /// </summary>
        public NSurveyForm GetFormForExport(int surveyId)
        {
            NSurveyForm formForExport = SurveyFactory.Create().GetFormForExport(surveyId);

            if (formForExport.Survey.Rows.Count > 0)
            {
                formForExport.Survey[0].SurveyID = 1;
                int num = 1;
                foreach (NSurveyForm.QuestionRow row in formForExport.Survey[0].GetQuestionRows())
                {
                    row.QuestionId = num;
                    num++;
                }
            }
            return(formForExport);
        }
示例#7
0
 /// <summary>
 /// Check if the survey allows multiple submission
 /// for the same nsurvey username
 /// </summary>
 public bool NSurveyAllowsMultipleSubmissions(int surveyId)
 {
     return(SurveyFactory.Create().NSurveyAllowsMultipleSubmissions(surveyId));
 }
示例#8
0
 /// <summary>
 /// Check if survey has been set to be scored
 /// </summary>
 public bool IsSurveyScored(int surveyId)
 {
     return(SurveyFactory.Create().IsSurveyScored(surveyId));
 }
示例#9
0
 /// <summary>
 /// Check if the given password is valid for the survey
 /// </summary>
 /// <param name="surveyId">Id of the protected survey</param>
 /// <param name="password">the password to check for</param>
 public bool IsSurveyPasswordValid(int surveyId, string password)
 {
     return(SurveyFactory.Create().IsSurveyPasswordValid(surveyId, password));
 }
示例#10
0
 /// <summary>
 /// Check if the survey sAves Token User Data
 ///
 /// </summary>
 public bool IsSurveySaveTokenUserData(int surveyId)
 {
     return(SurveyFactory.Create().IsSurveySaveTokenUserData(surveyId));
 }
示例#11
0
 /// <summary>
 /// returns the branching rules for the given page with all
 /// their details
 /// </summary>
 /// <param name="surveyId"></param>
 /// <returns></returns>
 public BranchingRuleData GetSurveyPageBranchingRulesDetails(int surveyId, int pageNumber)
 {
     return(SurveyFactory.Create().GetSurveyPageBranchingRulesDetails(surveyId, pageNumber));
 }
示例#12
0
 /// <summary>
 /// Get a survey list with only the survey id and title filtered by title
 /// </summary>
 /// <returns></returns>
 public SurveyData GetAllSurveysByTitle(string title, int?folderID, int userID)
 {
     return(SurveyFactory.Create().GetAllSurveysByTitle(title, folderID, userID));
 }
示例#13
0
 public void SetFriendlyName(int surveyId, string friendlyName)
 {
     SurveyFactory.Create().SetFriendlyName(surveyId, friendlyName);
 }
示例#14
0
 /// <summary>
 /// Returns a list of available resume modes
 /// </summary>
 public ResumeModeData GetSurveyResumeModes()
 {
     return(SurveyFactory.Create().GetSurveyResumeModes());
 }
示例#15
0
 /// <summary>
 /// Return a survey object that reflects the current activated poll.
 /// IE: The survey that shows up when the surveybox has a surveyid value of
 /// 0
 /// </summary>
 /// <returns>A surveydata dataset with the current database values</returns>
 public SurveyData GetActivatedSurvey()
 {
     return(SurveyFactory.Create().GetActivatedSurvey());
 }
示例#16
0
 /// <summary>
 /// Returns a list of available progress modes
 /// </summary>
 public ProgressModeData GetSurveyProgressModes()
 {
     return(SurveyFactory.Create().GetSurveyProgressModes());
 }
示例#17
0
 /// <summary>
 /// Returns all the data need to handle
 /// and process question / answer piping
 /// </summary>
 public PipeData GetSurveyPipeDataFromQuestionId(int questionId)
 {
     return(SurveyFactory.Create().GetSurveyPipeDataFromQuestionId(questionId));
 }
示例#18
0
 /// <summary>
 /// Get the access password of the survey
 /// </summary>
 public string GetSurveyPassword(int surveyId)
 {
     return(SurveyFactory.Create().GetSurveyPassword(surveyId));
 }
示例#19
0
 /// <summary>
 /// Retrieves the options that were setup for the page
 /// </summary>
 public PageOptionData GetSurveyPageOptions(int surveyId, int pageNumber)
 {
     return(SurveyFactory.Create().GetSurveyPageOptions(surveyId, pageNumber));
 }
示例#20
0
 /// <summary>
 /// Returns the total of surveys stored in the database
 /// </summary>
 /// <returns>Total of surveys</returns>
 public int TotalOfSurveys()
 {
     return(SurveyFactory.Create().TotalOfSurveys());
 }
示例#21
0
 public void SetFolderId(int?folderId, int surveyId)
 {
     SurveyFactory.Create().SetFolderId(folderId, surveyId);
 }
示例#22
0
 /// <summary>
 /// Retrieves all archived surveys from the database
 /// </summary>
 /// <returns>A SurveyData dataset of all archived surveys</returns>
 public int GetSurveyIdFromGuid(Guid guid)
 {
     return(SurveyFactory.Create().GetSurveyIdFromGuid(guid));
 }
示例#23
0
 /// <summary>
 /// Get a survey list with only the survey id and title
 /// </summary>
 /// <returns></returns>
 public SurveyData GetAllSurveysList()
 {
     return(SurveyFactory.Create().GetAllSurveysList());
 }
示例#24
0
 /// <summary>
 /// Get a survey list assigned to the user
 /// </summary>
 /// <returns></returns>
 public SurveyData GetAssignedSurveysList(int userId)
 {
     return(SurveyFactory.Create().GetAssignedSurveysList(userId));
 }
示例#25
0
 /// <summary>
 /// Retrieves all archived surveys from the database
 /// </summary>
 /// <returns>A SurveyData dataset of all archived surveys</returns>
 public SurveyData GetArchivedSurveys()
 {
     return(SurveyFactory.Create().GetArchivedSurveys());
 }
示例#26
0
 /// <summary>
 /// Returns a list of available email notification mode
 /// </summary>
 public NotificationModeData GetSurveyNotificationModes()
 {
     return(SurveyFactory.Create().GetSurveyNotificationModes());
 }
示例#27
0
 public int GetSurveyIdFromFriendlyName(string name)
 {
     return(SurveyFactory.Create().GetSurveyIdFromFriendlyName(name));
 }
示例#28
0
 /// <summary>
 /// Returns true if the page has any branching rule
 /// associated with it
 /// </summary>
 public bool HasPageBranching(int surveyId, int pageNumber)
 {
     return(SurveyFactory.Create().HasPageBranching(surveyId, pageNumber));
 }
示例#29
0
 /// <summary>
 /// Get the number of minutes after which the security cookie
 /// expires
 /// </summary>
 public int GetCookieExpiration(int surveyId)
 {
     return(SurveyFactory.Create().GetCookieExpiration(surveyId));
 }
示例#30
0
 /// <summary>
 /// Check if the survey only accept entries from
 /// users with email codes
 /// </summary>
 public bool IsSurveyOnlyInvited(int surveyId)
 {
     return(SurveyFactory.Create().IsSurveyEmailInviteOnly(surveyId));
 }