Beispiel #1
0
        private void importTask(ArchiveTask archTask)
        {
            models.Task task = new models.Task(archTask);
            task.save();
            List <Entity> temps = new List <Entity>();

            foreach (ArchiveTemplate archTemp in archTask.Templates)
            {
                TaskTemplate temp = new TaskTemplate(archTemp);
                temp.TaskID = task.ID;
                temps.Add(temp);
            }
            DatabaseManager.SharedManager.insertMultipleEntities(temps);
            foreach (ArchiveTemplate archTemp in archTask.Templates)
            {
                archTemp.ID = temps[archTask.Templates.IndexOf(archTemp)].ID;
                importSelectionsAndParameters(archTemp);
            }
            List <Entity> solvers = new List <Entity>();

            foreach (ArchiveTaskSolver archSolv in archTask.Solvers)
            {
                TaskSolver solv = new TaskSolver(archSolv);
                solv.TaskID = task.ID;
                solvers.Add(solv);
            }
            DatabaseManager.SharedManager.insertMultipleEntities(solvers);
            foreach (ArchiveTaskSolver archSolv in archTask.Solvers)
            {
                archSolv.ID = solvers[archTask.Solvers.IndexOf(archSolv)].ID;
            }
        }
Beispiel #2
0
 public void CreateTask()
 {
     if (this.taskName == "")
     {
         return;
     }
     models.Task newTask = new models.Task();
     newTask.Name = this.taskName;
     newTask.save();
     taskCreate.Invoke(true);
     OnClose?.Invoke(this, null);
 }