private void ButtonBase_OnClick(object sender, RoutedEventArgs e) { if (OperationBox.Text != "" || BeforeOperationBox.Text != "" || TimeBox.Text != "") { item = new InputTable(OperationBox.Text, BeforeOperationBox.Text, int.Parse(TimeBox.Text)); Close(); } else { MessageBox.Show("Error!"); Close(); } }
private void ButtonDelete_OnClick(object sender, RoutedEventArgs e) { if (grid.SelectedIndex >= 0) { InputTable customer = grid.SelectedItem as InputTable; result.Remove(customer); SetGrid(); CreateGraph(); } else { MessageBox.Show("Choose item from grid"); } }
private void ButtonChange_OnClick(object sender, RoutedEventArgs e) { if (grid.SelectedItem != null) { InputTable item = grid.SelectedItem as InputTable; var index = result.IndexOf(item); result.Remove(item); result.Insert(index, item); CreateGraph(); } else { MessageBox.Show("Choose item from grid"); } }