private void updateTaskWorker_Click(object sender, RoutedEventArgs e) { TasksList path = todoListWorker.SelectedItem as TasksList; UpdateWindow uw = new UpdateWindow(path.id, priv, path.worker, path.name, path.difficulty, path.status, path.natureWork, path.timeLeft); uw.Show(); }
private void deleteTask_Click(object sender, RoutedEventArgs e) { TasksList tasks = todoList.SelectedItem as TasksList; cmd.Parameters["@id"].Value = tasks.id; sql = "delete from taskfor where id = @id"; cmd.CommandText = sql; int doThings = cmd.ExecuteNonQuery(); MessageBox.Show("Данные успешно удалены"); }
private void todoList_SelectionChanged(object sender, SelectionChangedEventArgs e) { TasksList tl = todoList.SelectedItem as TasksList; if (tl != null && (tl.status == "Выполнена" || tl.status == "Отменена")) { updateTask_Button.IsEnabled = false; } else { updateTask_Button.IsEnabled = true; } }