Пример #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     TxtPersonelId.Clear();
     TxtPersonelAd.Clear();
     TxtPersonelDepartman.Clear();
     TxtPersonelAd.Focus();
 }
Пример #2
0
        private void BtnSil_Click(object sender, EventArgs e)
        {
            SqlCommand komut = new SqlCommand("delete from Personel where PersonelID=@p1", bgl.baglanti());

            komut.Parameters.AddWithValue("@p1", TxtPersonelID.Text);
            komut.ExecuteNonQuery();
            bgl.baglanti().Close();
            MessageBox.Show(TxtPersonelAd.Text + " isimli personel silindi");
            this.personelTableAdapter.Fill(this.yurtKayitDataSet9.Personel);
            TxtPersonelID.Clear();
            TxtPersonelAd.Clear();
            TxtPersonelDepartman.Clear();
        }
Пример #3
0
        private void BtnGuncelle_Click(object sender, EventArgs e)
        {
            SqlCommand komut = new SqlCommand("update Personel set PersonelAdSoyad=@p1, PersonelDepartman=@p2 where PersonelID=@p3", bgl.baglanti());

            komut.Parameters.AddWithValue("@p3", TxtPersonelID.Text);
            komut.Parameters.AddWithValue("@p1", TxtPersonelAd.Text);
            komut.Parameters.AddWithValue("@p2", TxtPersonelDepartman.Text);
            komut.ExecuteNonQuery();
            MessageBox.Show(TxtPersonelAd.Text + " isimli personel güncellendi");
            this.personelTableAdapter.Fill(this.yurtKayitDataSet9.Personel);
            TxtPersonelID.Clear();
            TxtPersonelAd.Clear();
            TxtPersonelDepartman.Clear();
        }
Пример #4
0
        private void BtnKaydet_Click(object sender, EventArgs e)
        {
            SqlCommand komut = new SqlCommand("insert into Personel (PersonelAdSoyad,PersonelDepartman) values (@p1,@p2)", bgl.baglanti());

            komut.Parameters.AddWithValue("@p1", TxtPersonelAd.Text);
            komut.Parameters.AddWithValue("@p2", TxtPersonelDepartman.Text);
            komut.ExecuteNonQuery();
            bgl.baglanti().Close();
            MessageBox.Show(TxtPersonelAd.Text + " isimli personel " + TxtPersonelDepartman.Text + " olarak eklendi");
            this.personelTableAdapter.Fill(this.yurtKayitDataSet9.Personel);
            TxtPersonelID.Clear();
            TxtPersonelAd.Clear();
            TxtPersonelDepartman.Clear();
        }
Пример #5
0
        private void BtnSil_Click(object sender, EventArgs e)
        {
            try
            {
                // Personel silme

                SqlCommand komut = new SqlCommand("Delete from Personel where Personelid=@p1", bgl.baglanti());
                komut.Parameters.AddWithValue("@p1", TxtPersonelId.Text);
                komut.ExecuteNonQuery();
                TxtPersonelId.Clear();
                TxtPersonelAd.Clear();
                TxtPersonelDepartman.Clear();
                TxtPersonelAd.Focus();
                bgl.baglanti().Close();
                PersonelGetir();
                MessageBox.Show("Personel Silme İşlemi Gerçekleşti");
            }
            catch (Exception)
            {
                MessageBox.Show("Hatalı Silme İşlemi");
            }
        }