public static void AddStudent(student_t student) { using (SchoolDataDataContext data = new SchoolDataDataContext()) { data.student_ts.InsertOnSubmit(student); data.SubmitChanges(); } }
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(); } }
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(); } }
partial void Deletestudent_t(student_t instance);
partial void Updatestudent_t(student_t instance);
partial void Insertstudent_t(student_t instance);