예제 #1
0
파일: Database.cs 프로젝트: westre/Petje-op
 public tblExam AddExam(Exam createdExam)
 {
     try
     {
         tblExam exam = new tblExam(); //Maak een exam aan en voeg alle gegevens toe n.a.v. de meegegeven exam.
         exam.starttime = createdExam.Starttime;
         exam.endtime = createdExam.Endtime;
         exam.id = createdExam.Examnr;
         exam.questionnaire = createdExam.Questionnaire.ID;
         exam.lecture = createdExam.Lecture.ID;
         db.tblExams.InsertOnSubmit(exam); //Voeg de exam toe aan de database en submit de changes.
         db.SubmitChanges();
         return exam;
     }
     catch (SqlException ex)
     {
         MessageBox.Show(ex.Message); return null; //Wanneer er iets fout gaat, laat een messagebox zien met de SQL exception.
     }
 }
예제 #2
0
		private void detach_exams(tblExam entity)
		{
			this.SendPropertyChanging();
			entity.tblLecture = null;
		}
예제 #3
0
 partial void DeletetblExam(tblExam instance);
예제 #4
0
 partial void UpdatetblExam(tblExam instance);
예제 #5
0
 partial void InserttblExam(tblExam instance);
예제 #6
0
		private void detach_tblExams(tblExam entity)
		{
			this.SendPropertyChanging();
			entity.tblQuestionnaire = null;
		}
예제 #7
0
		private void attach_exams(tblExam entity)
		{
			this.SendPropertyChanging();
			entity.tblQuestion = this;
		}