public void AddTextAnswer(TextAnswer textAnswer) { using (var context = new FinalProjectDBEntities1()) { context.TextAnswers.Add(textAnswer); } }
public void AddQuestion(Question question) { using (var context = new FinalProjectDBEntities1()) { context.Questions.Add(question); } }
public MultichoiceAnswer GetMultiChoiceAnswerById(int Id) { using (var context = new FinalProjectDBEntities1()) { return(context.MultichoiceAnswers.Find(Id)); } }
public IEnumerable <MultichoiceAnswer> GetListOfMultiChoiceAnswers() { using (var context = new FinalProjectDBEntities1()) { return(context.MultichoiceAnswers.ToList()); } }
public void AddTheme(Theme theme) { using (var context = new FinalProjectDBEntities1()) { context.Themes.Add(theme); } }
public void AddStudent(Student student) { using (var context = new FinalProjectDBEntities1()) { context.Students.Add(student); } }
public void AddAdmin(Admin admin) { using (var context = new FinalProjectDBEntities1()) { context.Admins.Add(admin); } }
public void AddUserType(UserType userType) { using (var context = new FinalProjectDBEntities1()) { context.UserTypes.Add(userType); } }
public void AddGroup(Group group, string Course) { using (var context = new FinalProjectDBEntities1()) { List <int> list = (context.Courses.Join(context.Groups, cor => cor.Name, grop => Course, (cor, grop) => cor.Id)).Distinct().ToList(); group.BeginigDate = DateTime.Now; try { group.CourseId = list[0]; } catch (Exception e) { group.CourseId = 1; } List <Group> query = context.Groups .Where(x => x.Name == group.Name && (x.IsDeleted == false || x.IsDeleted == null)) .ToList(); if (query.Count == 0) { context.Groups.Add(group); context.SaveChanges(); } } }
public void AddQuestionType(QuestionType questiontype) { using (var context = new FinalProjectDBEntities1()) { context.QuestionTypes.Add(questiontype); } }
public Group GetGroupById(int Id) { using (var context = new FinalProjectDBEntities1()) { return(context.Groups.Find(Id)); } }
public Course GetCourseById(int Id) { using (var context = new FinalProjectDBEntities1()) { return(context.Courses.Find(Id)); } }
public Module GetModuleById(int Id) { using (var context = new FinalProjectDBEntities1()) { return(context.Modules.Find(Id)); } }
public void AddModule(Module module) { using (var context = new FinalProjectDBEntities1()) { context.Modules.Add(module); } }
public Admin GetAdminById(int Id) { using (var context = new FinalProjectDBEntities1()) { return(context.Admins.Find(Id)); } }
public IEnumerable <Question> GetListOfQuestion() { using (var context = new FinalProjectDBEntities1()) { return(context.Questions.ToList()); } }
public List <Admin> GetListOfAdmin() { using (var context = new FinalProjectDBEntities1()) { return(context.Admins.ToList()); } }
public IEnumerable <UserType> GetListOfUserType() { using (var context = new FinalProjectDBEntities1()) { return(context.UserTypes.ToList()); } }
public void AddMultiChoiceAnswers(MultichoiceAnswer multiChoiseAnswer) { using (var context = new FinalProjectDBEntities1()) { context.MultichoiceAnswers.Add(multiChoiseAnswer); } }
public Theme GetThemeById(int Id) { using (var context = new FinalProjectDBEntities1()) { return(context.Themes.Find(Id)); } }
public Question GetQuestionById(int Id) { using (var context = new FinalProjectDBEntities1()) { return(context.Questions.Find(Id)); } }
public IEnumerable <Test> GetListOfTest() { using (var context = new FinalProjectDBEntities1()) { return(context.Tests.ToList()); } }
public IEnumerable <Module> GetListOfModule() { using (var context = new FinalProjectDBEntities1()) { return(context.Modules.ToList()); } }
public void AddTest(Test test) { using (var context = new FinalProjectDBEntities1()) { context.Tests.Add(test); } }
public Test GetTestById(int Id) { using (var context = new FinalProjectDBEntities1()) { return(context.Tests.Find(Id)); } }
public void AddTestPassing(TestPassing testPassing) { using (var context = new FinalProjectDBEntities1()) { context.TestPassings.Add(testPassing); } }
public User GetUserById(int Id) { using (var context = new FinalProjectDBEntities1()) { return(context.Users.Find(Id)); } }
public Student GetStudentById(int Id) { using (var context = new FinalProjectDBEntities1()) { return(context.Students.Find(Id)); } }
public void DeleteTest(int Id) { using (var context = new FinalProjectDBEntities1()) { Test test = context.Tests.Find(Id); context.Tests.Remove(test); } }
public void DeleteStudent(int Id) { using (var context = new FinalProjectDBEntities1()) { Student student = context.Students.Find(Id); context.Students.Remove(student); } }