Example #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();
            }
        }
Example #2
0
 public void addNewPreAppQuestion(Question question)
 {
     using (db)
     {
         QuestionList ql = new QuestionList
         {
             Title    = question.QuestionTitle,
             Question = question.FullQuestion,
             Id       = question.QuestionID,
             IsActive = TRUE,
             Type     = "PREAPP"
         };
         db.QuestionLists.Add(ql);
         db.SaveChanges();
     }
 }
Example #3
0
 public void deleteQuestionByID(int?value)
 {
     using (db)
     {
         try
         {
             QuestionList question = db.QuestionLists.Find(value);
             db.QuestionLists.Remove(question);
             db.SaveChanges();
         }
         catch
         {
             db = new DB_9E5950_aes01Entities();
             QuestionList q = db.QuestionLists.Find(value);
             q.IsActive = FALSE;
             db.SaveChanges();
         }
     }
 }