public void InActivateIntakeCourse(IntakeCourse entity)
        {
            var studentIntake = _studentIntakeService.GetAll().FirstOrDefault(x => x.IntakeID == entity.IntakeID && x.IsStudentIntakeActive == true);

            if (studentIntake != null)
            {
                throw new DataUsedException("This Intake is being used by some students.");
            }
            entity.IsIntakeCourseActive = false;
            _intakeCourseDal.Update(entity);
        }
        public IntakeCourse Insert(IntakeCourse entity)
        {
            ValidatorTool.FluentValidate(new IntakeCourseValidator(), entity);
            var intakeCourse = _intakeCourseDal.Get(x => (x.IntakeID == entity.IntakeID) || (x.IntakeID == entity.IntakeID && x.CourseID == entity.CourseID) && x.IsIntakeCourseActive == true);

            if (intakeCourse != null)
            {
                throw new DataExistException("Intake Course Already Exists!");
            }
            return(_intakeCourseDal.Insert(entity));
        }
Exemplo n.º 3
0
        private void DeleteIntakeCourse()
        {
            int          intakeCourseID = Convert.ToInt32(grdListIntakeCourses.CurrentRow.Cells["IntakeCourseID"].Value);
            string       intakeID       = grdListIntakeCourses.CurrentRow.Cells["Intake"].Value.ToString();
            int          courseID       = Convert.ToInt32(grdListIntakeCourses.CurrentRow.Cells["CourseID"].Value);
            IntakeCourse intakeCourse   = new IntakeCourse {
                IntakeCourseID = intakeCourseID, IntakeID = intakeID, CourseID = courseID
            };

            _intakeCourseService.InActivateIntakeCourse(intakeCourse);
            _intakeService.InactivateIntake(new Intake {
                IntakeID = intakeID
            });
            PopulateListIntakeCourse();
        }
 public IntakeCourse Update(IntakeCourse entity)
 {
     throw new NotImplementedException();
 }