コード例 #1
0
ファイル: OlayDuzenleme.cs プロジェクト: KaanHanGunay/SATS
        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);
            }
        }
コード例 #2
0
ファイル: SucSorgulama.cs プロジェクト: KaanHanGunay/SATS
        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);
        }
コード例 #3
0
ファイル: Form.cs プロジェクト: KaanHanGunay/SATS
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: Form.cs プロジェクト: KaanHanGunay/SATS
        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);
        }
コード例 #6
0
ファイル: BolgeSorgulama.cs プロジェクト: KaanHanGunay/SATS
        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);
        }