예제 #1
0
        public static bool BeginTask(int userID, StepByStepTaskBase taskAction, string param)
        {
            Type taskType = taskAction.GetType();

            Guid taskID = Guid.NewGuid();

            RunningTask task = new RunningTask(taskAction);

            int totalCount = 0;
            long offset = 0;
            string title;
            if (task.Task.BeforeExecute(userID, param, ref offset, ref totalCount, out title) == false)
                return false;


            int result = StepByStepTaskDao.Instance.BeginTask(taskID, taskType, userID, param, totalCount, offset, title, taskAction.InstanceMode);

            switch (result)
            {
                case 0:
                    return true;

                case 1:
                case 2:
                    return false;
            
                default:
                    return false;
            }
        }
예제 #2
0
        public static bool BeginTask(int userID, StepByStepTaskBase taskAction, string param)
        {
            Type taskType = taskAction.GetType();

            Guid taskID = Guid.NewGuid();

            RunningTask task = new RunningTask(taskAction);

            int    totalCount = 0;
            long   offset     = 0;
            string title;

            if (task.Task.BeforeExecute(userID, param, ref offset, ref totalCount, out title) == false)
            {
                return(false);
            }


            int result = StepByStepTaskDao.Instance.BeginTask(taskID, taskType, userID, param, totalCount, offset, title, taskAction.InstanceMode);

            switch (result)
            {
            case 0:
                return(true);

            case 1:
            case 2:
                return(false);

            default:
                return(false);
            }
        }
예제 #3
0
 public RunningTask(StepByStepTaskBase taskAction)
 {
     m_Task = taskAction;
 }