Exemplo n.º 1
0
 TestPart GetTestPart(Account account, Part part)
 {
     using (var context = new TestingSystemContext())
     {
         var testPart = context.TestParts.FirstOrDefault(tp => tp.AccountId.Equals(account.AccountId) && tp.PartId.Equals(part.PartId));
         return(testPart);
     }
 }
Exemplo n.º 2
0
        public UserTreeViewModel(
            IEventAggregator eventAggregator)


        {
            _eventAggregator = eventAggregator;

            //_userTopicViewModel = userTopicViewModel;
            //_userPreviewTestViewModel = userPreviewTestViewModel;
            Context = new TestingSystemContext();
        }
 public AdminTreeViewModel(
     IEventAggregator eventAggregator,
     AdminTopicViewModel adminTopicViewModel,
     AdminQuestionViewModel adminQuestionViewModel
     )
 {
     _eventAggregator        = eventAggregator;
     _adminTopicViewModel    = adminTopicViewModel;
     _adminQuestionViewModel = adminQuestionViewModel;
     Context = new TestingSystemContext();
     Context.Sections.Load();
 }
 void SaveResault()
 {
     using (var context = new TestingSystemContext())
     {
         var testParts = new TestPart()
         {
             AccountId = Account.AccountId, PartId = Part.PartId, CountCorrect = CountCorrect, Date = DateTime.Now
         };
         context.TestParts.Add(testParts);
         context.SaveChanges();
     }
     _eventAggregator.PublishOnUIThread(new NavigateToViewModel(NavigationToEnum.User, Account));
 }
Exemplo n.º 5
0
 public LoginViewModel(IEventAggregator eventAggregator)
 {
     _eventAggregator = eventAggregator;
     Context          = new TestingSystemContext();
     GroupCollection  = Context.Groups.ToList();
 }
 public NavigateToMessageForUser(object message, TestingSystemContext context)
 {
     Message = message;
     Context = context;
 }