public void Reopen(ApplicationUser auditor, string comments) { if (!auditor.IsAdminUser) { throw new CourseAuditingException("Course can only be review by admin user."); } CourseAuditings.Add(CourseAuditing.Reopen(auditor.Administrator, comments)); _machine.Fire(CourseStateTriggerEnum.Reopen); }
public void Submit(ApplicationUser tutor) { // 1. validate course update CourseUpdateValidate(tutor); // 2. Add course auditing CourseAuditings.Add(CourseAuditing.Submit()); // 3. update state _machine.Fire(CourseStateTriggerEnum.Submit); }
public void Release(ApplicationUser user) { if (!IsReady) { throw new CourseValidateException("Course is not ready to released, please submit to review"); } if (!IsTutor(user) && !user.IsAdminUser) { throw new CourseValidateException("use is not allow to Release the course"); } CourseAuditings.Add(CourseAuditing.Release("released by " + user.FullName)); _machine.Fire(CourseStateTriggerEnum.Release); //AddDomainEvent(new CourseStateUpdateDomainEvent(null, TutorId, Id, CourseStateTriggerEnum.Reject, "Course Released.")); }