Ejemplo n.º 1
0
        private void btnKomutanGuncelle_Click(object sender, EventArgs e)
        {
            try
            {
                int secilenKisiID    = Convert.ToInt32(lblKomutanID.Text);
                UcusTakipEntities vt = new UcusTakipEntities();
                HarekatSB_Komutan h1 = vt.HarekatSB_Komutan.FirstOrDefault(p => p.KisiID == secilenKisiID);
                h1.KisiAdi     = txtKomutanAdi.Text;
                h1.KisiSoyadi  = txtKomutanSoyadi.Text;
                h1.KisiRutbesi = txtKomutanRutbesi.Text;

                int sonuc = vt.SaveChanges();
                if (sonuc > 0)
                {
                    MessageBox.Show("Güncelleme Başarılı");
                    TumKayitleriListele();
                }
                else
                {
                    MessageBox.Show("Güncelleme Başarısız");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Lütfen kayıt seçimi yapınız.");
            }
        }
Ejemplo n.º 2
0
        private void btnKomutanSil_Click(object sender, EventArgs e)
        {
            try
            {
                int secilenKisiID    = Convert.ToInt32(lblKomutanID.Text);
                UcusTakipEntities vt = new UcusTakipEntities();
                HarekatSB_Komutan k1 = vt.HarekatSB_Komutan.FirstOrDefault(p => p.KisiID == secilenKisiID);
                vt.HarekatSB_Komutan.Remove(k1);

                int sonuc = vt.SaveChanges();
                if (sonuc > 0)
                {
                    AlanlariTemizle();
                    TumKayitleriListele();
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Lütfen kayıtlar üzerinde seçim yapınız.");
            }
        }
Ejemplo n.º 3
0
        private void btnKomutanKaydet_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(txtKomutanAdi.Text))
                {
                    MessageBox.Show("Lütfen boş alanları doldurunuz.");
                }
                else
                {
                    HarekatSB_Komutan h1 = new HarekatSB_Komutan();
                    h1.KisiAdi     = txtKomutanAdi.Text;
                    h1.KisiSoyadi  = txtKomutanSoyadi.Text;
                    h1.KisiUnvani  = txtKomutanUnvani.Text;
                    h1.KisiRutbesi = txtKomutanRutbesi.Text;

                    UcusTakipEntities vt = new UcusTakipEntities();
                    vt.HarekatSB_Komutan.Add(h1);

                    int sonuc = vt.SaveChanges();
                    if (sonuc > 0)
                    {
                        MessageBox.Show("Kayıt Başarılı");
                        TumKayitleriListele();
                    }
                    else
                    {
                        MessageBox.Show("Kayıt Başarısız");
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Lütfen boş alanları doldurunuz.");
            }
        }