BasicDataJob.cs 3.09 KB
using System;
using Quartz;
using Task = System.Threading.Tasks.Task;

namespace WebMvc
{
    [PersistJobDataAfterExecution]
    [DisallowConcurrentExecution]
    public class GetCurrentStockJob : IJob
    {
        public virtual Task Execute(IJobExecutionContext context)
        {
            JobContainer jobContainer = new JobContainer(context);
            try
            {
                #region 执行任务语句
                GetCurrentStockAction getCurrentStockAction = new GetCurrentStockAction(jobContainer.ConnString, context);
                getCurrentStockAction.Execute(jobContainer);
                #endregion
            }
            catch (Exception ex)
            {
                jobContainer.ExceptionInfo = ex.Message;
            }

            jobContainer.LoggerJob();

            return Task.CompletedTask;
        }
    }

    [PersistJobDataAfterExecution]
    [DisallowConcurrentExecution]
    public class GetICSCustomerJob : IJob
    {
        public virtual Task Execute(IJobExecutionContext context)
        {
            JobContainer jobContainer = new JobContainer(context);
            try
            {
                #region 执行任务语句
                GetICSCustomerAction getICSCustomerAction = new GetICSCustomerAction(jobContainer.ConnString, context);
                getICSCustomerAction.Execute(jobContainer);
                #endregion
            }
            catch (Exception ex)
            {
                jobContainer.ExceptionInfo = ex.Message;
            }

            jobContainer.LoggerJob();

            return Task.CompletedTask;
        }
    }

    [PersistJobDataAfterExecution]
    [DisallowConcurrentExecution]
    public class GetICSInventoryJob : IJob
    {
        public virtual Task Execute(IJobExecutionContext context)
        {
            JobContainer jobContainer = new JobContainer(context);
            try
            {
                #region 执行任务语句
                GetICSInventoryAction getICSInventoryAction = new GetICSInventoryAction(jobContainer.ConnString, context);
                getICSInventoryAction.Execute(jobContainer);
                #endregion
            }
            catch (Exception ex)
            {
                jobContainer.ExceptionInfo = ex.Message;
            }

            jobContainer.LoggerJob();

            return Task.CompletedTask;
        }
    }

    [PersistJobDataAfterExecution]
    [DisallowConcurrentExecution]
    public class GetICSVendorJob : IJob
    {
        public virtual Task Execute(IJobExecutionContext context)
        {
            JobContainer jobContainer = new JobContainer(context);
            try
            {
                #region 执行任务语句
                GetICSVendorAction getICSVendorAction = new GetICSVendorAction(jobContainer.ConnString, context);
                getICSVendorAction.Execute(jobContainer);
                #endregion
            }
            catch (Exception ex)
            {
                jobContainer.ExceptionInfo = ex.Message;
            }

            jobContainer.LoggerJob();

            return Task.CompletedTask;
        }
    }
}