public void Execute() { LoadProcess = new LoadProcess(); var sql = new SqlTask(this, Sql) { DisableLogging = true, Actions = new List <Action <object> >() { col => LoadProcess.Id = Convert.ToInt64(col), col => LoadProcess.StartDate = (DateTime)col, col => LoadProcess.EndDate = (DateTime?)col, col => LoadProcess.Source = (string)col, col => LoadProcess.ProcessName = (string)col, col => LoadProcess.StartMessage = (string)col, col => LoadProcess.IsRunning = Convert.ToInt16(col) > 0 ? true : false, col => LoadProcess.EndMessage = (string)col, col => LoadProcess.WasSuccessful = Convert.ToInt16(col) > 0 ? true : false, col => LoadProcess.AbortMessage = (string)col, col => LoadProcess.WasAborted = Convert.ToInt16(col) > 0 ? true : false, } }; if (ReadOption == ReadOptions.ReadAllProcesses) { sql.BeforeRowReadAction = () => AllLoadProcesses = new List <LoadProcess>(); sql.AfterRowReadAction = () => AllLoadProcesses.Add(LoadProcess); } sql.ExecuteReader(); }
List <LoadProcess> ReadProcessInternal(long processId = 0, ReadOptions readOption = ReadOptions.ReadSingleProcess) { var allLoadProcesses = new List <LoadProcess>(); var loadProcess = new LoadProcess(); var sql = new SqlTask(this, Sql_Read(processId, readOption)) { DisableLogging = true, Actions = new List <Action <object> >() { col => loadProcess.Id = Convert.ToInt64(col), col => loadProcess.StartDate = (DateTime)col, col => loadProcess.EndDate = (DateTime?)col, col => loadProcess.Source = (string)col, col => { if (col == null) { loadProcess.SourceId = null; } else { loadProcess.SourceId = Convert.ToInt64(col); } }, col => loadProcess.ProcessName = (string)col, col => loadProcess.StartMessage = (string)col, col => loadProcess.IsRunning = Convert.ToInt16(col) > 0 ? true : false, col => loadProcess.EndMessage = (string)col, col => loadProcess.WasSuccessful = Convert.ToInt16(col) > 0 ? true : false, col => loadProcess.AbortMessage = (string)col, col => loadProcess.WasAborted = Convert.ToInt16(col) > 0 ? true : false, } }; sql.BeforeRowReadAction = () => loadProcess = new LoadProcess(); sql.AfterRowReadAction = () => allLoadProcesses.Add(loadProcess); sql.ExecuteReader(); return(allLoadProcesses); }
public static LoadProcess End(IConnectionManager connectionManager, LoadProcess process, string endMessage) => new LoadProcessTask() { ConnectionManager = connectionManager, Process = process }.EndProcess(endMessage);
public static LoadProcess End(IConnectionManager connectionManager, LoadProcess process) => new LoadProcessTask() { ConnectionManager = connectionManager, Process = process }.EndProcess();
public static LoadProcess End(LoadProcess process, string endMessage) => new LoadProcessTask() { Process = process }.EndProcess(endMessage);
public static LoadProcess End(LoadProcess process) => new LoadProcessTask() { Process = process }.EndProcess();
public static LoadProcess Abort(IConnectionManager connectionManager, LoadProcess process, string abortMessage) => new LoadProcessTask() { ConnectionManager = connectionManager, Process = process }.AbortProcess(abortMessage);
public static LoadProcess Abort(LoadProcess process, string abortMessage) => new LoadProcessTask() { Process = process }.AbortProcess(abortMessage);
public static LoadProcess Abort(LoadProcess process) => new LoadProcessTask() { Process = process }.AbortProcess();