Exemplo n.º 1
0
 public void SaveOrUpdateQAHelpRequests(QAHelpRequest qaHelpRequestViewModel)
 {
     using (var dbContext = new DataAccess.TeachersAssistantDbContext())
     {
         _unitOfWork.InitializeDbContext(dbContext);
         var req = _unitOfWork._qAHelpRequestRepository.GetById(qaHelpRequestViewModel.QAHelpRequestId);
         if (req == null)
         {
             _unitOfWork._qAHelpRequestRepository.Add(qaHelpRequestViewModel);
         }
         else
         {
             _unitOfWork._qAHelpRequestRepository.Update(qaHelpRequestViewModel);
         }
         _unitOfWork.SaveChanges();
     }
 }
Exemplo n.º 2
0
 public void RequestQATime(QAHelpRequest qaHelpRequest)
 {
     using (var dbContext = new DataAccess.TeachersAssistantDbContext())
     {
         _unitOfWork.InitializeDbContext(dbContext);
         var request = _unitOfWork._qAHelpRequestRepository.GetById(qaHelpRequest.QAHelpRequestId);
         if (request == null)
         {
             _unitOfWork._qAHelpRequestRepository.Add(qaHelpRequest);
             _unitOfWork.SaveChanges();
         }
         else
         {
             _unitOfWork._qAHelpRequestRepository.Update(qaHelpRequest);
             _unitOfWork.SaveChanges();
         }
     }
 }