public async Task Save(AddStudyAbroadViewModel model, int userId, string remoteIp) { using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) { await StudyAbroadRepository.Save(model); await EventLogService.AddStudentEvent(userId, model.StudentId, EventLogTypes.AddStudentExperience, remoteIp); } }
public async Task InsertStudent(StudentModel model, UserModel user, string remoteIp) { using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) { int studentId = await StudentRepository.InsertStudent(model); model.Id = studentId; await StudentPromoRepository.Save(model.Id, model.PromoIds); await EventLogService.AddStudentEvent(user.Id, studentId, EventLogTypes.AddStudent, remoteIp); scope.Complete(); } }
public async Task InsertNote(int userId, AddStudentNoteViewModel model, string remoteIp) { using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) { await StudentNoteRepository.InsertNote(userId, model); await EventLogService.AddStudentEvent(userId, model.StudentId, EventLogTypes.AddStudentNote, remoteIp); scope.Complete(); } }