internal static Crime gtNewCrime(SqliteWorker sqlWorker, Crime _c = null) { AddCrime wndCrime = new AddCrime(sqlWorker, _c); wndCrime.ShowDialog(); return(wndCrime.c); }
private void crimesDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (crimesDataGrid.SelectedItem != null) { Crime newC = AddCrime.gtNewCrime(sqlWorker, crimesDataGrid.SelectedItem as Crime); for (int i = 0; i < crimes.Count; i++) { if (newC.Id == crimes[i].Id) { crimes[i] = newC; } } crimes = DataWorker.getCrimes( sqlWorker, dpLeft.Text == "" ? "" : dpLeft.SelectedDate.Value.ToString("yyyy.MM.dd"), dpRight.Text == "" ? "9999.99.99" : dpRight.SelectedDate.Value.ToString("yyyy.MM.dd")); coll.Source = crimes; coll.Filter += coll_Filter; crimesDataGrid.ItemsSource = coll.View; coll.View.GroupDescriptions.Clear(); if (chkGroupMU.IsChecked.Value) { coll.View.GroupDescriptions.Add(new PropertyGroupDescription("MilitaryUnit")); } if (cbGroupOn.SelectedIndex == 1) { coll.View.GroupDescriptions.Add(new PropertyGroupDescription("Accomplice")); } if (cbGroupOn.SelectedIndex == 2) { coll.View.GroupDescriptions.Add(new PropertyGroupDescription("Clause")); } coll.View.Refresh(); } }
private void btnAddCrimeOrIncidents_Click_1(object sender, RoutedEventArgs e) { Crime c = AddCrime.gtNewCrime(sqlWorker); if (c != null) { crimes.Add(c); } }