public override void StoreToDB(TimeSpan span)
 {
     if (!this.CurrentLesson.IsLast)
     {
         return;
     }
     using (var db = new Data.TutorialData())
     {
         db.LessonHistory.Add(new Data.LessonStatistic
         {
             Time     = span,
             Title    = this.CurrentTitle,
             Username = this.Username
         });
         db.SaveChanges();
     }
 }
Esempio n. 2
0
 public override void StoreToDB(TimeSpan span)
 {
     if (!this.CurrentTest.IsLast)
     {
         return;
     }
     using (var db = new Data.TutorialData())
     {
         db.TestHistory.Add(new Data.TestStatistic
         {
             Time       = span,
             Title      = this.CurrentTitle,
             Username   = this.Username,
             RightCount = this.CurrentTest.QuestionsCount - this.CurrentTest.WrongCount,
             Amount     = this.CurrentTest.QuestionsCount
         });
         db.SaveChanges();
     }
 }