public void AddValue(decimal idSchool, decimal idQuartersType, decimal area)
 {
     var sameSchoolQuarters =
         (from sq in EntitiesHolder.Entities.SchoolQuarters
          where sq.idSchool == idSchool && sq.idQuartersType == idQuartersType
          select sq).ToList();
     if (sameSchoolQuarters.Count > 0)
     {
         throw new ValueAlreadyExistsException();
     }
     SchoolQuarters schoolQuarters = new SchoolQuarters();
     schoolQuarters.idSchool = idSchool;
     schoolQuarters.idQuartersType = idQuartersType;
     schoolQuarters.area = area;
     EntitiesHolder.Entities.SchoolQuarters.AddObject(schoolQuarters);
     EntitiesHolder.Entities.SaveChanges();
 }
예제 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the SchoolQuarters EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSchoolQuarters(SchoolQuarters schoolQuarters)
 {
     base.AddObject("SchoolQuarters", schoolQuarters);
 }
예제 #3
0
 /// <summary>
 /// Create a new SchoolQuarters object.
 /// </summary>
 /// <param name="idSchool">Initial value of the idSchool property.</param>
 /// <param name="idQuartersType">Initial value of the idQuartersType property.</param>
 public static SchoolQuarters CreateSchoolQuarters(global::System.Decimal idSchool, global::System.Decimal idQuartersType)
 {
     SchoolQuarters schoolQuarters = new SchoolQuarters();
     schoolQuarters.idSchool = idSchool;
     schoolQuarters.idQuartersType = idQuartersType;
     return schoolQuarters;
 }