/// <summary> /// Remove the answer type from the database /// </summary> /// <param name="answerTypeId">Answer type to delete from the database</param> public void DeleteAnswerType(int answerTypeId) { IAnswerType type = AnswerTypeFactory.Create(); if (type.IsAnswerTypeInUse(answerTypeId)) { throw new AnswerTypeInUseException(); } type.DeleteAnswerType(answerTypeId); }
/// <summary> /// Update the answer type in the database /// </summary> /// <param name="updatedAnswerType">Answer type to update, must specify the answer type id</param> public void UpdateAnswerType(AnswerTypeData updatedAnswerType) { AnswerTypeFactory.Create().UpdateAnswerType(updatedAnswerType); }
/// <summary> /// Makes the answer type as builtin /// </summary> public void SetBuiltInAnswerType(int answerTypeId) { AnswerTypeFactory.Create().SetBuiltInAnswerType(answerTypeId); }
/// <summary> /// Adds a new answer type in the database /// </summary> /// <param name="newAnswerType">Answer type object with information about what to add. Only Id must be ommited</param> public void AddAnswerType(AnswerTypeData newAnswerType, int userId) { AnswerTypeFactory.Create().AddAnswerType(newAnswerType, userId); }
/// <summary> /// Assign the answer type to the user /// </summary> public void AssignAnswerTypeToUser(int answerTypeId, int userId) { AnswerTypeFactory.Create().AssignAnswerTypeToUser(answerTypeId, userId); }
/// <summary> /// Returns a list of answer types available to the user and that can /// be edited from the admin interface /// </summary> public AnswerTypeData GetEditableAssignedAnswerTypesList(int userId) { return(AnswerTypeFactory.Create().GetEditableAssignedAnswerTypesList(userId)); }
/// <summary> /// Returns a list of answer types that can be edited from the /// admin interface /// </summary> public AnswerTypeData GetEditableAnswerTypesList() { return(AnswerTypeFactory.Create().GetEditableAnswerTypesList()); }
/// <summary> /// Returns a list of answer types available to the user /// </summary> public AnswerTypeData GetAssignedAnswerTypesList(int userId, int surveyId) { return(AnswerTypeFactory.Create().GetAssignedAnswerTypesList(userId, surveyId)); }
/// <summary> /// Returns all the answer type available /// </summary> public AnswerTypeData GetAnswerTypes() { return(AnswerTypeFactory.Create().GetAnswerTypes()); }
/// <summary> /// Return an answer type object that reflects the database answer type /// </summary> /// <param name="answerTypeId">Id of the answer type you need</param> /// <returns>An answer type object with the current database values</returns> public AnswerTypeData GetAnswerTypeById(int answerTypeId) { return(AnswerTypeFactory.Create().GetAnswerTypeById(answerTypeId)); }