public static void Olustur(Grid g) { g.Children.Clear(); g.ColumnDefinitions.Clear(); g.RowDefinitions.Clear(); Islemler.RowOlustur(g, 0.5, 1, 1, 1, 6, 1, 1); Islemler.ColumnOlustur(g, 1, 8, 1); SATSLabel lbl_konu = new SATSLabel(); lbl_konu.Content = "Konu:"; lbl_konu.HorizontalAlignment = HorizontalAlignment.Left; Grid.SetRow(lbl_konu, 1); Grid.SetColumn(lbl_konu, 1); SATSTextBox txt_konu = new SATSTextBox { Margin = new Thickness(10), Uid = "txt_konu" }; Grid.SetRow(txt_konu, 2); Grid.SetColumn(txt_konu, 1); SATSLabel lbl_mesaj = new SATSLabel(); lbl_mesaj.Content = "Mesaj:"; lbl_mesaj.HorizontalAlignment = HorizontalAlignment.Left; Grid.SetRow(lbl_mesaj, 3); Grid.SetColumn(lbl_mesaj, 1); SATSTextBox txt_mesaj = new SATSTextBox { Margin = new Thickness(10), TextWrapping = TextWrapping.Wrap, AcceptsReturn = true, Uid = "txt_mesaj" }; Grid.SetRow(txt_mesaj, 4); Grid.SetColumn(txt_mesaj, 1); SATSButton btn_gonder = new SATSButton { Content = "Gönder", Margin = new Thickness(10) }; Grid.SetRow(btn_gonder, 5); Grid.SetColumn(btn_gonder, 1); btn_gonder.Click += Btn_gonder_Click; g.Children.Add(lbl_konu); g.Children.Add(txt_konu); g.Children.Add(lbl_mesaj); g.Children.Add(txt_mesaj); g.Children.Add(btn_gonder); }
public static void Olustur(Grid g) { g.Children.Clear(); g.ColumnDefinitions.Clear(); g.RowDefinitions.Clear(); Islemler.RowOlustur(g, 1, 5, 1); Islemler.ColumnOlustur(g, 1, 8, 8, 1); SATSButton btn_bolge = new SATSButton { Content = "Bölgeye Göre İstatistikler", Margin = new Thickness(0, 0, 25, 0), BorderThickness = new Thickness(0) }; Grid.SetRow(btn_bolge, 1); Grid.SetColumn(btn_bolge, 1); SATSButton btn_suc = new SATSButton { Content = "Suça Göre İstatistikler", Margin = new Thickness(25, 0, 0, 0), BorderThickness = new Thickness(0) }; Grid.SetRow(btn_suc, 1); Grid.SetColumn(btn_suc, 2); btn_bolge.Click += Btn_bolge_Click; btn_suc.Click += Btn_suc_Click; g.Children.Add(btn_bolge); g.Children.Add(btn_suc); }
public static void Olustur(Grid g) { ItemCollection magdur_collection = null; ItemCollection supheli_collection = null; foreach (UIElement element in g.Children) { switch (element.Uid) { case "magdurEkle_lwListe": magdur_collection = ((SATSListView)element).Items; break; case "supheliEkle_lwListe": supheli_collection = ((SATSListView)element).Items; break; } } g.Children.Clear(); g.ColumnDefinitions.Clear(); g.RowDefinitions.Clear(); Islemler.RowOlustur(g, 0.25, 2, 2, 2, 2, 2, 2, 2, 1); Islemler.ColumnOlustur(g, 1, 2, 4, 2, 2, 2, 1); List <UIElement> a = (List <UIElement>)g.Tag; g.Tag = null; foreach (UIElement element in a) { g.Children.Add(element); if (element.Uid == "lw_magdur" && magdur_collection != null) { ((SATSListView)element).Items.Clear(); foreach (Magdur magdur in magdur_collection) { ((SATSListView)element).Items.Add(magdur); } } else if (element.Uid == "lw_supheli" && supheli_collection != null) { ((SATSListView)element).Items.Clear(); foreach (Supheli supheli in supheli_collection) { ((SATSListView)element).Items.Add(supheli); } } } }
public static void Olustur(Grid g, List <Olay> olaylar) { g.Children.Clear(); g.ColumnDefinitions.Clear(); g.RowDefinitions.Clear(); Islemler.RowOlustur(g, 0.5, 7, 1, 0.5); Islemler.ColumnOlustur(g, 0.5, 5, 1, 1, 0.5); DataGrid dg = new DataGrid { FontSize = Application.Current.MainWindow.FontSize, IsReadOnly = true, SelectionMode = DataGridSelectionMode.Single, Uid = "dg" }; Grid.SetRow(dg, 1); Grid.SetColumn(dg, 1); Grid.SetColumnSpan(dg, 3); DataGridTextColumn cl_il = new DataGridTextColumn { Header = "İl", Binding = new Binding("il") }; DataGridTextColumn cl_ilce = new DataGridTextColumn { Header = "İlçe", Binding = new Binding("ilce") }; DataGridTextColumn cl_mahalle = new DataGridTextColumn { Header = "Mahalle", Binding = new Binding("mahalle") }; DataGridTextColumn cl_polisMerkezi = new DataGridTextColumn { Header = "Polis Merkezi", Binding = new Binding("polisMerkezi") }; DataGridTextColumn cl_suc = new DataGridTextColumn { Header = "Suç", Binding = new Binding("suc") }; DataGridTextColumn cl_magdurSayisi = new DataGridTextColumn { Header = "Mağdur", Binding = new Binding("magdurSayisi") }; DataGridTextColumn cl_supheliSayisi = new DataGridTextColumn { Header = "Şüpheli", Binding = new Binding("supheliSayisi") }; DataGridTextColumn cl_tarih = new DataGridTextColumn { Header = "Tarih", Binding = new Binding("tarih") }; DataGridTextColumn cl_ID = new DataGridTextColumn { Binding = new Binding("ID"), Visibility = Visibility.Hidden }; dg.Columns.Add(cl_il); dg.Columns.Add(cl_ilce); dg.Columns.Add(cl_mahalle); dg.Columns.Add(cl_polisMerkezi); dg.Columns.Add(cl_suc); dg.Columns.Add(cl_magdurSayisi); dg.Columns.Add(cl_supheliSayisi); dg.Columns.Add(cl_tarih); dg.Columns.Add(cl_ID); SATSButton btn_duzenle = new SATSButton { Content = "Düzenle", Margin = new Thickness(0, 15, 10, 0) }; Grid.SetRow(btn_duzenle, 2); Grid.SetColumn(btn_duzenle, 2); SATSButton btn_sil = new SATSButton { Content = "Sil", Margin = new Thickness(10, 15, 0, 0) }; Grid.SetRow(btn_sil, 2); Grid.SetColumn(btn_sil, 3); foreach (Olay olay in olaylar) { try { using (var db = new Context()) { GosterilenOlaylar gosterilenOlaylar = new GosterilenOlaylar { ID = olay.ID, il = olay.mahalle.polisMerkezi.ilce.İl.adi, ilce = olay.mahalle.polisMerkezi.ilce.adi, polisMerkezi = olay.mahalle.polisMerkezi.adi, mahalle = olay.mahalle.adi, suc = olay.suc.adi, tarih = olay.tarih, magdurSayisi = (from ms in db.olaylar where ms.ID == olay.ID select ms.magdurlar).ToList()[0].Count(), supheliSayisi = (from ss in db.olaylar where ss.ID == olay.ID select ss.supheliler).ToList()[0].Count() }; dg.Items.Add(gosterilenOlaylar); } } catch (Exception ex) { MessageBoxResult result = MessageBox.Show(ex.Message); } } dg.Items.SortDescriptions.Add(new System.ComponentModel.SortDescription { PropertyName = "tarih", Direction = System.ComponentModel.ListSortDirection.Ascending }); dg.LoadingRow += Dg_LoadingRow; btn_sil.Click += Btn_sil_Click; btn_duzenle.Click += Btn_duzenle_Click; g.Children.Add(dg); g.Children.Add(btn_duzenle); g.Children.Add(btn_sil); }
public static void Olustur(Grid g) { List <UIElement> olayEkle = new List <UIElement>(); foreach (UIElement element in g.Children) { if (element.Uid == "lw_magdur") { magdurCollection = ((SATSListView)element).Items; } olayEkle.Add(element); } g.Tag = olayEkle; g.Children.Clear(); g.ColumnDefinitions.Clear(); g.RowDefinitions.Clear(); Islemler.ColumnOlustur(g, 0.1, 1, 1, 1, 0.1, 0.7); Islemler.RowOlustur(g, 0.5, 0.1, 0.4, 0.3, 0.3, 0.3, 0.3, 0.5, 0.5); SATSLabel lbl_TC = new SATSLabel(); lbl_TC.Content = "TC Kimlik No:"; Grid.SetRow(lbl_TC, 3); Grid.SetColumn(lbl_TC, 1); SATSLabel lbl_isim = new SATSLabel(); lbl_isim.Content = "İsim:"; Grid.SetRow(lbl_isim, 4); Grid.SetColumn(lbl_isim, 1); SATSLabel lbl_soyisim = new SATSLabel(); lbl_soyisim.Content = "Soyisim"; Grid.SetRow(lbl_soyisim, 5); Grid.SetColumn(lbl_soyisim, 1); SATSTextBox txt_TC = new SATSTextBox { TextAlignment = TextAlignment.Center, Margin = new Thickness(15), Uid = "magdurEkle_txtTC" }; Grid.SetRow(txt_TC, 3); Grid.SetColumn(txt_TC, 2); SATSTextBox txt_isim = new SATSTextBox { TextAlignment = TextAlignment.Center, Margin = new Thickness(15), Uid = "magdurEkle_txtIsim" }; Grid.SetRow(txt_isim, 4); Grid.SetColumn(txt_isim, 2); SATSTextBox txt_soyisim = new SATSTextBox { TextAlignment = TextAlignment.Center, Margin = new Thickness(15), Uid = "magdurEkle_txtSoyisim" }; Grid.SetRow(txt_soyisim, 5); Grid.SetColumn(txt_soyisim, 2); SATSListView lw_liste = new SATSListView { Background = Ayarlar.GriRenk, Foreground = Ayarlar.BeyazRenk, Uid = "magdurEkle_lwListe" }; Grid.SetRowSpan(lw_liste, 6); Grid.SetRow(lw_liste, 1); Grid.SetColumn(lw_liste, 3); if (magdurCollection != null) { foreach (Magdur item in magdurCollection) { lw_liste.Items.Add(item); } } SATSButton btn_ekle = new SATSButton { Content = "Ekle", Margin = new Thickness(15) }; Grid.SetRow(btn_ekle, 6); Grid.SetColumn(btn_ekle, 2); SATSButton btn_cikar = new SATSButton { Content = "-", VerticalContentAlignment = VerticalAlignment.Top, Margin = new Thickness(2, 0, 0, 0) }; Grid.SetRow(btn_cikar, 1); Grid.SetColumn(btn_cikar, 4); SATSButton btn_tamam = new SATSButton { Content = "Tamam", Margin = new Thickness(0, 15, 0, 15) }; Grid.SetRow(btn_tamam, 7); Grid.SetColumn(btn_tamam, 3); txt_TC.PreviewTextInput += Txt_TC_PreviewTextInput; txt_TC.IsKeyboardFocusedChanged += Txt_TC_IsKeyboardFocusedChanged; btn_ekle.Click += Btn_ekle_Click; btn_cikar.Click += Btn_cikar_Click; btn_tamam.Click += Btn_tamam_Click; g.Children.Add(lbl_TC); g.Children.Add(lbl_isim); g.Children.Add(lbl_soyisim); g.Children.Add(txt_TC); g.Children.Add(txt_isim); g.Children.Add(txt_soyisim); g.Children.Add(lw_liste); g.Children.Add(btn_ekle); g.Children.Add(btn_cikar); g.Children.Add(btn_tamam); }
public static void Olustur(Grid g, int ilceID, DateTime?basTarih, DateTime?bitTarih) { g.Children.Clear(); g.ColumnDefinitions.Clear(); g.RowDefinitions.Clear(); Islemler.RowOlustur(g, 2, 1, 1, 1, 5); Islemler.ColumnOlustur(g, 1, 2, 2, 1); SATSLabel lbl_OlaySayisi_Metin = new SATSLabel(); lbl_OlaySayisi_Metin.Content = "Meydana Gelen Toplam Olay Sayısı:"; Grid.SetRow(lbl_OlaySayisi_Metin, 1); Grid.SetColumn(lbl_OlaySayisi_Metin, 1); SATSLabel lbl_OlaySayisi = new SATSLabel(); Grid.SetRow(lbl_OlaySayisi, 1); Grid.SetColumn(lbl_OlaySayisi, 2); SATSLabel lbl_FailiMechul_Metin = new SATSLabel(); lbl_FailiMechul_Metin.Content = "Faili Meçhul Olan Olay Sayısı:"; Grid.SetRow(lbl_FailiMechul_Metin, 2); Grid.SetColumn(lbl_FailiMechul_Metin, 1); SATSLabel lbl_FailiMechul = new SATSLabel(); Grid.SetRow(lbl_FailiMechul, 2); Grid.SetColumn(lbl_FailiMechul, 2); SATSLabel lbl_enCokIslenenSuc_Metin = new SATSLabel(); lbl_enCokIslenenSuc_Metin.Content = "En Çok İşlenen Suç:"; Grid.SetRow(lbl_enCokIslenenSuc_Metin, 3); Grid.SetColumn(lbl_enCokIslenenSuc_Metin, 1); SATSLabel lbl_enCokIslenenSuc = new SATSLabel(); Grid.SetRow(lbl_enCokIslenenSuc, 3); Grid.SetColumn(lbl_enCokIslenenSuc, 2); try { using (var db = new Context()) { var sonuc = (from s in db.olaylar where s.mahalle.polisMerkezi.ilce.ID == ilceID && s.tarih >= basTarih && s.tarih <= bitTarih select s); lbl_OlaySayisi.Content = sonuc.Count(); var failiMechul = (from s in sonuc where s.failDurum.failDurumu == "Faili Meçhul" select s).ToList(); lbl_FailiMechul.Content = failiMechul.Count(); var enCokIslenenSuc = ((from s in sonuc group s by s.suc into a select new { suc = a.Key, sayi = a.Count() }).OrderByDescending(c => c.sayi).ToList())[0]; lbl_enCokIslenenSuc.Content = String.Format("{0} ({1})", enCokIslenenSuc.suc.adi, enCokIslenenSuc.sayi); } } catch (Exception ex) { MessageBoxResult result = MessageBox.Show(ex.Message); } g.Children.Add(lbl_OlaySayisi_Metin); g.Children.Add(lbl_OlaySayisi); g.Children.Add(lbl_FailiMechul_Metin); g.Children.Add(lbl_FailiMechul); g.Children.Add(lbl_enCokIslenenSuc_Metin); g.Children.Add(lbl_enCokIslenenSuc); }
public static void Olustur(Grid g) { g.Children.Clear(); g.ColumnDefinitions.Clear(); g.RowDefinitions.Clear(); Islemler.RowOlustur(g, 5, 2, 2, 2, 2, 5); Islemler.ColumnOlustur(g, 2.5, 2, 2, 2.5); SATSLabel lbl_mev_sifre = new SATSLabel(); lbl_mev_sifre.Content = "Mevcut Şifre:"; Grid.SetRow(lbl_mev_sifre, 1); Grid.SetColumn(lbl_mev_sifre, 1); PasswordBox pss_mev_sifre = new PasswordBox { FontSize = Application.Current.MainWindow.FontSize, VerticalContentAlignment = VerticalAlignment.Center, Margin = new Thickness(10), Uid = "pss_mev_sifre" }; Grid.SetRow(pss_mev_sifre, 1); Grid.SetColumn(pss_mev_sifre, 2); SATSLabel lbl_yeni_sifre = new SATSLabel(); lbl_yeni_sifre.Content = "Yeni Şifre:"; Grid.SetRow(lbl_yeni_sifre, 2); Grid.SetColumn(lbl_yeni_sifre, 1); PasswordBox pss_yeni_sifre = new PasswordBox { FontSize = Application.Current.MainWindow.FontSize, VerticalContentAlignment = VerticalAlignment.Center, Margin = new Thickness(10), Uid = "pss_yeni_sifre" }; Grid.SetRow(pss_yeni_sifre, 2); Grid.SetColumn(pss_yeni_sifre, 2); SATSLabel lbl_yeni_sifre_tk = new SATSLabel(); lbl_yeni_sifre_tk.Content = "Yeni Şifre:"; Grid.SetRow(lbl_yeni_sifre_tk, 3); Grid.SetColumn(lbl_yeni_sifre_tk, 1); PasswordBox pss_yeni_sifre_tk = new PasswordBox { FontSize = Application.Current.MainWindow.FontSize, VerticalContentAlignment = VerticalAlignment.Center, Margin = new Thickness(10), Uid = "pss_yeni_sifre_tk" }; Grid.SetRow(pss_yeni_sifre_tk, 3); Grid.SetColumn(pss_yeni_sifre_tk, 2); SATSButton btn_kaydet = new SATSButton { Content = "Kaydet", Margin = new Thickness(10) }; Grid.SetRow(btn_kaydet, 4); Grid.SetColumn(btn_kaydet, 2); btn_kaydet.Click += Btn_kaydet_Click; g.Children.Add(lbl_mev_sifre); g.Children.Add(pss_mev_sifre); g.Children.Add(lbl_yeni_sifre); g.Children.Add(pss_yeni_sifre); g.Children.Add(lbl_yeni_sifre_tk); g.Children.Add(pss_yeni_sifre_tk); g.Children.Add(btn_kaydet); }
public static void Olustur(Grid g, int ID) { g.Children.Clear(); g.RowDefinitions.Clear(); g.ColumnDefinitions.Clear(); Islemler.RowOlustur(g, 0.25, 2, 2, 2, 2, 2, 2, 2, 1); Islemler.ColumnOlustur(g, 1, 2, 4, 2, 2, 2, 1); SATSLabel lbl_il = new SATSLabel(); lbl_il.Content = "İl:"; Grid.SetRow(lbl_il, 1); Grid.SetColumn(lbl_il, 1); SATSComboBox cb_il = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_il", IsReadOnly = true }; Grid.SetRow(cb_il, 1); Grid.SetColumn(cb_il, 2); SATSLabel lbl_ilce = new SATSLabel(); lbl_ilce.Content = "İlçe:"; Grid.SetRow(lbl_ilce, 2); Grid.SetColumn(lbl_ilce, 1); SATSComboBox cb_ilce = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_ilce", IsReadOnly = true }; Grid.SetRow(cb_ilce, 2); Grid.SetColumn(cb_ilce, 2); SATSLabel lbl_pm = new SATSLabel(); lbl_pm.Content = "Polis Merkezi:"; Grid.SetRow(lbl_pm, 3); Grid.SetColumn(lbl_pm, 1); SATSComboBox cb_pm = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_pm", IsReadOnly = true }; Grid.SetRow(cb_pm, 3); Grid.SetColumn(cb_pm, 2); SATSLabel lbl_mh = new SATSLabel(); lbl_mh.Content = "Mahalle:"; Grid.SetRow(lbl_mh, 4); Grid.SetColumn(lbl_mh, 1); SATSComboBox cb_mh = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_mh" }; Grid.SetRow(cb_mh, 4); Grid.SetColumn(cb_mh, 2); SATSLabel lbl_sn = new SATSLabel(); lbl_sn.Content = "Suç Nevi:"; Grid.SetRow(lbl_sn, 5); Grid.SetColumn(lbl_sn, 1); SATSComboBox cb_sn = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_sn" }; Grid.SetRow(cb_sn, 5); Grid.SetColumn(cb_sn, 2); SATSLabel lbl_fd = new SATSLabel(); lbl_fd.Content = "Fail Durumu:"; Grid.SetRow(lbl_fd, 6); Grid.SetColumn(lbl_fd, 1); SATSComboBox cb_fd = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "failDurumu", Uid = "cb_fd" }; Grid.SetRow(cb_fd, 6); Grid.SetColumn(cb_fd, 2); SATSLabel lbl_tarih = new SATSLabel(); lbl_tarih.Content = "Tarih:"; Grid.SetRow(lbl_tarih, 7); Grid.SetColumn(lbl_tarih, 1); SATSDatePicker dp = new SATSDatePicker(); dp.Uid = "tarih"; Grid.SetRow(dp, 7); Grid.SetColumn(dp, 2); SATSLabel lbl_magdur = new SATSLabel(); lbl_magdur.Content = "Mağdur(lar):"; Grid.SetRow(lbl_magdur, 1); Grid.SetColumn(lbl_magdur, 3); SATSListView lw_magdur = new SATSListView { Margin = new Thickness(0, 25, 0, 25), Uid = "lw_magdur" }; Grid.SetRow(lw_magdur, 1); Grid.SetColumn(lw_magdur, 4); Grid.SetRowSpan(lw_magdur, 2); Grid.SetColumnSpan(lw_magdur, 2); SATSButton btn_magdur_ekle = new SATSButton { Content = "Ekle", Margin = new Thickness(0, 10, 10, 20), Uid = "btn_magdudrEkle" }; Grid.SetRow(btn_magdur_ekle, 3); Grid.SetColumn(btn_magdur_ekle, 4); SATSButton btn_magdur_cikar = new SATSButton { Content = "Çıkar", Margin = new Thickness(10, 10, 0, 20) }; Grid.SetRow(btn_magdur_cikar, 3); Grid.SetColumn(btn_magdur_cikar, 5); SATSLabel lbl_supheli = new SATSLabel(); lbl_supheli.Content = "Şüpheli(ler):"; Grid.SetRow(lbl_supheli, 4); Grid.SetColumn(lbl_supheli, 3); SATSListView lw_supheli = new SATSListView { Margin = new Thickness(0, 25, 0, 25), Uid = "lw_supheli" }; Grid.SetRow(lw_supheli, 4); Grid.SetColumn(lw_supheli, 4); Grid.SetRowSpan(lw_supheli, 2); Grid.SetColumnSpan(lw_supheli, 2); SATSButton btn_supheli_ekle = new SATSButton { Content = "Ekle", Margin = new Thickness(0, 10, 10, 20), Uid = "btn_supheliEkle" }; Grid.SetRow(btn_supheli_ekle, 6); Grid.SetColumn(btn_supheli_ekle, 4); SATSButton btn_supheli_cikar = new SATSButton { Content = "Çıkar", FontSize = Application.Current.MainWindow.FontSize, Foreground = Ayarlar.BeyazRenk, Background = Ayarlar.GriRenk, VerticalContentAlignment = VerticalAlignment.Center, Margin = new Thickness(10, 10, 0, 20) }; Grid.SetRow(btn_supheli_cikar, 6); Grid.SetColumn(btn_supheli_cikar, 5); SATSButton btn_guncelle = new SATSButton { Content = "Güncelle", Margin = new Thickness(0, 0, 0, 7), Tag = ID }; Grid.SetRow(btn_guncelle, 7); Grid.SetColumn(btn_guncelle, 4); Grid.SetColumnSpan(btn_guncelle, 2); cb_il.SelectionChanged += new SelectionChangedEventHandler((object sender, SelectionChangedEventArgs e) => { (sender as SATSComboBox).SelectedValue = (sender as SATSComboBox).Tag; }); cb_il.SelectionChanged += Olaylar.Cb_il_SelectionChanged; cb_ilce.SelectionChanged += new SelectionChangedEventHandler((object sender, SelectionChangedEventArgs e) => { (sender as SATSComboBox).SelectedValue = (sender as SATSComboBox).Tag; }); cb_ilce.SelectionChanged += Olaylar.Cb_ilce_SelectionChanged; cb_pm.SelectionChanged += new SelectionChangedEventHandler((object sender, SelectionChangedEventArgs e) => { (sender as SATSComboBox).SelectedValue = (sender as SATSComboBox).Tag; }); cb_pm.SelectionChanged += Olaylar.Cb_pm_SelectionChanged; btn_magdur_cikar.Click += Olaylar.Btn_magdur_cikar_Click; btn_supheli_cikar.Click += Olaylar.Btn_supheli_cikar_Click; btn_magdur_ekle.Click += Btn_magdur_ekle_Click; btn_supheli_ekle.Click += Btn_supheli_ekle_Click; cb_fd.SelectionChanged += new SelectionChangedEventHandler((object sender, SelectionChangedEventArgs e) => { (sender as SATSComboBox).SelectedValue = (sender as SATSComboBox).Tag; }); cb_fd.SelectionChanged += Olaylar.Cb_fd_SelectionChanged; btn_guncelle.Click += Btn_guncelle_Click; g.Children.Add(lbl_il); g.Children.Add(cb_il); g.Children.Add(lbl_ilce); g.Children.Add(cb_ilce); g.Children.Add(lbl_pm); g.Children.Add(cb_pm); g.Children.Add(lbl_mh); g.Children.Add(cb_mh); g.Children.Add(lbl_sn); g.Children.Add(cb_sn); g.Children.Add(lbl_fd); g.Children.Add(cb_fd); g.Children.Add(lbl_tarih); g.Children.Add(dp); g.Children.Add(lbl_magdur); g.Children.Add(lw_magdur); g.Children.Add(btn_magdur_ekle); g.Children.Add(btn_magdur_cikar); g.Children.Add(lbl_supheli); g.Children.Add(lw_supheli); g.Children.Add(btn_supheli_ekle); g.Children.Add(btn_supheli_cikar); g.Children.Add(btn_guncelle); try { using (var db = new Context()) { Olay duzenlenenOlay = (from olay in db.olaylar where olay.ID == ID select olay).SingleOrDefault(); var magdurlar = (from olay in db.olaylar where olay.ID == ID select olay.magdurlar).ToList()[0]; var supheliler = (from olay in db.olaylar where olay.ID == ID select olay.supheliler).ToList()[0]; cb_il.Tag = duzenlenenOlay.mahalle.polisMerkezi.ilce.İl.ID; cb_ilce.Tag = duzenlenenOlay.mahalle.polisMerkezi.ilce.ID; cb_pm.Tag = duzenlenenOlay.mahalle.polisMerkezi.ID; cb_fd.Tag = duzenlenenOlay.failDurum.ID; var iller = (from i in db.iller select i).ToList(); cb_il.ItemsSource = iller; var suclar = (from s in db.suclar select s).ToList(); cb_sn.ItemsSource = suclar; var fail = (from f in db.failDurumu select f).ToList(); cb_fd.ItemsSource = fail; cb_il.SelectedValue = duzenlenenOlay.mahalle.polisMerkezi.ilce.İl.ID; cb_ilce.SelectedValue = duzenlenenOlay.mahalle.polisMerkezi.ilce.ID; cb_pm.SelectedValue = duzenlenenOlay.mahalle.polisMerkezi.ID; cb_mh.SelectedValue = duzenlenenOlay.mahalle.ID; cb_fd.SelectedValue = duzenlenenOlay.failDurum.ID; cb_sn.SelectedValue = duzenlenenOlay.suc.ID; dp.SelectedDate = duzenlenenOlay.tarih; foreach (Magdur magdur in magdurlar) { lw_magdur.Items.Add(magdur); } foreach (Supheli supheli in supheliler) { lw_supheli.Items.Add(supheli); } } } catch (Exception ex) { MessageBoxResult result = MessageBox.Show(ex.Message); } }
public static void Olustur(Grid g) { WindowDuzenle(g); g.Children.Clear(); g.ColumnDefinitions.Clear(); g.RowDefinitions.Clear(); Islemler.RowOlustur(g, 1, 1, 1, 1, 1, 1, 5); Islemler.ColumnOlustur(g, 2, 11); SATSButton btn_OlayKayit = new SATSButton(); btn_OlayKayit.Content = "Olay Kayıt"; Grid.SetRow(btn_OlayKayit, 1); Grid.SetColumn(btn_OlayKayit, 0); SATSButton btn_Duzenle = new SATSButton(); btn_Duzenle.Content = "Düzenle/sil"; Grid.SetRow(btn_Duzenle, 2); Grid.SetColumn(btn_Duzenle, 0); SATSButton btn_Istatistikler = new SATSButton(); btn_Istatistikler.Content = "İstatistikler"; Grid.SetRow(btn_Istatistikler, 3); Grid.SetColumn(btn_Istatistikler, 0); SATSButton btn_Profilim = new SATSButton(); btn_Profilim.Content = "Profilim"; Grid.SetRow(btn_Profilim, 4); Grid.SetColumn(btn_Profilim, 0); SATSButton btn_Iletisim = new SATSButton(); btn_Iletisim.Content = "İletişim"; Grid.SetRow(btn_Iletisim, 5); Grid.SetColumn(btn_Iletisim, 0); SATSLabel lbl_Isim = new SATSLabel(); lbl_Isim.Margin = new Thickness(0, 0, 12, 0); lbl_Isim.HorizontalAlignment = HorizontalAlignment.Right; Grid.SetRow(lbl_Isim, 0); Grid.SetColumn(lbl_Isim, 1); Grid grMenu = new Grid(); Grid.SetRow(grMenu, 1); Grid.SetColumn(grMenu, 1); Grid.SetRowSpan(grMenu, 6); SATSLabel lbl_Hosgeldiniz = new SATSLabel(); lbl_Hosgeldiniz.Content = "Hoşgeldiniz"; int sicil = (int)(g.Parent as Window).Tag; using (var db = new Context()) { var q = (from prs in db.personeller where prs.sicil == sicil select prs).FirstOrDefaultAsync(); lbl_Isim.Content = string.Format("{0} {1} {2} / {3}", q.Result.rutbe.adi, q.Result.adi, q.Result.soyadi, q.Result.polisMerkezi.adi); } btn_OlayKayit.Click += Btn_OlayKayit_Click; btn_Duzenle.Click += Btn_Duzenle_Click; btn_Istatistikler.Click += Btn_Istatistikler_Click; btn_Profilim.Click += Btn_Profilim_Click; btn_Iletisim.Click += Btn_Iletisim_Click; grMenu.Children.Add(lbl_Hosgeldiniz); g.Children.Add(btn_OlayKayit); g.Children.Add(btn_Duzenle); g.Children.Add(btn_Istatistikler); g.Children.Add(btn_Profilim); g.Children.Add(btn_Iletisim); g.Children.Add(lbl_Isim); g.Children.Add(grMenu); }
public static void Olustur(Grid g) { g.Children.Clear(); g.ColumnDefinitions.Clear(); g.RowDefinitions.Clear(); Islemler.RowOlustur(g, 3, 2, 2, 2, 3); Islemler.ColumnOlustur(g, 0.5, 2, 2, 2, 2, 0.5); SATSLabel lbl_baslik = new SATSLabel(); lbl_baslik.Content = "Suça Göre İstatistikler"; Grid.SetRow(lbl_baslik, 0); Grid.SetColumn(lbl_baslik, 1); Grid.SetColumnSpan(lbl_baslik, 4); SATSLabel lbl_suc = new SATSLabel(); lbl_suc.Content = "Suç Tipi:"; Grid.SetRow(lbl_suc, 1); Grid.SetColumn(lbl_suc, 1); SATSComboBox cb_suc = new SATSComboBox { Margin = new Thickness(0, 35, 25, 35), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_suc" }; Grid.SetRow(cb_suc, 1); Grid.SetColumn(cb_suc, 2); SATSLabel lbl_tarih_bas = new SATSLabel(); lbl_tarih_bas.Content = "Başlangıç Tarihi:"; Grid.SetRow(lbl_tarih_bas, 2); Grid.SetColumn(lbl_tarih_bas, 1); SATSDatePicker dp_bas = new SATSDatePicker { Margin = new Thickness(0, 0, 25, 0), Uid = "dp_bas" }; Grid.SetRow(dp_bas, 2); Grid.SetColumn(dp_bas, 2); SATSLabel lbl_tarih_bit = new SATSLabel(); lbl_tarih_bit.Content = "Bitiş Tarihi:"; Grid.SetRow(lbl_tarih_bit, 2); Grid.SetColumn(lbl_tarih_bit, 3); SATSDatePicker dp_bit = new SATSDatePicker { Margin = new Thickness(0, 0, 25, 0), Uid = "dp_bit" }; Grid.SetRow(dp_bit, 2); Grid.SetColumn(dp_bit, 4); SATSButton btn_sucist = new SATSButton { Content = "İstatistik Göster", VerticalContentAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 25, 25, 0) }; Grid.SetRow(btn_sucist, 3); Grid.SetColumn(btn_sucist, 4); try { using (var db = new Context()) { var suclar = (from s in db.suclar select s).ToList(); cb_suc.ItemsSource = suclar; } } catch (Exception ex) { MessageBoxResult result = MessageBox.Show(ex.Message); } btn_sucist.Click += Btn_sucist_Click; g.Children.Add(lbl_baslik); g.Children.Add(lbl_suc); g.Children.Add(cb_suc); g.Children.Add(lbl_tarih_bas); g.Children.Add(dp_bas); g.Children.Add(lbl_tarih_bit); g.Children.Add(dp_bit); g.Children.Add(btn_sucist); }
public static void Olustur(Grid g) { g.Children.Clear(); g.ColumnDefinitions.Clear(); g.RowDefinitions.Clear(); Islemler.RowOlustur(g, 2, 2, 2, 2, 2, 2, 2); Islemler.ColumnOlustur(g, 0.5, 2, 2, 2, 2, 0.5); SATSLabel lbl_il = new SATSLabel(); lbl_il.Content = "İl:"; Grid.SetRow(lbl_il, 1); Grid.SetColumn(lbl_il, 1); SATSComboBox cb_il = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_il" }; Grid.SetRow(cb_il, 1); Grid.SetColumn(cb_il, 2); SATSLabel lbl_ilce = new SATSLabel(); lbl_ilce.Content = "İlçe:"; Grid.SetRow(lbl_ilce, 1); Grid.SetColumn(lbl_ilce, 3); SATSComboBox cb_ilce = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_ilce" }; Grid.SetRow(cb_ilce, 1); Grid.SetColumn(cb_ilce, 4); SATSLabel lbl_pm = new SATSLabel(); lbl_pm.Content = "Polis Merkezi:"; Grid.SetRow(lbl_pm, 2); Grid.SetColumn(lbl_pm, 1); SATSComboBox cb_pm = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_pm" }; Grid.SetRow(cb_pm, 2); Grid.SetColumn(cb_pm, 2); SATSLabel lbl_mh = new SATSLabel(); lbl_mh.Content = "Mahalle:"; Grid.SetRow(lbl_mh, 2); Grid.SetColumn(lbl_mh, 3); SATSComboBox cb_mh = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_mh" }; Grid.SetRow(cb_mh, 2); Grid.SetColumn(cb_mh, 4); SATSLabel lbl_sn = new SATSLabel(); lbl_sn.Content = "Suç Nevi:"; Grid.SetRow(lbl_sn, 3); Grid.SetColumn(lbl_sn, 1); SATSComboBox cb_sn = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_sn" }; Grid.SetRow(cb_sn, 3); Grid.SetColumn(cb_sn, 2); SATSLabel lbl_fd = new SATSLabel(); lbl_fd.Content = "Fail Durumu:"; Grid.SetRow(lbl_fd, 3); Grid.SetColumn(lbl_fd, 3); SATSComboBox cb_fd = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "failDurumu", Uid = "cb_fd" }; Grid.SetRow(cb_fd, 3); Grid.SetColumn(cb_fd, 4); SATSLabel lbl_tarih_bas = new SATSLabel(); lbl_tarih_bas.Content = "Başlangıç Tarihi:"; Grid.SetRow(lbl_tarih_bas, 4); Grid.SetColumn(lbl_tarih_bas, 1); SATSDatePicker dp_bas = new SATSDatePicker { Margin = new Thickness(0, 0, 25, 0), Uid = "dp_bas" }; Grid.SetRow(dp_bas, 4); Grid.SetColumn(dp_bas, 2); SATSLabel lbl_tarih_bit = new SATSLabel(); lbl_tarih_bit.Content = "Bitiş Tarihi:"; Grid.SetRow(lbl_tarih_bit, 4); Grid.SetColumn(lbl_tarih_bit, 3); SATSDatePicker dp_bit = new SATSDatePicker { FontSize = Application.Current.MainWindow.FontSize, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 25, 0), Uid = "dp_bit" }; Grid.SetRow(dp_bit, 4); Grid.SetColumn(dp_bit, 4); SATSButton btn_ara = new SATSButton { Content = "Ara", Margin = new Thickness(0, 25, 25, 0) }; Grid.SetRow(btn_ara, 5); Grid.SetColumn(btn_ara, 3); Grid.SetColumnSpan(btn_ara, 2); btn_ara.Click += Btn_ara_Click; cb_il.SelectionChanged += Olaylar.Cb_il_SelectionChanged; cb_ilce.SelectionChanged += Olaylar.Cb_ilce_SelectionChanged; cb_pm.SelectionChanged += Olaylar.Cb_pm_SelectionChanged; dp_bit.SelectedDateChanged += Olaylar.Dp_bit_SelectedDateChanged; dp_bas.SelectedDateChanged += Olaylar.Dp_bas_SelectedDateChanged; try { using (var db = new Context()) { var iller = (from i in db.iller select i).ToListAsync(); cb_il.ItemsSource = iller.Result; var suclar = (from s in db.suclar select s).ToListAsync(); cb_sn.ItemsSource = suclar.Result; var fail = (from f in db.failDurumu select f).ToListAsync(); cb_fd.ItemsSource = fail.Result; } } catch (Exception ex) { MessageBoxResult result = MessageBox.Show(ex.Message); } g.Children.Add(lbl_il); g.Children.Add(cb_il); g.Children.Add(lbl_ilce); g.Children.Add(cb_ilce); g.Children.Add(lbl_pm); g.Children.Add(cb_pm); g.Children.Add(lbl_sn); g.Children.Add(cb_sn); g.Children.Add(lbl_fd); g.Children.Add(cb_fd); g.Children.Add(lbl_tarih_bas); g.Children.Add(dp_bas); g.Children.Add(lbl_tarih_bit); g.Children.Add(dp_bit); g.Children.Add(btn_ara); g.Children.Add(lbl_mh); g.Children.Add(cb_mh); }
public static void Olustur(Grid g) { List <UIElement> olayEkle = new List <UIElement>(); foreach (UIElement element in g.Children) { if (element.Uid == "lw_supheli") { supheliCollection = ((SATSListView)element).Items; } olayEkle.Add(element); } g.Children.Clear(); g.ColumnDefinitions.Clear(); g.RowDefinitions.Clear(); Islemler.ColumnOlustur(g, 0.1, 1, 1, 1, 0.1, 0.7); Islemler.RowOlustur(g, 0.5, 0.1, 0.1, 0.3, 0.3, 0.3, 0.3, 0.3, 0.5, 0.5); SATSLabel lbl_TC = new SATSLabel(); lbl_TC.Content = "TC Kimlik No:"; Grid.SetRow(lbl_TC, 3); Grid.SetColumn(lbl_TC, 1); SATSLabel lbl_isim = new SATSLabel(); lbl_isim.Content = "İsim:"; Grid.SetRow(lbl_isim, 4); Grid.SetColumn(lbl_isim, 1); SATSLabel lbl_soyisim = new SATSLabel(); lbl_soyisim.Content = "Soyisim:"; Grid.SetRow(lbl_soyisim, 5); Grid.SetColumn(lbl_soyisim, 1); SATSTextBox txt_TC = new SATSTextBox { TextAlignment = TextAlignment.Center, Margin = new Thickness(15), Uid = "supheliEkle_txtTC" }; Grid.SetRow(txt_TC, 3); Grid.SetColumn(txt_TC, 2); SATSTextBox txt_isim = new SATSTextBox { TextAlignment = TextAlignment.Center, Margin = new Thickness(15), Uid = "supheliEkle_txtIsim" }; Grid.SetRow(txt_isim, 4); Grid.SetColumn(txt_isim, 2); SATSTextBox txt_soyisim = new SATSTextBox { TextAlignment = TextAlignment.Center, Margin = new Thickness(15), Uid = "supheliEkle_txtSoyisim" }; Grid.SetRow(txt_soyisim, 5); Grid.SetColumn(txt_soyisim, 2); SATSLabel lbl_supheliDurum = new SATSLabel(); lbl_supheliDurum.Content = "Şüpheli Durumu:"; Grid.SetRow(lbl_supheliDurum, 6); Grid.SetColumn(lbl_supheliDurum, 1); SATSComboBox cb_supheliDurum = new SATSComboBox { Margin = new Thickness(15), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_supheliDurum" }; Grid.SetRow(cb_supheliDurum, 6); Grid.SetColumn(cb_supheliDurum, 2); SATSListView lw_liste = new SATSListView(); lw_liste.Uid = "supheliEkle_lwListe"; Grid.SetRowSpan(lw_liste, 6); Grid.SetRow(lw_liste, 2); Grid.SetColumn(lw_liste, 3); if (supheliCollection != null) { foreach (Supheli item in supheliCollection) { lw_liste.Items.Add(item); } } SATSButton btn_ekle = new SATSButton { Content = "Ekle", Margin = new Thickness(15) }; Grid.SetRow(btn_ekle, 7); Grid.SetColumn(btn_ekle, 2); SATSButton btn_cikar = new SATSButton { Content = "-", VerticalContentAlignment = VerticalAlignment.Top, Margin = new Thickness(2, 0, 0, 0) }; Grid.SetRow(btn_cikar, 2); Grid.SetColumn(btn_cikar, 4); SATSButton btn_tamam = new SATSButton { Content = "Tamam", Margin = new Thickness(0, 15, 0, 15) }; Grid.SetRow(btn_tamam, 8); Grid.SetColumn(btn_tamam, 3); /*using (var db = new Context()) * { * var durum = (from f in db.supheliDurumlari select f).ToList(); * cb_supheliDurum.ItemsSource = durum; * }*/ g.Tag = olayEkle; txt_TC.PreviewTextInput += Txt_TC_PreviewTextInput; txt_TC.IsKeyboardFocusedChanged += Txt_TC_IsKeyboardFocusedChanged; btn_ekle.Click += Btn_ekle_Click; btn_cikar.Click += Btn_cikar_Click; btn_tamam.Click += Btn_tamam_Click; g.Children.Add(lbl_TC); g.Children.Add(lbl_isim); g.Children.Add(lbl_soyisim); g.Children.Add(txt_TC); g.Children.Add(txt_isim); g.Children.Add(txt_soyisim); g.Children.Add(lw_liste); g.Children.Add(btn_ekle); g.Children.Add(btn_cikar); g.Children.Add(btn_tamam); g.Children.Add(lbl_supheliDurum); g.Children.Add(cb_supheliDurum); }
public static void Olustur(Grid g) { g.Children.Clear(); g.ColumnDefinitions.Clear(); g.RowDefinitions.Clear(); Islemler.RowOlustur(g, 0.25, 2, 2, 2, 2, 2, 2, 2, 1); Islemler.ColumnOlustur(g, 1, 2, 4, 2, 2, 2, 1); SATSLabel lbl_il = new SATSLabel(); lbl_il.Content = "İl:"; Grid.SetRow(lbl_il, 1); Grid.SetColumn(lbl_il, 1); SATSComboBox cb_il = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_il" }; Grid.SetRow(cb_il, 1); Grid.SetColumn(cb_il, 2); SATSLabel lbl_ilce = new SATSLabel(); lbl_ilce.Content = "İlçe:"; Grid.SetRow(lbl_ilce, 2); Grid.SetColumn(lbl_ilce, 1); SATSComboBox cb_ilce = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_ilce" }; Grid.SetRow(cb_ilce, 2); Grid.SetColumn(cb_ilce, 2); SATSLabel lbl_pm = new SATSLabel(); lbl_pm.Content = "Polis Merkezi:"; Grid.SetRow(lbl_pm, 3); Grid.SetColumn(lbl_pm, 1); SATSComboBox cb_pm = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_pm" }; Grid.SetRow(cb_pm, 3); Grid.SetColumn(cb_pm, 2); SATSLabel lbl_mh = new SATSLabel(); lbl_mh.Content = "Mahalle:"; Grid.SetRow(lbl_mh, 4); Grid.SetColumn(lbl_mh, 1); SATSComboBox cb_mh = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_mh" }; Grid.SetRow(cb_mh, 4); Grid.SetColumn(cb_mh, 2); SATSLabel lbl_sn = new SATSLabel(); lbl_sn.Content = "Suç Nevi:"; Grid.SetRow(lbl_sn, 5); Grid.SetColumn(lbl_sn, 1); SATSComboBox cb_sn = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_sn" }; Grid.SetRow(cb_sn, 5); Grid.SetColumn(cb_sn, 2); SATSLabel lbl_fd = new SATSLabel(); lbl_fd.Content = "Fail Durumu:"; Grid.SetRow(lbl_fd, 6); Grid.SetColumn(lbl_fd, 1); SATSComboBox cb_fd = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "failDurumu", Uid = "cb_fd" }; Grid.SetRow(cb_fd, 6); Grid.SetColumn(cb_fd, 2); SATSLabel lbl_tarih = new SATSLabel(); lbl_tarih.Content = "Tarih:"; Grid.SetRow(lbl_tarih, 7); Grid.SetColumn(lbl_tarih, 1); SATSDatePicker dp = new SATSDatePicker(); dp.Uid = "tarih"; Grid.SetRow(dp, 7); Grid.SetColumn(dp, 2); SATSLabel lbl_magdur = new SATSLabel(); lbl_magdur.Content = "Mağdur(lar):"; Grid.SetRow(lbl_magdur, 1); Grid.SetColumn(lbl_magdur, 3); SATSListView lw_magdur = new SATSListView { Margin = new Thickness(0, 25, 0, 25), Uid = "lw_magdur" }; Grid.SetRow(lw_magdur, 1); Grid.SetColumn(lw_magdur, 4); Grid.SetRowSpan(lw_magdur, 2); Grid.SetColumnSpan(lw_magdur, 2); SATSButton btn_magdur_ekle = new SATSButton { Content = "Ekle", Margin = new Thickness(0, 10, 10, 20), Uid = "btn_magdudrEkle" }; Grid.SetRow(btn_magdur_ekle, 3); Grid.SetColumn(btn_magdur_ekle, 4); SATSButton btn_magdur_cikar = new SATSButton { Content = "Çıkar", Margin = new Thickness(10, 10, 0, 20) }; Grid.SetRow(btn_magdur_cikar, 3); Grid.SetColumn(btn_magdur_cikar, 5); SATSLabel lbl_supheli = new SATSLabel(); lbl_supheli.Content = "Şüpheli(ler):"; Grid.SetRow(lbl_supheli, 4); Grid.SetColumn(lbl_supheli, 3); SATSListView lw_supheli = new SATSListView { Margin = new Thickness(0, 25, 0, 25), Uid = "lw_supheli" }; Grid.SetRow(lw_supheli, 4); Grid.SetColumn(lw_supheli, 4); Grid.SetRowSpan(lw_supheli, 2); Grid.SetColumnSpan(lw_supheli, 2); SATSButton btn_supheli_ekle = new SATSButton { Content = "Ekle", Margin = new Thickness(0, 10, 10, 20), Uid = "btn_supheliEkle" }; Grid.SetRow(btn_supheli_ekle, 6); Grid.SetColumn(btn_supheli_ekle, 4); SATSButton btn_supheli_cikar = new SATSButton { Content = "Çıkar", Margin = new Thickness(10, 10, 0, 20) }; Grid.SetRow(btn_supheli_cikar, 6); Grid.SetColumn(btn_supheli_cikar, 5); SATSButton btn_ekle = new SATSButton { Content = "Kayıt Ekle", Margin = new Thickness(0, 0, 0, 7) }; Grid.SetRow(btn_ekle, 7); Grid.SetColumn(btn_ekle, 4); Grid.SetColumnSpan(btn_ekle, 2); try { using (var db = new Context()) { var iller = (from i in db.iller select i).ToList(); cb_il.ItemsSource = iller; var suclar = (from s in db.suclar select s).ToList(); cb_sn.ItemsSource = suclar; var fail = (from f in db.failDurumu select f).ToList(); cb_fd.ItemsSource = fail; } } catch (Exception ex) { MessageBoxResult result = MessageBox.Show(ex.Message); } btn_magdur_cikar.Click += Olaylar.Btn_magdur_cikar_Click; btn_supheli_cikar.Click += Olaylar.Btn_supheli_cikar_Click; btn_ekle.Click += Btn_ekle_Click; btn_magdur_ekle.Click += Btn_magdur_ekle_Click; btn_supheli_ekle.Click += Btn_supheli_ekle_Click; cb_il.SelectionChanged += Olaylar.Cb_il_SelectionChanged; cb_ilce.SelectionChanged += Olaylar.Cb_ilce_SelectionChanged; cb_pm.SelectionChanged += Olaylar.Cb_pm_SelectionChanged; cb_fd.SelectionChanged += Olaylar.Cb_fd_SelectionChanged; g.Children.Add(lbl_il); g.Children.Add(cb_il); g.Children.Add(lbl_ilce); g.Children.Add(cb_ilce); g.Children.Add(lbl_pm); g.Children.Add(cb_pm); g.Children.Add(lbl_mh); g.Children.Add(cb_mh); g.Children.Add(lbl_sn); g.Children.Add(cb_sn); g.Children.Add(lbl_fd); g.Children.Add(cb_fd); g.Children.Add(lbl_tarih); g.Children.Add(dp); g.Children.Add(lbl_magdur); g.Children.Add(lw_magdur); g.Children.Add(btn_magdur_ekle); g.Children.Add(btn_magdur_cikar); g.Children.Add(lbl_supheli); g.Children.Add(lw_supheli); g.Children.Add(btn_supheli_ekle); g.Children.Add(btn_supheli_cikar); g.Children.Add(btn_ekle); }
public static void Olustur(Grid g) { g.Children.Clear(); g.ColumnDefinitions.Clear(); g.RowDefinitions.Clear(); Islemler.RowOlustur(g, 3, 2, 2, 2, 2, 3); Islemler.ColumnOlustur(g, 0.5, 2, 2, 2, 2, 0.5); SATSLabel lbl_baslik = new SATSLabel(); lbl_baslik.Content = "Bölgeye Göre İstatistikler"; Grid.SetRow(lbl_baslik, 0); Grid.SetColumn(lbl_baslik, 1); Grid.SetColumnSpan(lbl_baslik, 4); SATSLabel lbl_il = new SATSLabel(); lbl_il.Content = "İl:"; Grid.SetRow(lbl_il, 1); Grid.SetColumn(lbl_il, 1); SATSComboBox cb_il = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_il" }; Grid.SetRow(cb_il, 1); Grid.SetColumn(cb_il, 2); SATSLabel lbl_ilce = new SATSLabel(); lbl_ilce.Content = "İlçe:"; Grid.SetRow(lbl_ilce, 1); Grid.SetColumn(lbl_ilce, 3); SATSComboBox cb_ilce = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_ilce" }; Grid.SetRow(cb_ilce, 1); Grid.SetColumn(cb_ilce, 4); SATSLabel lbl_pm = new SATSLabel(); lbl_pm.Content = "Polis Merkezi:"; Grid.SetRow(lbl_pm, 2); Grid.SetColumn(lbl_pm, 1); SATSComboBox cb_pm = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_pm" }; Grid.SetRow(cb_pm, 2); Grid.SetColumn(cb_pm, 2); SATSLabel lbl_mh = new SATSLabel(); lbl_mh.Content = "Mahalle:"; Grid.SetRow(lbl_mh, 2); Grid.SetColumn(lbl_mh, 3); SATSComboBox cb_mh = new SATSComboBox { Margin = new Thickness(0, 25, 25, 25), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_mh" }; Grid.SetRow(cb_mh, 2); Grid.SetColumn(cb_mh, 4); SATSLabel lbl_tarih_bas = new SATSLabel(); lbl_tarih_bas.Content = "Başlangıç Tarihi:"; Grid.SetRow(lbl_tarih_bas, 3); Grid.SetColumn(lbl_tarih_bas, 1); SATSDatePicker dp_bas = new SATSDatePicker { Margin = new Thickness(0, 0, 25, 0), Uid = "dp_bas" }; Grid.SetRow(dp_bas, 3); Grid.SetColumn(dp_bas, 2); SATSLabel lbl_tarih_bit = new SATSLabel(); lbl_tarih_bit.Content = "Bitiş Tarihi:"; Grid.SetRow(lbl_tarih_bit, 3); Grid.SetColumn(lbl_tarih_bit, 3); SATSDatePicker dp_bit = new SATSDatePicker { Margin = new Thickness(0, 0, 25, 0), Uid = "dp_bit" }; Grid.SetRow(dp_bit, 3); Grid.SetColumn(dp_bit, 4); SATSButton btn_ist = new SATSButton { Content = "İstatistik Göster", Margin = new Thickness(0, 25, 25, 0) }; Grid.SetRow(btn_ist, 4); Grid.SetColumn(btn_ist, 3); Grid.SetColumnSpan(btn_ist, 2); cb_il.SelectionChanged += Olaylar.Cb_il_SelectionChanged; cb_ilce.SelectionChanged += Olaylar.Cb_ilce_SelectionChanged; cb_pm.SelectionChanged += Olaylar.Cb_pm_SelectionChanged; dp_bit.SelectedDateChanged += Olaylar.Dp_bit_SelectedDateChanged; dp_bas.SelectedDateChanged += Olaylar.Dp_bas_SelectedDateChanged; btn_ist.Click += Btn_ist_Click; try { using (var db = new Context()) { var iller = (from i in db.iller select i).ToListAsync(); cb_il.ItemsSource = iller.Result; } } catch (Exception ex) { MessageBoxResult result = MessageBox.Show(ex.Message); } g.Children.Add(lbl_baslik); g.Children.Add(lbl_il); g.Children.Add(cb_il); g.Children.Add(lbl_ilce); g.Children.Add(cb_ilce); g.Children.Add(lbl_pm); g.Children.Add(cb_pm); g.Children.Add(lbl_tarih_bas); g.Children.Add(dp_bas); g.Children.Add(lbl_tarih_bit); g.Children.Add(dp_bit); g.Children.Add(btn_ist); g.Children.Add(lbl_mh); g.Children.Add(cb_mh); }