C# Class Engage.Survey.Entities.SurveyRepository

Provides access to store and retrieve surveys and related types
Mostrar archivo Open project: EngageSoftware/Engage-Survey Class Usage Examples

Public Properties

Property Type Description
SharedResourceFile string

Public Methods

Method Description
CreateAnswer ( int userId ) : Answer

Creates a new Answer instance, to be persisted when SubmitChanges is called.

CreateQuestion ( int userId ) : Question

Creates a new Question instance, to be persisted when SubmitChanges is called.

CreateResponse ( int responseHeaderId, int userId ) : Response

Creates a new Response instance, to be persisted when SubmitChanges is called.

CreateResponseHeader ( int userId ) : ResponseHeader

Creates a new ResponseHeader instance, to be persisted when SubmitChanges is called.

CreateSurvey ( int userId, int portalId, int moduleId ) : Survey

Creates a new Survey instance, to be persisted when SubmitChanges is called.

DeleteAnswers ( IEnumerable answers, bool pendForNextSubmit ) : void

Deletes the specified answers.

DeleteQuestion ( int questionId ) : void

Deletes the specified question.

DeleteReadOnlySurvey ( int responseHeaderId ) : void

Deletes the specified completed survey ResponseHeader and responses.

DeleteSurvey ( int surveyId, int moduleId ) : void

Deletes the specified survey.

GetModuleIdForQuestion ( int questionId ) : int

Gets the ID of the module that the given question belongs to.

GetModuleIdForSurvey ( int surveyId ) : int

Gets the ID of the module that the given survey belongs to.

LoadAnswerResponseCounts ( int surveyId ) : IQueryable>>>

Loads all of the questions, their answers, and the number of responses per answer for the given survey

LoadQuestions ( int surveyId ) : IQueryable

Loads all of the questions for the given survey (based on its current definition)

LoadReadOnlyAnswers ( int responseHeaderId, int questionId ) : IQueryable

Loads the completed answers for a given completed question.

LoadReadOnlyQuestion ( int responseHeaderId, int questionId ) : IQuestion

Loads the given completed question.

LoadReadOnlyQuestions ( int responseHeaderId, int sectionId ) : IQueryable

Loads the completed questions for a given completed section.

LoadReadOnlySection ( int responseHeaderId, int sectionId ) : ReadonlySection

Loads the given completed section.

LoadReadOnlySections ( int responseHeaderId, int surveyId ) : IQueryable

Loads the completed sections for a given completed survey.

LoadReadOnlySurvey ( int responseHeaderId, int moduleId ) : ReadonlySurvey

Loads a completed survey using the ResponseHeader ID for the User/Survey.

LoadResponses ( int surveyId ) : Response>>.IQueryable

Gets the responses for the given survey.

LoadSurvey ( int surveyId ) : Survey

Loads the survey.

LoadSurvey ( int surveyId, int moduleId ) : Survey

Loads the survey for the given module.

LoadSurveys ( int moduleId, bool getOutdatedSurveys ) : IQueryable

Loads all the surveys for a particular module instance.

LoadSurveysForPortal ( int portalId ) : IQueryable

Loads all the surveys for a particular portal instance.

SubmitChanges ( ) : void

Submits all changes for connected instances to the database.

SurveyRepository ( ) : System

Initializes a new instance of the SurveyRepository class.

UserHasTaken ( int userId, int surveyId ) : bool

Checks the database to determine if a user has taken the specified survey.

Protected Methods

Method Description
SurveyRepository ( SurveyModelDataContext context ) : System

Initializes a new instance of the SurveyRepository class.

Private Methods

Method Description
LoadReadOnlySurveys ( ) : IQueryable

Loads all completed surveys.

Method Details

CreateAnswer() public method

Creates a new Answer instance, to be persisted when SubmitChanges is called.
public CreateAnswer ( int userId ) : Answer
userId int The ID of the user creating the instance.
return Answer

CreateQuestion() public method

Creates a new Question instance, to be persisted when SubmitChanges is called.
public CreateQuestion ( int userId ) : Question
userId int The ID of the user creating the instance.
return Question

CreateResponse() public method

Creates a new Response instance, to be persisted when SubmitChanges is called.
public CreateResponse ( int responseHeaderId, int userId ) : Response
responseHeaderId int The ID of the that the instance is connected to.
userId int The ID of the user creating the instance.
return Response

CreateResponseHeader() public method

Creates a new ResponseHeader instance, to be persisted when SubmitChanges is called.
public CreateResponseHeader ( int userId ) : ResponseHeader
userId int The ID of the user creating the instance.
return ResponseHeader

CreateSurvey() public method

Creates a new Survey instance, to be persisted when SubmitChanges is called.
public CreateSurvey ( int userId, int portalId, int moduleId ) : Survey
userId int The ID of the user creating the instance.
portalId int The ID of the survey's portal.
moduleId int The ID of the module that owns the survey.
return Survey

DeleteAnswers() public method

Deletes the specified answers.
public DeleteAnswers ( IEnumerable answers, bool pendForNextSubmit ) : void
answers IEnumerable The answers to delete.
pendForNextSubmit bool /// if set to true pends the deletion to occur at the next call to ; /// otherwise, executes the deletion immediately (by calling ).
return void

