Пример #1
0
        public bool AddApplication(UserApplication application)
        {
            DepartmentRepository departmentRepository = new DepartmentRepository();
            CollegeDepartment    collegeDepartment    = departmentRepository.CheckExistsDepartment(application.DeptID, application.CollegeCode);

            if (collegeDepartment.AvailableSeats > 0)
            {
                collegeDepartment.AvailableSeats = collegeDepartment.AvailableSeats - 1;
                departmentRepository.EditDepartment(collegeDepartment);
                applicationRepository.AddApplication(application);
                return(true);
            }
            return(false);
        }