public void AddTextAnswer(TextAnswer textAnswer)
 {
     using (var context = new FinalProjectDBEntities1())
     {
         context.TextAnswers.Add(textAnswer);
     }
 }
Ejemplo n.º 2
0
 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());
     }
 }
Ejemplo n.º 5
0
 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);
     }
 }
Ejemplo n.º 7
0
 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);
     }
 }
Ejemplo n.º 9
0
        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();
                }
            }
        }
Ejemplo n.º 10
0
 public void AddQuestionType(QuestionType questiontype)
 {
     using (var context = new FinalProjectDBEntities1())
     {
         context.QuestionTypes.Add(questiontype);
     }
 }
Ejemplo n.º 11
0
 public Group GetGroupById(int Id)
 {
     using (var context = new FinalProjectDBEntities1())
     {
         return(context.Groups.Find(Id));
     }
 }
Ejemplo n.º 12
0
 public Course GetCourseById(int Id)
 {
     using (var context = new FinalProjectDBEntities1())
     {
         return(context.Courses.Find(Id));
     }
 }
Ejemplo n.º 13
0
 public Module GetModuleById(int Id)
 {
     using (var context = new FinalProjectDBEntities1())
     {
         return(context.Modules.Find(Id));
     }
 }
Ejemplo n.º 14
0
 public void AddModule(Module module)
 {
     using (var context = new FinalProjectDBEntities1())
     {
         context.Modules.Add(module);
     }
 }
Ejemplo n.º 15
0
 public Admin GetAdminById(int Id)
 {
     using (var context = new FinalProjectDBEntities1())
     {
         return(context.Admins.Find(Id));
     }
 }
Ejemplo n.º 16
0
 public IEnumerable <Question> GetListOfQuestion()
 {
     using (var context = new FinalProjectDBEntities1())
     {
         return(context.Questions.ToList());
     }
 }
Ejemplo n.º 17
0
 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);
     }
 }
Ejemplo n.º 20
0
 public Theme GetThemeById(int Id)
 {
     using (var context = new FinalProjectDBEntities1())
     {
         return(context.Themes.Find(Id));
     }
 }
Ejemplo n.º 21
0
 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());
     }
 }
Ejemplo n.º 23
0
 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));
     }
 }
Ejemplo n.º 26
0
 public void AddTestPassing(TestPassing testPassing)
 {
     using (var context = new FinalProjectDBEntities1())
     {
         context.TestPassings.Add(testPassing);
     }
 }
Ejemplo n.º 27
0
 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);
     }
 }