コード例 #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);
     }
 }
コード例 #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));
 }
コード例 #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;
 }