Beispiel #1
0
        public void Update_Question(Question question)
        {
            using (db)
            {
                QuestionList ja = (from j in db.QuestionLists where j.Id == question.QuestionID select j).FirstOrDefault();
                ja.Title    = question.QuestionTitle;
                ja.Question = question.FullQuestion;

                db.SaveChanges();
            }
        }
Beispiel #2
0
 public void addNewPreAppQuestion(Question question)
 {
     using (db)
     {
         QuestionList ql = new QuestionList
         {
             Title    = question.QuestionTitle,
             Question = question.FullQuestion,
             Id       = question.QuestionID,
             Type     = "PREAPP"
         };
         db.QuestionLists.Add(ql);
         db.SaveChanges();
     }
 }
Beispiel #3
0
 public void deleteQuestionByID(int?value)
 {
     using (db)
     {
         try
         {
             QuestionList question = db.QuestionLists.Find(value);
             db.QuestionLists.Remove(question);
             db.SaveChanges();
         }
         catch
         {
             throw new Exception("Jobs not Removed!!!");
         }
     }
 }