Example #1
0
 public static void AddStudent(student_t student)
 {
     using (SchoolDataDataContext data = new SchoolDataDataContext())
     {
         data.student_ts.InsertOnSubmit(student);
         data.SubmitChanges();
     }
 }
Example #2
0
 public static void DeleteStudent(student_t student)
 {
     using (SchoolDataDataContext data = new SchoolDataDataContext())
     {
         student_t st = (from s in data.student_ts
                         where s.studentID == student.studentID
                         select s).FirstOrDefault();
         data.student_ts.DeleteOnSubmit(st);
         data.SubmitChanges();
     }
 }
Example #3
0
 public static void UpdateStudent(student_t student)
 {
     using (SchoolDataDataContext data = new SchoolDataDataContext())
     {
         student_t st = (from s in data.student_ts where s.studentID == student.studentID
                         select s).FirstOrDefault();
         st.first_name = student.first_name;
         st.last_name  = student.last_name;
         st.gender     = student.gender;
         st.gpa        = student.gpa;
         data.SubmitChanges();
     }
 }
Example #4
0
 partial void Deletestudent_t(student_t instance);
Example #5
0
 partial void Updatestudent_t(student_t instance);
Example #6
0
 partial void Insertstudent_t(student_t instance);