public void Time(TimeBadgeViewModel timeBadgeViewModel) { using (var unitOfwork = UnitOfWorkManager.NewUnitOfWork()) { try { var user = MemberService.Get(timeBadgeViewModel.Id); var databaseUpdateNeeded = BadgeService.ProcessBadge(BadgeType.Time, user, MemberPointsService, ActivityService); if (databaseUpdateNeeded) { unitOfwork.Commit(); } } catch (Exception ex) { unitOfwork.Rollback(); LogError(ex); } } }
public void Time(TimeBadgeViewModel timeBadgeViewModel) { using (var unitOfwork = UnitOfWorkManager.NewUnitOfWork()) { try { var user = MembershipService.GetUser(timeBadgeViewModel.Id); var databaseUpdateNeeded = _badgeService.ProcessBadge(BadgeType.Time, user); if (databaseUpdateNeeded) { unitOfwork.Commit(); } } catch (Exception ex) { unitOfwork.Rollback(); LoggingService.Error(ex); } } }