public static void DeleteTask(int id) { Dictionary <int, Task> ToDoList = TaskDBService.GetDataFromDB(); if (ToDoList.ContainsKey(id)) { TaskDBService.DeleteData(id); } }
public static void ChangeTaskCondition(int id, bool doneCondition) { Dictionary <int, Task> ToDoList = TaskDBService.GetDataFromDB(); if (ToDoList.ContainsKey(id)) { TaskDBService.UpdateData(id, doneCondition); } }
public static void ChangeTaskName(int id, string name) { Dictionary <int, Task> ToDoList = TaskDBService.GetDataFromDB(); if (ToDoList.ContainsKey(id)) { if (name != "" && name != null) { TaskDBService.UpdateDataName(id, name); } } }
public static string GetTaskListJson() { return(JsonSerializer.Serialize(TaskDBService.GetDataFromDB().Select(d => d.Value), getJsonSerializerOptions())); }