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();
        }
示例#2
0
        public override void Execute()
        {
            LoadProcess = new LoadProcess();
            var sql = new SqlTask(this, Sql)
            {
                DisableLogging   = true,
                DisableExtension = true,
                Actions          = new List <Action <object> >()
                {
                    col => LoadProcess.LoadProcessKey        = (int)col,
                    col => LoadProcess.StartDate             = (DateTime)col,
                    col => LoadProcess.TransferCompletedDate = (DateTime?)col,
                    col => LoadProcess.EndDate             = (DateTime?)col,
                    col => LoadProcess.ProcessName         = (string)col,
                    col => LoadProcess.StartMessage        = (string)col,
                    col => LoadProcess.IsRunning           = (bool)col,
                    col => LoadProcess.EndMessage          = (string)col,
                    col => LoadProcess.WasSuccessful       = (bool)col,
                    col => LoadProcess.AbortMessage        = (string)col,
                    col => LoadProcess.WasAborted          = (bool)col,
                    col => LoadProcess.IsFinished          = (bool)col,
                    col => LoadProcess.IsTransferCompleted = (bool)col
                }
            };

            if (ReadOption == ReadOptions.ReadAllProcesses)
            {
                sql.BeforeRowReadAction = () => AllLoadProcesses = new List <LoadProcess>();
                sql.AfterRowReadAction  = () => AllLoadProcesses.Add(LoadProcess);
            }
            sql.ExecuteReader();
        }
示例#3
0
        public override void Execute()
        {
            LoadProcess = new LoadProcess();
            var sql = new SqlTask(this, Sql)
            {
                DisableLogging   = true,
                DisableExtension = true,
                Actions          = new List <Action <object> >()
                {
                    result => {
                        LoadProcess.LoadProcessKey        = (int)DbTask.GetValueFromReader(result, "LoadProcessKey");
                        LoadProcess.StartDate             = (DateTime)DbTask.GetValueFromReader(result, "StartDate");
                        LoadProcess.TransferCompletedDate = (DateTime?)DbTask.GetValueFromReader(result, "TransferCompletedDate");
                        LoadProcess.EndDate             = (DateTime?)DbTask.GetValueFromReader(result, "EndDate");
                        LoadProcess.ProcessName         = (string)DbTask.GetValueFromReader(result, "ProcessName");
                        LoadProcess.StartMessage        = (string)DbTask.GetValueFromReader(result, "StartMessage");
                        LoadProcess.IsRunning           = (bool)DbTask.GetValueFromReader(result, "IsRunning");
                        LoadProcess.EndMessage          = (string)DbTask.GetValueFromReader(result, "EndMessage");
                        LoadProcess.WasSuccessful       = (bool)DbTask.GetValueFromReader(result, "WasSuccessful");
                        LoadProcess.AbortMessage        = (string)DbTask.GetValueFromReader(result, "AbortMessage");
                        LoadProcess.WasAborted          = (bool)DbTask.GetValueFromReader(result, "WasAborted");
                        LoadProcess.IsFinished          = (bool)DbTask.GetValueFromReader(result, "IsFinished");
                        LoadProcess.IsTransferCompleted = (bool)DbTask.GetValueFromReader(result, "IsTransferCompleted");
                    }
                }
            };

            if (ReadOption == ReadOptions.ReadAllProcesses)
            {
                sql.BeforeRowReadAction = () => AllLoadProcesses = new List <LoadProcess>();
                sql.AfterRowReadAction  = () => AllLoadProcesses.Add(LoadProcess);
            }
            sql.ExecuteReader();
        }