public void SetValue(Course aCourse) { this.StudentCode = aCourse.Stu_Code; this.SubjectCode = aCourse.Sub_Code; this.TeacherCode = aCourse.Ter_Code; this.CourseExam = aCourse.Cou_Exam; this.CourseProcess = aCourse.Cou_Process; this.CourseScore = aCourse.Cou_Score; this.CourseStatus = aCourse.Cou_Status; }
// Insert new Course public bool Insert(Course aCourse) { try { db.Courses.InsertOnSubmit(aCourse); db.SubmitChanges(); return true; } catch (Exception ex) { return false; throw new Exception("CourseBO.Insert" + ex.ToString()); } }
// Update Course public bool Update(Course aCourse) { try { var editObj = db.Courses.Where(b => b.Stu_Code == aCourse.Stu_Code && b.Sub_Code == aCourse.Sub_Code && b.Ter_Code == aCourse.Ter_Code).FirstOrDefault(); editObj.Cou_Process = aCourse.Cou_Process; editObj.Cou_Exam = aCourse.Cou_Exam; editObj.Cou_Score = aCourse.Cou_Score; editObj.Cou_Status = aCourse.Cou_Status; db.SubmitChanges(); return true; } catch (Exception ex) { return false; throw new Exception("CourseBO.Update" + ex.ToString()); } }
partial void DeleteCourse(Course instance);
partial void UpdateCourse(Course instance);
partial void InsertCourse(Course instance);