public void AddFaculty(NewFaculty toAdd) { if (toAdd != null) { Faculty f = new Faculty() { Name = toAdd.FacultyName, }; foreach (Departament d in toAdd.Departaments) { f.Departaments.Add(d); } SPDatabase.DB.Faculties.AddObject(f); SPDatabase.DB.SaveChanges(); } }
public void EditFaculty(Faculty toEdit) { if (toEdit != null) { SPDatabase.DB.SaveChanges(); } }
public void DeleteFaculty(Faculty f) { SPDatabase.DB.Faculties.DeleteObject(f); SPDatabase.DB.SaveChanges(); }
/// <summary> /// Create a new Faculty object. /// </summary> /// <param name="facultyID">Initial value of the FacultyID property.</param> /// <param name="name">Initial value of the Name property.</param> public static Faculty CreateFaculty(global::System.Int32 facultyID, global::System.String name) { Faculty faculty = new Faculty(); faculty.FacultyID = facultyID; faculty.Name = name; return faculty; }
/// <summary> /// Deprecated Method for adding a new object to the Faculties EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToFaculties(Faculty faculty) { base.AddObject("Faculties", faculty); }