public void PublishEnrollPlan(UniversityEnrollPlan enrollPlan)
        {
            if (enrollPlan == null)
                throw new ArgumentNullException("enrollPlan");

            using (UniversityEnrollPlanRepository enrollPlanRepository = new UniversityEnrollPlanRepository())
            {
                var ens = enrollPlanRepository.GetFiltered(e => e.Year.Year == enrollPlan.Year.Year && e.Province == enrollPlan.Province && e.UniversityId == enrollPlan.UniversityId);
                if (ens != null)
                {
                    // TODO: throw existing exception
                }
                enrollPlanRepository.Add(enrollPlan);
                enrollPlanRepository.Commit();
            }
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the UniversityEnrollPlans EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUniversityEnrollPlans(UniversityEnrollPlan universityEnrollPlan)
 {
     base.AddObject("UniversityEnrollPlans", universityEnrollPlan);
 }
        public void UpdateEnrollPlan(UniversityEnrollPlan enrollPlan)
        {
            if (enrollPlan == null)
                throw new ArgumentNullException("enrollPlan");

            using (UniversityEnrollPlanRepository enrollPlanRepository = new UniversityEnrollPlanRepository())
            {
                var enroll = enrollPlanRepository.Get(enrollPlan.Id);
                if (enroll == null)
                {
                    // TODO: throw not existing exception
                }
                enrollPlanRepository.Modify(enrollPlan);
                enrollPlanRepository.Commit();
            }
        }
 /// <summary>
 /// Create a new UniversityEnrollPlan object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="plannedNumber">Initial value of the PlannedNumber property.</param>
 /// <param name="year">Initial value of the Year property.</param>
 /// <param name="provinceId">Initial value of the ProvinceId property.</param>
 /// <param name="batch">Initial value of the Batch property.</param>
 /// <param name="planCategory">Initial value of the PlanCategory property.</param>
 /// <param name="universityId">Initial value of the UniversityId property.</param>
 /// <param name="specialityId">Initial value of the SpecialityId property.</param>
 /// <param name="courseType">Initial value of the CourseType property.</param>
 /// <param name="studyYears">Initial value of the StudyYears property.</param>
 public static UniversityEnrollPlan CreateUniversityEnrollPlan(global::System.Int32 id, global::System.Int32 plannedNumber, global::System.Int32 year, global::System.Guid provinceId, global::System.String batch, global::System.String planCategory, global::System.Guid universityId, global::System.Guid specialityId, global::System.String courseType, global::System.Int32 studyYears)
 {
     UniversityEnrollPlan universityEnrollPlan = new UniversityEnrollPlan();
     universityEnrollPlan.Id = id;
     universityEnrollPlan.PlannedNumber = plannedNumber;
     universityEnrollPlan.Year = year;
     universityEnrollPlan.ProvinceId = provinceId;
     universityEnrollPlan.Batch = batch;
     universityEnrollPlan.PlanCategory = planCategory;
     universityEnrollPlan.UniversityId = universityId;
     universityEnrollPlan.SpecialityId = specialityId;
     universityEnrollPlan.CourseType = courseType;
     universityEnrollPlan.StudyYears = studyYears;
     return universityEnrollPlan;
 }