/// <summary> /// Saves the current voter progress and his answers to the database /// </summary> public void SaveVoterProgress(VoterAnswersData voterAnswers) { IVoter voter = VoterFactory.Create(); VoterAnswersData data = new VoterAnswersData(); data.Merge(voterAnswers, false); voter.AddVoter(data); }
/// <summary> /// Returns all the answers of the voters /// </summary> public NSurveyVoter GetForExport(int surveyId, DateTime startDate, DateTime endDate) { NSurveyVoter voter2 = VoterFactory.Create().GetForExport(surveyId, startDate, endDate); foreach (NSurveyVoter.QuestionRow row in voter2.Question) { row.QuestionText = Regex.Replace(row.QuestionText, "<[^>]*>", " "); } return(voter2); }
/// <summary> /// Get voter's answers and voter details /// </summary> /// <param name="voterId"></param> /// <returns>voterAnswers</returns> public VoterAnswersData GetVoterAnswers(int voterId) { VoterAnswersData voterAnswers = VoterFactory.Create().GetVoterAnswers(voterId); if (voterAnswers.Voters.Rows.Count == 0) { throw new VoterNotFoundException(); } return(voterAnswers); }
/// <summary> /// Get the voter's data and answers to resume a session /// </summary> public VoterAnswersData ResumeVoterAnswers(int surveyId, string resumeUid) { VoterAnswersData data = VoterFactory.Create().ResumeVoterAnswers(surveyId, resumeUid); if (data.Voters.Rows.Count == 0) { return(null); } return(data); }
/// <summary> /// Queue an invitation request for a future voter and /// returns the generate UID /// </summary> public string GenerateVoterInvitationUId(int surveyId, string email, bool anonymousEntry) { string emailUId = new Voters().GetEmailUId(surveyId, email); if (emailUId == null) { emailUId = this.GenerateUId(); VoterFactory.Create().AddVoterInvitation(surveyId, email, anonymousEntry, emailUId); } return(emailUId); }
/// <summary> /// Get voter's statistics for the given month and year /// </summary> public VoterStatisticsData GetMonthlyStats(int surveyId, int month, int year) { return(VoterFactory.Create().GetMonthlyStats(surveyId, month, year)); }
/// <summary> /// Get number of voters for the given date /// </summary> public int GetDayStats(int surveyId, DateTime statDay) { return(VoterFactory.Create().GetDayStats(surveyId, statDay)); }
/// <summary> /// Checks if the given UID has already been registered /// </summary> /// <returns></returns> public bool CheckIfVoterUIdExists(int surveyId, string uId) { return(VoterFactory.Create().CheckIfVoterUIdExists(surveyId, uId)); }
/// <summary> /// Returns all the text entries of the voters /// </summary> /// <param name="surveyId"></param> /// <param name="pageNumber"></param> /// <param name="pageSize"></param> /// <param name="startDate"></param> /// <param name="endDate"></param> /// <returns></returns> public DataSet GetVotersTextEntries(int surveyId, int pageNumber, int pageSize, DateTime startDate, DateTime endDate) { return(VoterFactory.Create().GetVotersTextEntries(surveyId, pageNumber, pageSize, startDate, endDate)); }
/// <summary> /// Deletes all unvalidated entries /// </summary> public void DeleteUnvalidatedVoters(int surveyId) { VoterFactory.Create().DeleteUnvalidatedVoters(surveyId); }
/// <summary> /// Deletes the log of the invitation /// </summary> /// <param name="invitationLogId"></param> public void DeleteInvitationLog(int invitationLogId) { VoterFactory.Create().DeleteInvitationLog(invitationLogId); }
public void ImportVoter(int surveyId, NSurveyVoter importVoter) { VoterFactory.Create().ImportVoter(surveyId, importVoter); }
public void UpdateVoterADInfo(int surveyId, int voterId, VoterADInfo user) { VoterFactory.Create().UpdateVoterADInfo(surveyId, voterId, user); }
/// <summary> /// Update the asp.net username of the voter /// </summary> public void UpdateVoterUserName(int voterId, string userName) { VoterFactory.Create().UpdateVoterUserName(voterId, userName); }
/// <summary> /// Updates voter's answer /// </summary> /// <param name="voterAnswers">Voter and all his answers information</param> public void UpdateVoter(VoterAnswersData updatedVoterAnswers) { VoterFactory.Create().UpdateVoter(updatedVoterAnswers); }
/// <summary> /// Set the give uid to the voter /// </summary> public void SetVoterUId(int voterId, string uId) { VoterFactory.Create().SetVoterUId(voterId, uId); }
/// <summary> /// Returns all voters who have answered an invitation /// </summary> public VoterData GetVotersInvitationAnswered(int surveyId, int pageNumber, int pageSize, out int totalRecords) { return(VoterFactory.Create().GetVotersInvitationAnswered(surveyId, pageNumber, pageSize, out totalRecords)); }
/// <summary> /// Delete all answer a voter gave for the survey /// </summary> public void DeleteVoterAnswers(int voterId) { VoterFactory.Create().DeleteVoterAnswers(voterId); }
/// <summary> /// Check if the username has already taken the survey /// </summary> public bool HasUserNameVoted(int surveyId, string userName) { return(VoterFactory.Create().HasUserNameVoted(surveyId, userName)); }
/// <summary> /// Delete a voter and all its answers /// </summary> /// <param name="voterId"></param> /// <returns></returns> public void DeleteVoterById(int voterId) { VoterFactory.Create().DeleteVoterById(voterId); }
/// <summary> /// Checks if the given IP has already been registered /// in the expiration time lapse /// </summary> /// <param name="surveyId"></param> /// <param name="voterIP"></param> /// <param name="IPExpires"></param> /// <returns></returns> public bool CheckIfVoterIPExists(int surveyId, string voterIP) { return(VoterFactory.Create().CheckIfVoterIPExists(surveyId, voterIP)); }
/// <summary> /// Deletes the email from the survey invitation queue /// </summary> /// <param name="surveyId"></param> /// <param name="emailId"></param> public void DeleteVoterInvitation(int surveyId, int emailId) { VoterFactory.Create().DeleteVoterInvitation(surveyId, emailId); }
/// <summary> /// Returns a CSV formatted string with all voters answers /// </summary> public CSVExportData GetCSVExport(int surveyId, DateTime startDate, DateTime endDate) { return(VoterFactory.Create().GetForCSVExport(surveyId, startDate, endDate)); }
/// <summary> /// Deletes the email from the survey invitation queue /// </summary> /// <param name="surveyId"></param> /// <param name="emailId"></param> public void DeleteVoterInvitation(int surveyId, string email) { VoterFactory.Create().DeleteVoterInvitation(surveyId, email); }
/// <summary> /// returns the guid from the queue for the given email and survey id /// </summary> public string GetEmailUId(int surveyId, string email) { return(VoterFactory.Create().GetEmailUId(surveyId, email)); }
/// <summary> /// Delete all answer a voter gave for the page /// </summary> public void DeleteVoterPageAnswers(int surveyId, int voterId, int pageNumber) { VoterFactory.Create().DeleteVoterPageAnswers(surveyId, voterId, pageNumber); }
/// <summary> /// Returns all the logged message during a mailing /// </summary> public InvitationLogData GetInvitationLogs(int surveyId, int pageNumber, int pageSize, out int totalRecords) { return(VoterFactory.Create().GetInvitationLogs(surveyId, pageNumber, pageSize, out totalRecords)); }
/// <summary> /// Delete all answer a voter gave for the question /// </summary> public void DeleteVoterQuestionAnswers(int voterId, int questionId) { VoterFactory.Create().DeleteVoterQuestionAnswers(voterId, questionId); }
/// <summary> /// returns the number of unvalidated entries (saved progress) /// </summary> public int GetUnvalidatedVotersCount(int surveyId) { return(VoterFactory.Create().GetUnvalidatedVotersCount(surveyId)); }
/// <summary> /// Deletes a voter resume session /// from the database /// </summary> public void DeleteVoterResumeSession(int surveyId, string resumeUId) { VoterFactory.Create().DeleteVoterResumeSession(surveyId, resumeUId); }