private void btnKaydet_Click(object sender, EventArgs e) { if (textBox1.Text == "" || textBox2.Text == "" || textBox4.Text == "" || comboBox1.Text == "" || label8.Text == "") { System.Windows.Forms.MessageBox.Show("LÜTFEN YILDIZLI ALANLARI DOLDURUNUZ"); } else { connection.Open(); SqlCommand cekle = new SqlCommand("insert into Uyeler (uye_ad,uye_soyad,uye_sinif,uye_no,uye_adres,uye_telefon,uye_kayitucreti,uye_gorev,uye_kayityil,uye_resim) values (@prmtr2,@prmtr3,@prmtr4,@prmtr5,@prmtr6,@prmtr7,@prmtr8,@prmtr9,@prmtr10,@prmtr11)", connection); cekle.Parameters.AddWithValue("@prmtr2", textBox1.Text); cekle.Parameters.AddWithValue("@prmtr3", textBox2.Text); cekle.Parameters.AddWithValue("@prmtr4", comboBox1.Text); cekle.Parameters.AddWithValue("@prmtr5", textBox4.Text); cekle.Parameters.AddWithValue("@prmtr6", textBox5.Text); cekle.Parameters.AddWithValue("@prmtr7", maskedTextBox1.Text); cekle.Parameters.AddWithValue("@prmtr8", textBox6.Text); cekle.Parameters.AddWithValue("@prmtr9", textBox7.Text); cekle.Parameters.AddWithValue("@prmtr10", dateTimePicker1.Text); cekle.Parameters.AddWithValue("@prmtr11", label8.Text); cekle.ExecuteNonQuery(); connection.Close(); MessageBox.Show("KAYIT BAŞARILI"); this.Close(); anasayfa a = Application.OpenForms["anasayfa"] as anasayfa; a.uyelerListele(); } }
private void btnDemirbasKaydet_Click_1(object sender, EventArgs e) { if (textBox2.Text == "" || numericUpDown1.Text == "0") { System.Windows.Forms.MessageBox.Show("LÜTFEN YILDIZLI ALANLARI DOLDURUNUZ !"); } else { connection.Open(); SqlCommand cekle = new SqlCommand("insert into Demirbaslar (demirbas_ad,demirbas_adet,demirbas_cins,demirbas_yil) values (@prmtr2,@prmtr3,@prmtr4,@prmtr5)", connection); cekle.Parameters.AddWithValue("@prmtr2", textBox2.Text); cekle.Parameters.AddWithValue("@prmtr3", numericUpDown1.Text); cekle.Parameters.AddWithValue("@prmtr4", textBox4.Text); cekle.Parameters.AddWithValue("@prmtr5", dateTimePicker1.Text); cekle.ExecuteNonQuery(); connection.Close(); System.Windows.Forms.MessageBox.Show("Kayıt Başarılı", "Bilgi"); this.Close(); anasayfa a = System.Windows.Forms.Application.OpenForms["anasayfa"] as anasayfa; a.demirbasListele(); } }
private void log_in() { try { baglanti.Open(); SqlCommand sorgu = new SqlCommand("SELECT * FROM login order by kAdi,kSifre", baglanti); SqlDataReader datare; datare = sorgu.ExecuteReader(); while (datare.Read()) { string a = Convert.ToString(username.Text); string b = Convert.ToString(userpassword.Text); if (a == datare[1].ToString() && b == datare[2].ToString()) { anasayfa anaform = new anasayfa(); anaform.Show(); this.Hide(); } else { System.Windows.Forms.MessageBox.Show("Kullanıcı adı veya şifre hatalı", "HATA"); } } datare.Close(); baglanti.Close(); } catch (Exception hata) { System.Windows.Forms.MessageBox.Show(hata.Message); } }
private void btnProjeKaydet_Click(object sender, EventArgs e) { if (textBox3.Text == "" || textBox2.Text == "" || textBox4.Text == "" || textBox7.Text == "" || comboBox1.Text == "" || textBox6.Text == "" || textBox5.Text == "") { System.Windows.Forms.MessageBox.Show("LÜTFEN YILDIZLI ALANLARI DOLDURUNUZ"); } else { connection.Open(); SqlCommand cekle = new SqlCommand("insert into Projeler (proje_ad,proje_konu,proje_aciklama,proje_yil,yapan_ad,yapan_soyad,yapan_sinif,yapan_no) values (@prmtr2,@prmtr3,@prmtr4,@prmtr5,@prmtr6,@prmtr7,@prmtr8,@prmtr9)", connection); cekle.Parameters.AddWithValue("@prmtr2", textBox2.Text); cekle.Parameters.AddWithValue("@prmtr3", textBox3.Text); cekle.Parameters.AddWithValue("@prmtr4", textBox4.Text); cekle.Parameters.AddWithValue("@prmtr5", dateTimePicker1.Text); cekle.Parameters.AddWithValue("@prmtr6", textBox7.Text); cekle.Parameters.AddWithValue("@prmtr7", textBox6.Text); cekle.Parameters.AddWithValue("@prmtr8", comboBox1.Text); cekle.Parameters.AddWithValue("@prmtr9", textBox5.Text); cekle.ExecuteNonQuery(); connection.Close(); System.Windows.Forms.MessageBox.Show("KAYIT İŞLEMİ BAŞARILI"); this.Close(); anasayfa a = System.Windows.Forms.Application.OpenForms["anasayfa"] as anasayfa; a.projeListele(); } }
private void btnEtkinlikKaydet_Click(object sender, EventArgs e) { //etkinlik ekleme kodları buraya yazılacak if (txtAdi.Text == "" || txtKonu.Text == "" || txtYer.Text == "") { System.Windows.Forms.MessageBox.Show("LÜTFEN YILDIZLI ALANLARI DOLDURUNUZ !"); } else { connection.Open(); SqlCommand cekle = new SqlCommand("insert into Etkinlik (etkinlik_ad,etkinlik_konu,etkinlik_konusmaci,etkinlik_yer,etkinlik_tarih) values (@prmtr2,@prmtr3,@prmtr4,@prmtr5,@prmtr6)", connection); cekle.Parameters.AddWithValue("@prmtr2", txtAdi.Text); cekle.Parameters.AddWithValue("@prmtr3", txtKonu.Text); cekle.Parameters.AddWithValue("@prmtr4", txtKonusmacilar.Text); cekle.Parameters.AddWithValue("@prmtr5", txtYer.Text); cekle.Parameters.AddWithValue("@prmtr6", dateTimePicker1.Text); cekle.ExecuteNonQuery(); connection.Close(); System.Windows.Forms.MessageBox.Show("KAYIT İŞLEMİ BAŞARILI"); this.Close(); anasayfa a = System.Windows.Forms.Application.OpenForms["anasayfa"] as anasayfa; a.etkinlikListele(); } }
private void btnEtkinlikGuncelle_Click(object sender, EventArgs e) { connection.Open(); SqlCommand guncelle = new SqlCommand("update Etkinlik set etkinlik_ad='" + txtAdi.Text + "' , etkinlik_konu='" + txtKonu.Text + "' , etkinlik_konusmaci='" + txtKonusmacilar.Text + "' , etkinlik_yer='" + txtYer.Text + "' , etkinlik_tarih='" + dateTimePicker1.Text + "' where etkinlik_id='" + _ID + "'", connection); guncelle.ExecuteNonQuery(); connection.Close(); System.Windows.Forms.MessageBox.Show("Kayıt Değiştirildi"); this.Close(); anasayfa a = System.Windows.Forms.Application.OpenForms["anasayfa"] as anasayfa; a.etkinlikListele(); }
private void btnDemirbasGuncelle_Click_1(object sender, EventArgs e) { connection.Open(); SqlCommand guncelle = new SqlCommand("update Demirbaslar set demirbas_ad='" + textBox2.Text + "' , demirbas_adet='" + numericUpDown1.Text + "', demirbas_cins='" + textBox4.Text + "' where demirbas_id='" + _ID + "'", connection); guncelle.ExecuteNonQuery(); connection.Close(); System.Windows.Forms.MessageBox.Show("Kayıt Güncellendi", "Bilgi"); this.Close(); anasayfa a = System.Windows.Forms.Application.OpenForms["anasayfa"] as anasayfa; a.demirbasListele(); }
private void btnGuncelle_Click_1(object sender, EventArgs e) { connection.Open(); SqlCommand guncelle = new SqlCommand("update Uyeler set uye_ad='" + textBox2.Text + "',uye_soyad='" + textBox3.Text + "',uye_sinif='" + textBox4.Text + "',uye_gorev='" + textBox5.Text + "' where uye_id='" + textBox1.Text + "'", connection); guncelle.ExecuteNonQuery(); connection.Close(); MessageBox.Show("Kayıt Değiştirildi"); anasayfa k = Application.OpenForms["anasayfa"] as anasayfa; k.kadroListele(); this.Close(); }
private void btnProjeGuncelle_Click(object sender, EventArgs e) { connection.Open(); SqlCommand guncelle = new SqlCommand("update Projeler set proje_ad='" + textBox2.Text + "', proje_konu='" + textBox3.Text + "' , proje_aciklama='" + textBox4.Text + "', proje_yil='" + dateTimePicker1.Text + "' , yapan_ad='" + textBox7.Text + "' , yapan_soyad='" + textBox6.Text + "' , yapan_sinif='" + comboBox1.Text + "' , yapan_no='" + textBox5.Text + "' where proje_id='" + _ID + "'", connection); guncelle.ExecuteNonQuery(); connection.Close(); System.Windows.Forms.MessageBox.Show("Kayıt Değiştirildi"); this.Close(); anasayfa a = System.Windows.Forms.Application.OpenForms["anasayfa"] as anasayfa; a.projeListele(); }
private void btnGuncelle_Click_1(object sender, EventArgs e) { connection.Open(); SqlCommand guncelle = new SqlCommand("update Uyeler set uye_ad='" + textBox1.Text + "',uye_soyad='" + textBox2.Text + "',uye_sinif='" + comboBox1.Text + "',uye_no='" + textBox4.Text + "',uye_adres='" + textBox5.Text + "',uye_telefon='" + maskedTextBox1.Text + "',uye_kayitucreti='" + textBox6.Text + "',uye_gorev='" + textBox7.Text + "',uye_resim='" + label8.Text + "' where uye_id='" + _ID + "'", connection); guncelle.ExecuteNonQuery(); connection.Close(); MessageBox.Show("Kayıt Değiştirildi"); this.Close(); anasayfa a = Application.OpenForms["anasayfa"] as anasayfa; a.uyelerListele(); a.kadroListele(); }
private void button1_Click(object sender, EventArgs e) { connection.Open(); SqlCommand guncelle = new SqlCommand("update Kasa set kasa_alinan='" + textBox3.Text + "' , kasa_aciklama='" + textBox5.Text + "' , kasa_yetkili='" + textBox2.Text + "' , kasa_tarihi='" + dateTimePicker1.Text + "' where kasa_id='" + _ID + "'", connection); guncelle.ExecuteNonQuery(); connection.Close(); System.Windows.Forms.MessageBox.Show("Kayıt Güncellendi"); this.Close(); anasayfa a = System.Windows.Forms.Application.OpenForms["anasayfa"] as anasayfa; a.kasaListele(); }
private void btnEtkinlikKaydet_Click(object sender, EventArgs e) { if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "") { System.Windows.Forms.MessageBox.Show("LÜTFEN YILDIZLI ALANLARI DOLDURUNUZ"); } else { int kalanbutce = 0; connection.Open(); SqlCommand bul = new SqlCommand("select kalan_butce FROM Kasa WHERE kasa_id=(select TOP 1 kasa_id from Kasa ORDER BY kasa_id DESC )", connection); SqlDataReader drEd = bul.ExecuteReader(); if (drEd.Read()) { kalanbutce = Convert.ToInt32(drEd["kalan_butce"]); } drEd.Close(); SqlCommand cekle = new SqlCommand("insert into Kasa (kasa_turu,kasa_tutar,kasa_alinan,kasa_aciklama,kasa_yetkili,kasa_tarihi,kalan_butce) values (@prmtr2,@prmtr3,@prmtr4,@prmtr5,@prmtr6,@prmtr7,@prmtr8)", connection); kalanbutce -= Convert.ToInt32(textBox1.Text); cekle.Parameters.AddWithValue("@prmtr2", "HARCAMA"); cekle.Parameters.AddWithValue("@prmtr3", textBox1.Text); cekle.Parameters.AddWithValue("@prmtr4", textBox3.Text); cekle.Parameters.AddWithValue("@prmtr5", textBox5.Text); cekle.Parameters.AddWithValue("@prmtr6", textBox2.Text); cekle.Parameters.AddWithValue("@prmtr7", dateTimePicker1.Text); cekle.Parameters.AddWithValue("@prmtr8", kalanbutce); cekle.ExecuteNonQuery(); connection.Close(); System.Windows.Forms.MessageBox.Show("Kayıt Başarılı", "Bilgi"); this.Close(); anasayfa a = System.Windows.Forms.Application.OpenForms["anasayfa"] as anasayfa; a.kasaListele(); } }