DeleteQuestion() public method

Deletes the specified question.
public DeleteQuestion ( int questionId ) : void
questionId int The ID of the question.
return void

DeleteReadOnlySurvey() public method

Deletes the specified completed survey ResponseHeader and responses.
public DeleteReadOnlySurvey ( int responseHeaderId ) : void
responseHeaderId int The ID
return void

DeleteSurvey() public method

Deletes the specified survey.
public DeleteSurvey ( int surveyId, int moduleId ) : void
surveyId int The ID of the survey to delete.
moduleId int The ID of the module in which to find the survey.
return void

GetModuleIdForQuestion() public method

Gets the ID of the module that the given question belongs to.
public GetModuleIdForQuestion ( int questionId ) : int
questionId int The question's ID.
return int

GetModuleIdForSurvey() public method

Gets the ID of the module that the given survey belongs to.
public GetModuleIdForSurvey ( int surveyId ) : int
surveyId int The survey's ID.
return int

LoadAnswerResponseCounts() public method

Loads all of the questions, their answers, and the number of responses per answer for the given survey
public LoadAnswerResponseCounts ( int surveyId ) : IQueryable>>>
surveyId int The ID of the survey.
return IQueryable>>>

LoadQuestions() public method

Loads all of the questions for the given survey (based on its current definition)
public LoadQuestions ( int surveyId ) : IQueryable
surveyId int The ID of the survey.
return IQueryable

LoadReadOnlyAnswers() public method

Loads the completed answers for a given completed question.
public LoadReadOnlyAnswers ( int responseHeaderId, int questionId ) : IQueryable
responseHeaderId int The ID of the of the completed survey.
questionId int The ID of the question.
return IQueryable

LoadReadOnlyQuestion() public method

Loads the given completed question.
public LoadReadOnlyQuestion ( int responseHeaderId, int questionId ) : IQuestion
responseHeaderId int The ID of the of the completed survey.
questionId int The ID of the question.
return IQuestion

LoadReadOnlyQuestions() public method

Loads the completed questions for a given completed section.
public LoadReadOnlyQuestions ( int responseHeaderId, int sectionId ) : IQueryable
responseHeaderId int The ID of the of the completed survey.
sectionId int The ID of the section.
return IQueryable

LoadReadOnlySection() public method

Loads the given completed section.
public LoadReadOnlySection ( int responseHeaderId, int sectionId ) : ReadonlySection
responseHeaderId int The ID of the of the completed survey.
sectionId int The ID of the section.
return ReadonlySection

LoadReadOnlySections() public method

Loads the completed sections for a given completed survey.
public LoadReadOnlySections ( int responseHeaderId, int surveyId ) : IQueryable
responseHeaderId int The ID of the of the completed survey.
surveyId int The ID of the survey.
return IQueryable

LoadReadOnlySurvey() public method

Loads a completed survey using the ResponseHeader ID for the User/Survey.
public LoadReadOnlySurvey ( int responseHeaderId, int moduleId ) : ReadonlySurvey
responseHeaderId int The ID.
moduleId int The module ID.
return ReadonlySurvey

LoadResponses() public method

Gets the responses for the given survey.
public LoadResponses ( int surveyId ) : Response>>.IQueryable
surveyId int The ID of the survey for which to get responses.
return Response>>.IQueryable

LoadSurvey() public method

Loads the survey.
public LoadSurvey ( int surveyId ) : Survey
surveyId int The survey id.
return Survey

LoadSurvey() public method

Loads the survey for the given module.
public LoadSurvey ( int surveyId, int moduleId ) : Survey
surveyId int The survey ID.
moduleId int The module ID.
return Survey

LoadSurveys() public method

Loads all the surveys for a particular module instance.
public LoadSurveys ( int moduleId, bool getOutdatedSurveys ) : IQueryable
moduleId int The ID of the module by which surveys should be filtered.
getOutdatedSurveys bool Whether to retrieve surveys whose or is out of range for the current date
return IQueryable

LoadSurveysForPortal() public method

Loads all the surveys for a particular portal instance.
public LoadSurveysForPortal ( int portalId ) : IQueryable
portalId int The ID of the portal by which surveys should be filtered.
return IQueryable

SubmitChanges() public method

Submits all changes for connected instances to the database.
public SubmitChanges ( ) : void
return void

SurveyRepository() public method

Initializes a new instance of the SurveyRepository class.
public SurveyRepository ( ) : System
return System

SurveyRepository() protected method

Initializes a new instance of the SurveyRepository class.
protected SurveyRepository ( SurveyModelDataContext context ) : System
context SurveyModelDataContext The data context.
return System

UserHasTaken() public method

Checks the database to determine if a user has taken the specified survey.
public UserHasTaken ( int userId, int surveyId ) : bool
userId int The id of the user.
surveyId int The id of the survey.
return bool

Property Details

SharedResourceFile public_oe static_oe property

The path to the resource file in which localized content for this class exists
public static string SharedResourceFile
return string