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); } }
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; }
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; }