Beispiel #1
0
 public void SaveQTest(QTest qtest)
 {
     if (qtest.QTestID == 0)
     {
         context.QTests.Add(qtest);
     }
     else
     {
         var _qtest = context.QTests.Find(qtest.QTestID);
         if (_qtest != null)
         {
             _qtest.Question     = qtest.Question;
             _qtest.RightAnswer  = qtest.RightAnswer;
             _qtest.WrongAnswers = qtest.WrongAnswers;
         }
     } context.SaveChanges();
 }
Beispiel #2
0
 public void DeleteQTests(QTest qtest)
 {
     context.QTests.Remove(qtest);
     //context.SaveChanges();
 }