// insert new Faculty public bool Insert(Faculty aFaculty) { try { db.Faculties.InsertOnSubmit(aFaculty); db.SubmitChanges(); return true; } catch (Exception ex) { return false; throw new Exception("FacultyBO.Insert: " + ex.ToString()); } }
// update Faculty public bool Update(Faculty aFaculty) { try { var editObj = db.Faculties.Where(b => b.Fac_Code == aFaculty.Fac_Code).FirstOrDefault(); editObj.Fac_Name = aFaculty.Fac_Name; db.SubmitChanges(); return true; } catch (Exception ex) { return false; throw new Exception("FacultyBO.Update: " + ex.ToString()); } }
public void SetValueFaculty(Faculty faculty) { this.FacultyCode = faculty.Fac_Code; this.FacultyName = faculty.Fac_Name; }
partial void DeleteFaculty(Faculty instance);
partial void UpdateFaculty(Faculty instance);
partial void InsertFaculty(Faculty instance);