public void AddUniversityAcceptanceStatistic(UniversityAcceptanceStatistic universityAcceptanceStatistic)
        {
            if (universityAcceptanceStatistic == null)
                throw new ArgumentNullException("universityAcceptanceStatistic");

            using (UniversityAcceptanceStatisticRepository repository = new UniversityAcceptanceStatisticRepository())
            {
                var existedUniversityAcceptanceStatistic = repository.GetFiltered(u => u.UniversityId == universityAcceptanceStatistic.UniversityId && u.Year.Year == universityAcceptanceStatistic.Year.Year);
                if (existedUniversityAcceptanceStatistic != null)
                {
                    // TODO: throw existing speciality of that UniversityAcceptanceStatistic
                }
                repository.Add(universityAcceptanceStatistic);
                repository.Commit();
            }
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the UniversityAcceptanceStatistics EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUniversityAcceptanceStatistics(UniversityAcceptanceStatistic universityAcceptanceStatistic)
 {
     base.AddObject("UniversityAcceptanceStatistics", universityAcceptanceStatistic);
 }
        public void UpdateUniversityAcceptanceStatistic(UniversityAcceptanceStatistic universityAcceptanceStatistic)
        {
            if (universityAcceptanceStatistic == null)
                throw new ArgumentNullException("universityAcceptanceStatistic");

            using (UniversityAcceptanceStatisticRepository repository = new UniversityAcceptanceStatisticRepository())
            {
                repository.Modify(universityAcceptanceStatistic);
                repository.Commit();
            }
        }
Пример #4
0
 /// <summary>
 /// Create a new UniversityAcceptanceStatistic object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="year">Initial value of the Year property.</param>
 /// <param name="highestScore">Initial value of the HighestScore property.</param>
 /// <param name="lowestScore">Initial value of the LowestScore property.</param>
 /// <param name="averageScore">Initial value of the AverageScore property.</param>
 /// <param name="batch">Initial value of the Batch property.</param>
 /// <param name="universityId">Initial value of the UniversityId property.</param>
 /// <param name="provinceId">Initial value of the ProvinceId property.</param>
 /// <param name="acceptNumber">Initial value of the AcceptNumber property.</param>
 public static UniversityAcceptanceStatistic CreateUniversityAcceptanceStatistic(global::System.Int32 id, global::System.Int32 year, global::System.Double highestScore, global::System.Double lowestScore, global::System.Double averageScore, global::System.String batch, global::System.Guid universityId, global::System.Guid provinceId, global::System.Int32 acceptNumber)
 {
     UniversityAcceptanceStatistic universityAcceptanceStatistic = new UniversityAcceptanceStatistic();
     universityAcceptanceStatistic.Id = id;
     universityAcceptanceStatistic.Year = year;
     universityAcceptanceStatistic.HighestScore = highestScore;
     universityAcceptanceStatistic.LowestScore = lowestScore;
     universityAcceptanceStatistic.AverageScore = averageScore;
     universityAcceptanceStatistic.Batch = batch;
     universityAcceptanceStatistic.UniversityId = universityId;
     universityAcceptanceStatistic.ProvinceId = provinceId;
     universityAcceptanceStatistic.AcceptNumber = acceptNumber;
     return universityAcceptanceStatistic;
 }