public bool StartWorkPeriod(string description) { using (var w = WorkspaceFactory.Create()) { using (var tran = w.BeginTransaction()) { try { _workPeriodDao.StartWorkPeriod(description, w); foreach (var workPeriodProcessor in WorkPeriodProcessors) { workPeriodProcessor.ProcessWorkPeriodStart(CurrentWorkPeriod); } if (tran != null) { tran.Commit(); } } catch (Exception e) { if (tran != null) { tran.Rollback(); } _logService.LogError(e); return(false); } } } _applicationStateSetter.ResetWorkPeriods(); return(true); }
public void StartWorkPeriod(string description) { _applicationStateSetter.ResetWorkPeriods(); _workPeriodDao.StartWorkPeriod(description); _applicationStateSetter.ResetWorkPeriods(); }