/// <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);
 }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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));
 }
Beispiel #8
0
 /// <summary>
 /// Check if survey has been set to be scored
 /// </summary>
 public bool IsSurveyScored(int surveyId)
 {
     return(SurveyFactory.Create().IsSurveyScored(surveyId));
 }
Beispiel #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));
 }
Beispiel #10
0
 /// <summary>
 /// Check if the survey sAves Token User Data
 ///
 /// </summary>
 public bool IsSurveySaveTokenUserData(int surveyId)
 {
     return(SurveyFactory.Create().IsSurveySaveTokenUserData(surveyId));
 }
Beispiel #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));
 }
Beispiel #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));
 }
Beispiel #13
0
 public void SetFriendlyName(int surveyId, string friendlyName)
 {
     SurveyFactory.Create().SetFriendlyName(surveyId, friendlyName);
 }
Beispiel #14
0
 /// <summary>
 /// Returns a list of available resume modes
 /// </summary>
 public ResumeModeData GetSurveyResumeModes()
 {
     return(SurveyFactory.Create().GetSurveyResumeModes());
 }
Beispiel #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());
 }
Beispiel #16
0
 /// <summary>
 /// Returns a list of available progress modes
 /// </summary>
 public ProgressModeData GetSurveyProgressModes()
 {
     return(SurveyFactory.Create().GetSurveyProgressModes());
 }
Beispiel #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));
 }
Beispiel #18
0
 /// <summary>
 /// Get the access password of the survey
 /// </summary>
 public string GetSurveyPassword(int surveyId)
 {
     return(SurveyFactory.Create().GetSurveyPassword(surveyId));
 }
Beispiel #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));
 }
Beispiel #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());
 }
Beispiel #21
0
 public void SetFolderId(int?folderId, int surveyId)
 {
     SurveyFactory.Create().SetFolderId(folderId, surveyId);
 }
Beispiel #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));
 }
Beispiel #23
0
 /// <summary>
 /// Get a survey list with only the survey id and title
 /// </summary>
 /// <returns></returns>
 public SurveyData GetAllSurveysList()
 {
     return(SurveyFactory.Create().GetAllSurveysList());
 }
Beispiel #24
0
 /// <summary>
 /// Get a survey list assigned to the user
 /// </summary>
 /// <returns></returns>
 public SurveyData GetAssignedSurveysList(int userId)
 {
     return(SurveyFactory.Create().GetAssignedSurveysList(userId));
 }
Beispiel #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());
 }
Beispiel #26
0
 /// <summary>
 /// Returns a list of available email notification mode
 /// </summary>
 public NotificationModeData GetSurveyNotificationModes()
 {
     return(SurveyFactory.Create().GetSurveyNotificationModes());
 }
Beispiel #27
0
 public int GetSurveyIdFromFriendlyName(string name)
 {
     return(SurveyFactory.Create().GetSurveyIdFromFriendlyName(name));
 }
Beispiel #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));
 }
Beispiel #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));
 }
Beispiel #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));
 }