private void update_task_Click(object sender, RoutedEventArgs e) { task_class path = task_table.SelectedItem as task_class; UpdateTaskWin updateWin = new UpdateTaskWin(path.id, path.id_user, path.name, path.difficulty, path.status, path.natWork, path.timeWork); updateWin.Show(); }
private void delete_task_Click(object sender, RoutedEventArgs e) { task_class path = task_table.SelectedItem as task_class; com.Parameters["@id"].Value = path.id; sql = $"delete from task where Id = @id"; com.CommandText = sql; int doThing = com.ExecuteNonQuery(); MessageBox.Show("Данные успешно удалены"); }
private void task_table_SelectionChanged(object sender, SelectionChangedEventArgs e) { task_class tc = task_table.SelectedItem as task_class; if (tc != null && (tc.status == "Завершено" || tc.status == "Отменено")) { update_task.IsEnabled = false; } else { update_task.IsEnabled = true; } }