public void Execute(int id) { JobItem jobItem = new JobItem(); jobItem.StartDate = DateTime.UtcNow; jobItem.JobId = id; jobItem.TaskName = Name; try { var taskresult = this.PreviousTaskResult.TaskData; _searvice.InsertPipeLineOrder(); _taskResult = new dlxTaskResult() { IsSuccess = true, TaskData = taskresult }; jobItem.Status = true; jobItem.Description = "Process Pipe Line Order Successful"; jobItem.EndDate = DateTime.UtcNow; _searvice.JobItemLog(jobItem); } catch (Exception ex) { Console.WriteLine(ex.Message); _taskResult = new dlxTaskResult() { IsSuccess = false, ErrorMessage = "Process Pipe Line Order Task Failed" }; jobItem.Status = false; jobItem.Description = string.Format("Error: {0} Inner Exception: {1} Error Message: {2}", _taskResult.ErrorMessage, ex.InnerException == null ? "" : ex.InnerException.ToString(), ex.Message); jobItem.EndDate = DateTime.UtcNow; _searvice.JobItemLog(jobItem); } }