コード例 #1
0
 public void AddValue(string schoolName, decimal idSPT, decimal idSBPT, decimal amount, string address, decimal idDistrict)
 {
     CheckCapacity();
     var sameSchools =
         (from sc in EntitiesHolder.Entities.School
          where sc.nameSchool == schoolName
          select sc).ToList();
     if (sameSchools.Count > 0)
     {
         throw new ValueAlreadyExistsException();
     }
     School s = new School();
     s.idSchool = FreeIndex;
     s.nameSchool = schoolName;
     s.idSchoolPropertyType = idSPT;
     s.idSchoolBuildingPropertyType = idSBPT;
     s.computersAmount = amount;
     s.address = address;
     s.idDistrict = idDistrict;
     EntitiesHolder.Entities.School.AddObject(s);
     EntitiesHolder.Entities.SaveChanges();
 }
コード例 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the School EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSchool(School school)
 {
     base.AddObject("School", school);
 }
コード例 #3
0
 /// <summary>
 /// Create a new School object.
 /// </summary>
 /// <param name="idSchool">Initial value of the idSchool property.</param>
 /// <param name="nameSchool">Initial value of the nameSchool property.</param>
 public static School CreateSchool(global::System.Decimal idSchool, global::System.String nameSchool)
 {
     School school = new School();
     school.idSchool = idSchool;
     school.nameSchool = nameSchool;
     return school;
 }