Exemple #1
0
 public WorkerBase(LogWriter logger,
                   ILogin login,
                   TaskSchedule task,
                   ApplicationControl appControl = null,
                   DataExpression expression     = null)
 {
     this.logger = logger;
     Login       = login;
     Setting     = task;
     if (appControl != null)
     {
         AppControl = appControl;
     }
     if (expression != null)
     {
         DataExpression = expression;
     }
     History = new TaskScheduleHistory
     {
         CompanyId     = login.CompanyId,
         ImportType    = task.ImportType,
         ImportSubType = task.ImportSubType,
         StartAt       = DateTime.Now /* get DB Server timestamp */
     };
 }
 public async Task <TaskScheduleHistoryResult> SaveAsync(string SessionKey, TaskScheduleHistory history)
 {
     return(await authorizationProcess.DoAuthorizeAsync(SessionKey, async token =>
     {
         var result = await taskScheduleHistoryProcessor.SaveAsync(history, token);
         return new TaskScheduleHistoryResult
         {
             ProcessResult = new ProcessResult {
                 Result = true
             },
             TaskScheduleHistoryList = new List <TaskScheduleHistory> {
                 result
             },
         };
     }, logger));
 }
Exemple #3
0
        public Task <TaskScheduleHistory> AddAsync(TaskScheduleHistory history, CancellationToken token = default(CancellationToken))
        {
            var query = @"
INSERT INTO [dbo].[TaskScheduleHistory]
     ( [CompanyId]
     , [ImportType]
     , [ImportSubType]
     , [StartAt]
     , [EndAt]
     , [Result]
     , [Errors])
OUTPUT inserted.*
VALUES (@CompanyId
     ,  @ImportType
     ,  @ImportSubType
     ,  @StartAt
     ,  @EndAt
     ,  @Result
     ,  @Errors)
";

            return(dbHelper.ExecuteAsync <TaskScheduleHistory>(query, history, token));
        }
Exemple #4
0
 public ViewData(TaskScheduleHistory taskScheduleModel, PH0501.DisplayValueDictionaries dispValue)
 {
     Model = taskScheduleModel;
     DisplayValueDictionaries = dispValue;
 }
Exemple #5
0
 public static TaskScheduleHistoryResult SaveTaskScheduleHistory(ILogin login, TaskScheduleHistory history)
 => ServiceProxyFactory.Do((TaskScheduleHistoryService.TaskScheduleHistoryServiceClient client) =>
 {
     var result = client.Save(login.SessionKey, history);
     return(result);
 });
Exemple #6
0
 public async Task <TaskScheduleHistory> SaveAsync(TaskScheduleHistory history, CancellationToken token = default(CancellationToken))
 => await addTaskScheduleHistoryQueryProcessor.AddAsync(history, token);
Exemple #7
0
 public async Task <TaskScheduleHistory> Save(TaskScheduleHistory history, CancellationToken token)
 => await taskScheduleHistoryProcessor.SaveAsync(history, token);