public TozCırpmaEkle(Yetkili yetkili_, TozCırpmaMakine makine) { InitializeComponent(); Temp = makine; cırpmaOperation = new BLLCırpmaOperation(); yetkili = yetkili_; musteriOperation = new BLLMusteriOperation(); this.Text = "ÇIRPMA MAKİNE GÜNCELLE"; }
private void byn_kaydet_Click_1(object sender, EventArgs e) { int returnValue = 0; if (Temp != null) { TempDoldur(); returnValue = cırpmaOperation.Guncelle(Temp.ID, Temp, yetkili); if (returnValue > 0) { MessageBox.Show($"{Temp.Te_MusteriAdi}' ye ait Çırpma Makinesi Güncellendi.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else { MessageBox.Show("Güncelleme Sırasında Hata Oluştu Tekrar Deneyiniz.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { Temp = new TozCırpmaMakine(); Temp.ID = Guid.NewGuid(); Temp.MusteriID = musteri.ID; TempDoldur(); returnValue = cırpmaOperation.Kaydet(Temp, yetkili); if (returnValue > 0) { MessageBox.Show($"{Temp.Te_MusteriAdi}' Firma/Kişisine ait '{Temp.Te_UretimNo}' 'Üretim Numaralı Çırpma Makinesi Başarıyla Eklendi", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtBosalt(); } else { MessageBox.Show("İşlem Sırasında Hata Oluştu", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }