예제 #1
0
 public void InsertTest(Contract.CTestManager manager)
 {
     using (TestManagerDBContainer container = new TestManagerDBContainer())
     {
         int result = container.InsertTestManager(manager.Name, manager.Description, manager.NumberOfQuestions, manager.NumberOfQuestions, manager.TotalMarks, manager.GradeID, manager.Duration, manager.PassingMarks);
     }
 }
예제 #2
0
 public List<Contract.CTestManager> GetTests(List<int> TestIds)
 {
     List<Contract.CTestManager> testManager = null;
     using (TestManagerDBContainer container = new TestManagerDBContainer())
     {
         testManager = container.TestManagers.Where(e => TestIds.Contains(e.TestManagerID)).Select(e => new Contract.CTestManager()
         {
             TestId = e.TestManagerID,
             Name = e.TestName,
             Description = e.TestDescription,
             NumberOfQuestions = e.NumberOfQuestions,
             Percent = e.PassPercentage,
             PassingMarks = e.PassingMark,
             GradeID = e.GradeTypeID,
             TotalMarks = e.TotalMarks
         }).ToList();
     }
     return testManager;
 }
예제 #3
0
 public Contract.CTestManager GetTest(int TestID)
 {
     Contract.CTestManager testManager = null;
     using (TestManagerDBContainer container = new TestManagerDBContainer())
     {
         testManager = container.TestManagers.Where(e => e.TestManagerID == TestID).Select(e => new Contract.CTestManager()
         {
             TestId = e.TestManagerID,
             Name = e.TestName,
             Description = e.TestDescription,
             NumberOfQuestions = e.NumberOfQuestions,
             Percent = e.PassPercentage,
             PassingMarks = e.PassingMark,
             GradeID = e.GradeTypeID,
             TotalMarks = e.TotalMarks
         }).ToList().First();
     }
     return testManager;
 }