public void SetValue(TimeTableCourse aTimeTC) { this.SubjectCode = aTimeTC.Sub_Code; this.TeacherCode = aTimeTC.Tea_Code; this.TermCode = aTimeTC.Ter_Code; this.TimeTableCourseRoom = aTimeTC.Ttc_Room; }
//Insert new TimeTableCourse public bool Insert(TimeTableCourse aTimeTableCourse) { try { db.TimeTableCourses.InsertOnSubmit(aTimeTableCourse); db.SubmitChanges(); return(true); } catch (Exception ex) { return(false); throw new Exception("TimeTableCourseBO.Insert" + ex.ToString()); } }
//Update TimeTableCourse public bool Update(TimeTableCourse aTimeTableCourse) { try { var editObj = db.TimeTableCourses.Where(b => b.Ter_Code == aTimeTableCourse.Ter_Code).Where(b => b.Sub_Code == aTimeTableCourse.Sub_Code).FirstOrDefault(); editObj.Tea_Code = aTimeTableCourse.Tea_Code; editObj.Ttc_Room = aTimeTableCourse.Ttc_Room; db.SubmitChanges(); return(true); } catch (Exception ex) { return(false); throw new Exception("TimeTableCourseBO.Update" + ex.ToString()); } }