コード例 #1
0
        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();
            }
        }
コード例 #2
0
 public void EditFaculty(Faculty toEdit)
 {
     if (toEdit != null)
     {
         SPDatabase.DB.SaveChanges();
     }
 }
コード例 #3
0
 public void DeleteFaculty(Faculty f)
 {
     SPDatabase.DB.Faculties.DeleteObject(f);
     SPDatabase.DB.SaveChanges();
 }
コード例 #4
0
 /// <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;
 }
コード例 #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Faculties EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToFaculties(Faculty faculty)
 {
     base.AddObject("Faculties", faculty);
 }