Esempio n. 1
0
        public void Add(ref Question question, long SurveyID)
        {
            DatabaseModel.Question.Add(question);
            DatabaseModel.SaveChanges();

            using (SurveyDefinitionController surveyDefinitionController = new SurveyDefinitionController(DatabasePath))
                surveyDefinitionController.AddRelation(SurveyID, question.QuestionID);
        }
Esempio n. 2
0
        public void Delete(long QuestionID, long SurveyID)
        {
            Question QuestionToDelete = (from question in DatabaseModel.Question where question.QuestionID == QuestionID select question).First();

            using (SurveyDefinitionController surveyDefinitionController = new SurveyDefinitionController(DatabasePath))
                surveyDefinitionController.DeleteRelation(SurveyID, QuestionID);

            DatabaseModel.Question.Remove(QuestionToDelete);
            DatabaseModel.SaveChanges();
        }