public void WriteMessage(string?status) { if (status != CurrentProcess.Status) { CurrentProcess.Status = status; CurrentProcess.InDB() .UnsafeUpdate() .Set(a => a.Status, a => status) .Execute(); } }
public void ProgressChanged(decimal progress, string status = null) { if (progress != CurrentProcess.Progress || status != CurrentProcess.Status) { CurrentProcess.Progress = progress; CurrentProcess.Status = status; CurrentProcess.InDB() .UnsafeUpdate() .Set(a => a.Progress, a => progress) .Set(a => a.Status, a => status) .Execute(); } }
public void ProgressChanged(decimal progress, string?status = null) { if (progress != CurrentProcess.Progress || status != CurrentProcess.Status) { CurrentProcess.Progress = progress; CurrentProcess.Status = status; var ic = CurrentProcess.FullIntegrityCheck(); if (ic != null) { throw new IntegrityCheckException(ic); } CurrentProcess.InDB() .UnsafeUpdate() .Set(a => a.Progress, a => progress) .Set(a => a.Status, a => status) .Execute(); } }
public void TakeForThisMachine() { CurrentProcess.State = ProcessState.Executing; CurrentProcess.ExecutionStart = TimeZoneManager.Now; CurrentProcess.ExecutionEnd = null; CurrentProcess.Progress = 0; CurrentProcess.MachineName = Environment.MachineName; CurrentProcess.ApplicationName = Schema.Current.ApplicationName; using (Transaction tr = new Transaction()) { if (CurrentProcess.InDB().Any(a => a.State == ProcessState.Executing)) { throw new InvalidOperationException("The process {0} is allready Executing!".FormatWith(CurrentProcess.Id)); } using (OperationLogic.AllowSave <ProcessEntity>()) CurrentProcess.Save(); tr.Commit(); } }