public void ComplateJobBatch(JJobType jobType, RunningJobStageEnum stage = RunningJobStageEnum.complated) { try { jobType.JobBatchLog.Info("JobBatch complate with result: " + stage); jobType.JobBatchStage = stage.ToString(); if (jobType.JobBatchProgress == 0) { jobType.JobBatchProgress = 100; } Dm.Instance.SaveObject(jobType); //save log to file jobType.JobBatchLog.SaveLogToFile(); } catch (Exception ex) { Log.LogError("Error complating job: " + jobType.JJobTypeId, ex); } }
public void ComplateJob(JRunningJob job, RunningJobStageEnum stage = RunningJobStageEnum.complated) { try { job.JobLog.Info("Job complate with result: " + stage); job.Stage = stage.ToString(); if (job.Progress == 0) { job.Progress = 100; } Dm.Instance.SaveObject(job); //save log to file job.JobLog.SaveLogToFile(); if (job.JJobType != null) { job.JJobType.LastStage = job.Stage; Dm.Instance.SaveObject(job.JJobType); } } catch (Exception ex) { Log.LogError("Error complating job: " + job.JRunningJobId, ex); } }