Exemplo n.º 1
0
        public void Edit(int id, string title, byte mark, byte course, int student, int teacher)
        {
            CourseWork cw = GetCourseWork(id);

            cw.Title   = title;
            cw.Mark    = mark;
            cw.Course  = course;
            cw.Student = cont.StudentSet.Find(student);
            cw.Teacher = cont.TeacherSet.Find(teacher);

            cont.SaveChanges();
        }
Exemplo n.º 2
0
        public void Add(string title, byte mark, byte course, int student, int teacher)
        {
            CourseWork cw = new CourseWork();

            cw.Title   = title;
            cw.Mark    = mark;
            cw.Course  = course;
            cw.Student = cont.StudentSet.Find(student);
            cw.Teacher = cont.TeacherSet.Find(teacher);

            cont.CourseWorkSet.Add(cw);
            cont.SaveChanges();
        }