private void frmUcusListe_Load(object sender, EventArgs e) { UcusBL ubl = new UcusBL(); dt = ubl.UcusBilgileriTable3(); grdUcusBilgileri.DataSource = dt; ubl.Dispose(); UcakBL ucbl = new UcakBL(); clmUcak.DataSource = ucbl.UcakListesi(); clmUcak.DisplayMember = "Ucak_Adi"; clmUcak.ValueMember = "Id_Ucak"; ucbl.Dispose(); HavayoluBL hbl = new HavayoluBL(); clmHavayolu.DataSource = hbl.HavayoluListesi(); clmHavayolu.DisplayMember = "Havayolu_Adi"; clmHavayolu.ValueMember = "Id_Havayolu"; hbl.Dispose(); HavaalaniBL habl = new HavaalaniBL(); clmKalkisYeri.DataSource = habl.HavaalaniListesi(); clmKalkisYeri.DisplayMember = "Yer_Adi"; clmKalkisYeri.ValueMember = "Id_Yer"; clmVarisYeri.DataSource = habl.HavaalaniListesi(); clmVarisYeri.DisplayMember = "Yer_Adi"; clmVarisYeri.ValueMember = "Id_Yer"; habl.Dispose(); }
private void btnSil_Click(object sender, EventArgs e) { DialogResult cvp = MessageBox.Show("Kayıt Silinecek. Eminminisiniz?", "Silme Onayı", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (cvp == DialogResult.Yes) { HavaalaniBL hbl = new HavaalaniBL(); if (hbl.HavaalaniSil(id_havaalani)) { MessageBox.Show("Silme Başarılı!"); Temizle(); } else { MessageBox.Show("Silme hatalı!"); } hbl.Dispose(); } else { MessageBox.Show("İşlem İptal Edildi!"); Temizle(); } }
private void frmHavaalaniListe_Load(object sender, EventArgs e) { HavaalaniBL hbl = new HavaalaniBL(); dt = hbl.HavaalanlariTable(); grdHavaalanlari.DataSource = dt; hbl.Dispose(); }
private void frmHavaalaniBul_Load(object sender, EventArgs e) { HavaalaniBL hy = new HavaalaniBL(); cmbHavaalani.DisplayMember = "Yer_Adi"; cmbHavaalani.ValueMember = "Id_Yer"; cmbHavaalani.DataSource = hy.HavaalaniListesi(); }
private void btnEkle_Click(object sender, EventArgs e) { try { HavaalaniBL hbl = new HavaalaniBL(); Havaalani ha = new Havaalani(); ha.Id_Yer = txtHavaalaniID.Text.Trim(); ha.Yer_Adi = txtHavaalaniAdi.Text.Trim(); if (id_havaalani == null) { MessageBox.Show(hbl.HavaalaniKaydet(ha) ? "Başarılı" : "Başarısız"); Temizle(); } else { if (hbl.HavaalaniGuncelle(ha)) { id_havaalani = null; Temizle(); MessageBox.Show("Güncelleme Başarılı"); } else { MessageBox.Show("Güncelleme Başarısız!"); } } } catch (SqlException ex) { switch (ex.Number) { default: MessageBox.Show("Veritabanı Hatası" + ex.Number); break; } } catch (Exception) { MessageBox.Show("Bilinmeyen Hata!!"); } }
private void btnBul_Click(object sender, EventArgs e) { HavaalaniBL hbl = new HavaalaniBL(); Havaalani ha = hbl.HavaalaniBul((string)cmbHavaalani.SelectedValue); if (ha == null) { MessageBox.Show("Havaalani Bulunamadı"); } else { frm.txtHavaalaniID.Text = ha.Id_Yer; frm.txtHavaalaniAdi.Text = ha.Yer_Adi; frm.id_havaalani = ha.Id_Yer; frm.btnVazgec.Visible = true; frm.btnSil.Visible = true; frm.lblID.Cursor = Cursors.No; frm.txtHavaalaniID.Enabled = false; frm.btnEkle.Text = "Guncelle"; this.Close(); } }
private void btnKaydet_Click(object sender, EventArgs e) { HavaalaniBL hbl = new HavaalaniBL(); foreach (DataRow item in dt.Rows) { Havaalani h = new Havaalani(); if (item.RowState != DataRowState.Deleted) { h.Id_Yer = item[0].ToString(); h.Yer_Adi = item[2].ToString(); } switch (item.RowState) { case DataRowState.Added: hbl.HavaalaniKaydet(h); MessageBox.Show("Eklendi"); break; case DataRowState.Deleted: hbl.HavaalaniSil((string)(item[0, DataRowVersion.Original])); MessageBox.Show("Silindi"); break; case DataRowState.Modified: h.Id_Yer = item[0].ToString(); hbl.HavaalaniGuncelle(h); MessageBox.Show("Guncellendi"); break; default: break; } } }
public void Form1_Load(object sender, EventArgs e) { HavayoluBL hy = new HavayoluBL(); cmbHavayolu.DisplayMember = "Havayolu_Adi"; cmbHavayolu.ValueMember = "Id_Havayolu"; cmbHavayolu.DataSource = hy.HavayoluListesi(); HavaalaniBL ha = new HavaalaniBL(); cmbKalkis.DisplayMember = "Yer_Adi"; cmbKalkis.ValueMember = "Id_Yer"; cmbKalkis.DataSource = ha.HavaalaniListesi(); cmbVaris.DisplayMember = "Yer_Adi"; cmbVaris.ValueMember = "Id_Yer"; cmbVaris.DataSource = ha.HavaalaniListesi(); UcakBL uc = new UcakBL(); cmbUcak.DisplayMember = "Ucak_Adi"; cmbUcak.ValueMember = "Id_Ucak"; cmbUcak.DataSource = uc.UcakListesi(); }