private void btnKaydet_Click(object sender, EventArgs e) { if (musteriIDsi == -1 || dtSatis.Rows.Count == 0) // hiçbir ürün yoksa sondaki { MessageBox.Show("Gerekli bilgileri doldurunuz!"); return; } Entities.SATIS d = new Entities.SATIS(); DataLogic.SATIS satis = new DataLogic.SATIS(); d.MusteriID = musteriIDsi; d.Tarih = Convert.ToDateTime(dateTimePicker1.Value.ToShortDateString()); tutarBul(); d.ToplamTutar = genelTutar; d.SorumluID = sorumluID; if (satis.satisEkle(d, dtSatis) == 111) { MessageBox.Show("Başarıyla kaydedildi."); a.Show(); this.Close(); } }
private void IslemlerListesi_Load(object sender, EventArgs e) { DataTable dt = new DataTable(); DataLogic.SATIS satislar = new DataLogic.SATIS(); dt = satislar.getirSatislar(); dataGridView1.DataSource = dt; }