S
S
stcmd042362016-08-02 22:31:38
MySQL
stcmd04236, 2016-08-02 22:31:38

How to organize the database structure for the task scheduler?

Hello! I've been scratching my head for a week now. How to organize the database structure for the task scheduler? I want to make it exactly like the Windows Task Scheduler.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mletov, 2016-08-02
@mletov

Write your vision, and you will be pointed out to the shortcomings. And they are unlikely to strain and solve the problem from scratch for you

S
stcmd04236, 2016-08-02
@stcmd04236

And so he created the following. As long as it suits me. The task was to create a task scheduler to track the route of the transport, which allows the user to configure the tracking parameters.

public class Task
  {
    public Guid Id { get; set; }

    public string Name { get; set; }

    public List<TaskTrigger> Triggers { get; set; }

    public List<TaskAction> Actions { get; set; }

    public TaskCondition Condition { get; set; }

    public string Description { get; set; }
  }

public class TaskTrigger 
  {
    public Guid Id { get; set; }

    public int Repeat { get; set; }

    public DateTime Start { get; set; }

    public DateTime End { get; set; }
  }
public class TaskTriggerEvent : TaskTrigger
  {
    public TaskTriggerEventItem Event { get; set; }

    public Transport Transport { get; set; }
  }
public class TaskTriggerEventItem
  {
    public Guid Id { get; set; }

    public string Name { get; set; }

    public string Description { get; set; }
  }
public class TaskTriggerShedule : TaskTrigger
  {
    public int StartupType { get; set; }
  }

public class TaskAction
  {
    public Guid Id { get; set; }
  }
public class TaskActionSendEmail : TaskAction
  {
    public string Email { get; set; }

    public string Title { get; set; }

    public string Content { get; set; }
  }
public class TaskActionSendSMS
  {
    public string Phone { get; set; }

    public string Content { get; set; }
  }
public class TaskCondition
  {
    public Guid Id { get; set; }

    public bool CheckDeviation { get; set; }

    public int Deviation { get; set; }

    public bool CheckStartCoordinate { get; set; }

    public bool CheckEndCoordinate { get; set; }

    public DbGeography StarCoordinate { get; set; }

    public DbGeography EndCoordinate { get; set; }

    public bool CheckSpeed { get; set; }

    public double Speed { get; set; }
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question