// private void btnDetails_Click(object sender, RoutedEventArgs e) { try { if (dgBatchBreakdown.SelectedIndex < 0 || dgBatchBreakdown.SelectedItem == null) { return; } btnDetails.IsEnabled = false; BatchHistoryListView dr = (BatchHistoryListView)dgBatchBreakdown.SelectedItem; int CollectionNo = Convert.ToInt32(dr.CollectionKey.Split('#')[0]); int installationNo = Convert.ToInt32(dr.CollectionKey.Split('#')[1]); string zone = dr.Zone ?? ""; if (CollectionNo > 0 && installationNo > 0 && zone.ToUpper() != "UNDECLARED") { var History = new Views.BatchHistoryBreakdown(CollectionNo, installationNo, ExchangeConst, (List <Transport.AllEvents>)dgEvents.ItemsSource, _batch.GetCollectionData(CollectionNo)); History.Owner = GetWindow(this); History.ShowDialogEx(this); } } catch (Exception ex) { LogError("btnDetails_Click", ex); } finally { btnDetails.IsEnabled = true; } }
// private void btnDetails_Click(object sender, RoutedEventArgs e) { try { if (dgBatchBreakdown.SelectedIndex < 0 || dgBatchBreakdown.SelectedItem == null) return; btnDetails.IsEnabled = false; BatchHistoryListView dr = (BatchHistoryListView)dgBatchBreakdown.SelectedItem; int CollectionNo = Convert.ToInt32(dr.CollectionKey.Split('#')[0]); int installationNo = Convert.ToInt32(dr.CollectionKey.Split('#')[1]); string zone = dr.Zone ?? ""; if (CollectionNo > 0 && installationNo > 0 && zone.ToUpper() != "UNDECLARED") { var History = new Views.BatchHistoryBreakdown(CollectionNo, installationNo, ExchangeConst, (List<Transport.AllEvents>)dgEvents.ItemsSource, _batch.GetCollectionData(CollectionNo)); History.Owner = GetWindow(this); History.ShowDialogEx(this); } } catch (Exception ex) { LogError("btnDetails_Click", ex); } finally { btnDetails.IsEnabled = true; } }