C# Класс Engage.Survey.Entities.SurveyRepository

Provides access to store and retrieve surveys and related types
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
SharedResourceFile string

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
SurveyRepository ( SurveyModelDataContext context ) : System

Initializes a new instance of the SurveyRepository class.

Приватные методы

Метод Описание
LoadReadOnlySurveys ( ) : IQueryable

Loads all completed surveys.

Описание методов

CreateAnswer() публичный Метод

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.
Результат Answer

CreateQuestion() публичный Метод

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.
Результат Question

CreateResponse() публичный Метод

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.
Результат Response

CreateResponseHeader() публичный Метод

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.
Результат ResponseHeader

CreateSurvey() публичный Метод

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.
Результат Survey

DeleteAnswers() публичный Метод

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 ).
Результат void

DeleteQuestion() публичный Метод

Deletes the specified question.
public DeleteQuestion ( int questionId ) : void
questionId int The ID of the question.
Результат void

DeleteReadOnlySurvey() публичный Метод

Deletes the specified completed survey ResponseHeader and responses.
public DeleteReadOnlySurvey ( int responseHeaderId ) : void
responseHeaderId int The ID
Результат void

DeleteSurvey() публичный Метод

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.
Результат void

GetModuleIdForQuestion() публичный Метод

Gets the ID of the module that the given question belongs to.
public GetModuleIdForQuestion ( int questionId ) : int
questionId int The question's ID.
Результат int

GetModuleIdForSurvey() публичный Метод

Gets the ID of the module that the given survey belongs to.
public GetModuleIdForSurvey ( int surveyId ) : int
surveyId int The survey's ID.
Результат int

LoadAnswerResponseCounts() публичный Метод

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.
Результат IQueryable>>>

LoadQuestions() публичный Метод

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.
Результат IQueryable

LoadReadOnlyAnswers() публичный Метод

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.
Результат IQueryable

LoadReadOnlyQuestion() публичный Метод

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.
Результат IQuestion

LoadReadOnlyQuestions() публичный Метод

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.
Результат IQueryable

LoadReadOnlySection() публичный Метод

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.
Результат ReadonlySection

LoadReadOnlySections() публичный Метод

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.
Результат IQueryable

LoadReadOnlySurvey() публичный Метод

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.
Результат ReadonlySurvey

LoadResponses() публичный Метод

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.
Результат Response>>.IQueryable

LoadSurvey() публичный Метод

Loads the survey.
public LoadSurvey ( int surveyId ) : Survey
surveyId int The survey id.
Результат Survey

LoadSurvey() публичный Метод

Loads the survey for the given module.
public LoadSurvey ( int surveyId, int moduleId ) : Survey
surveyId int The survey ID.
moduleId int The module ID.
Результат Survey

LoadSurveys() публичный Метод

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
Результат IQueryable

LoadSurveysForPortal() публичный Метод

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.
Результат IQueryable

SubmitChanges() публичный Метод

Submits all changes for connected instances to the database.
public SubmitChanges ( ) : void
Результат void

SurveyRepository() публичный Метод

Initializes a new instance of the SurveyRepository class.
public SurveyRepository ( ) : System
Результат System

SurveyRepository() защищенный Метод

Initializes a new instance of the SurveyRepository class.
protected SurveyRepository ( SurveyModelDataContext context ) : System
context SurveyModelDataContext The data context.
Результат System

UserHasTaken() публичный Метод

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.
Результат bool

Описание свойств

SharedResourceFile публичное статическое свойство

The path to the resource file in which localized content for this class exists
public static string SharedResourceFile
Результат string