public NewTask(CurrentTasks currentTasks) { task = new ProductionTask(); Create = new DelegateCommand(() => { task.CreationDate = DateTime.Now; task.Status = "1"; currentTasks.InsertNewTask(task); TaskCreated?.Invoke(); }); }
public NewTask(CurrentTasks currentTasks, ProductionTask task) { this.task = task; Create = new DelegateCommand(() => { this.task.Status = "f"; this.task.CreationDate = DateTime.Now; this.task.FinishDate = DateTime.Now; currentTasks.InsertNewTask(this.task); TaskCreated?.Invoke(); }); }