Ejemplo n.º 1
0
        public static string CreateTask(Task_Main task)
        {
            TaskDataProcessor processor = new TaskDataProcessor();

            processor.Task = task;
            return((string)SqliteHelper.MainDbHelper.RunTransaction(new SqliteHelper.RunTransactionDelegate(processor.InsertTaskToDBTransaction)));
        }
Ejemplo n.º 2
0
        public static bool DeleteTask(string taskId)
        {
            TaskDataProcessor processor = new TaskDataProcessor();

            processor.Task    = new Task_Main();
            processor.Task.Id = taskId;
            return((bool)SqliteHelper.MainDbHelper.RunTransaction(processor.DeleteTaskTransaction));
        }
Ejemplo n.º 3
0
        public static bool ChangeTaskLevel(string taskId, int newLevel)
        {
            TaskDataProcessor processor = new TaskDataProcessor();

            processor.Task       = new Task_Main();
            processor.Task.Id    = taskId;
            processor.Task.Level = newLevel;
            return((bool)SqliteHelper.MainDbHelper.RunTransaction(processor.ChangeTaskLevelTransaction));
        }
Ejemplo n.º 4
0
        public static void UpdateDataAfterEndStep(string stepId, string taskId, bool succeed, string message)
        {
            TaskDataProcessor processor = new TaskDataProcessor();

            processor.Step            = new Task_Step();
            processor.Step.Id         = stepId;
            processor.Step.TaskId     = taskId;
            processor.Step.StatusType = succeed ? TaskStatusType.Succeed : TaskStatusType.Error;
            processor.Step.Message    = message;
        }
Ejemplo n.º 5
0
        public static void UpdateDataAfterBeginStep(string stepId, string taskId)
        {
            TaskDataProcessor processor = new TaskDataProcessor();

            processor.Step            = new Task_Step();
            processor.Step.Id         = stepId;
            processor.Step.TaskId     = taskId;
            processor.Step.StatusType = TaskStatusType.Running;
            SqliteHelper.MainDbHelper.RunTransaction(processor.UpdateDataAfterBeginStep);
        }
Ejemplo n.º 6
0
        public static List <Task_Step> GetWaitingStepsInWaitingTasks(int count)
        {
            TaskDataProcessor processor = new TaskDataProcessor();

            return(processor.GetWaitingStepsInTasks(count, TaskStatusType.Waiting));
        }