private void KiralaButon_Click(object sender, EventArgs e) { tabControl1.SelectTab(OdemePage); byte[] resim = BLL_Arac.AracResimGetir(PlakaLabel.Text); if (resim != null) { MemoryStream mem = new MemoryStream(resim); O_PictureBox.Image = Image.FromStream(mem); } }
private void AracGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) // SEÇİLEN ARACI SİLME - ARAÇ RESMİ GÖRÜNTÜLEME { if (e.ColumnIndex == 0) { string plaka = AracGridView.Rows[e.RowIndex].Cells["Plaka"].Value.ToString(); byte[] resim = BLL_Arac.AracResimGetir(plaka); if (resim == null) { MessageBox.Show("Araç resmi bulunmamaktadır.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MemoryStream mem = new MemoryStream(resim); AracResimForm resimformu = new AracResimForm(); resimformu.AracResimPictureBox.Image = Image.FromStream(mem); resimformu.Text = plaka + " - Resim"; resimformu.ShowDialog(); } } else if (e.ColumnIndex == 1) { string plaka = AracGridView.Rows[e.RowIndex].Cells["Plaka"].Value.ToString(); if (AracGridView.Rows[e.RowIndex].Cells["Durum"].Value.ToString() == "Kirada") { MessageBox.Show("Araç kirada olduğundan işleminiz gerçekleştirilmedi.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { DialogResult result = MessageBox.Show(plaka + " Plakalı aracı silmek üzeresiniz!\nAracı sildiğiniz takdirde bu plakaya ait tüm bilgiler(Kiralama,İptal Edilenler,Bitenler,Teslim Alınanlar) silinecek ve geri dönüşü olmayacaktır.\nDevam etmek istiyormusunuz ?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (result == DialogResult.Yes) { int durum = BLL_Arac.SubedenAracSil(plaka); if (durum == 0) { MessageBox.Show("İşlem gerçekleştirilirken bir hata oluştu.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (durum > 0) { MessageBox.Show(plaka + " Plakalı araç başarıyla silindi.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information); SubemdekiAraclar(); } } } } else if (e.ColumnIndex == 2) { Presentation.AracGuncelle yeni = new Presentation.AracGuncelle(); yeni.Text = AracGridView.Rows[e.RowIndex].Cells["Plaka"].Value.ToString() + "-Güncelle"; yeni.PlakaLabel.Text = AracGridView.Rows[e.RowIndex].Cells["Plaka"].Value.ToString(); yeni.EskiKMLabel.Text = AracGridView.Rows[e.RowIndex].Cells["Kilometre"].Value.ToString() + " KM"; yeni.EskiUcretLabel.Text = AracGridView.Rows[e.RowIndex].Cells["Ucret"].Value.ToString() + " TL"; yeni.ShowDialog(); SubemdekiAraclar(); } }
private void AracGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0) { if (AracGridView.Rows[e.RowIndex].Cells["Durum"].Value.ToString() == "Kirada") { MessageBox.Show("Seçtiğiniz araç kirada olduğundan işlem yapılamaz.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (AracGridView.Rows[e.RowIndex].Cells["Durum"].Value.ToString() == "Teslim Bekliyor") { MessageBox.Show("Seçtiğiniz araç henüz teslim edilmediğinden işlem yapılamaz.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { AracBilgiGroupBox.Enabled = true; string plaka = AracGridView.Rows[e.RowIndex].Cells["Plaka"].Value.ToString(); PlakaLabel.Text = plaka; KategoriLabel.Text = AracGridView.Rows[e.RowIndex].Cells["Kategori"].Value.ToString(); MarkaLabel.Text = AracGridView.Rows[e.RowIndex].Cells["Marka"].Value.ToString(); ModelLabel.Text = AracGridView.Rows[e.RowIndex].Cells["Model"].Value.ToString(); ModelYilLabel.Text = AracGridView.Rows[e.RowIndex].Cells["ModelYili"].Value.ToString(); MotorHacmiLabel.Text = AracGridView.Rows[e.RowIndex].Cells["Hacim"].Value.ToString(); MotorGucuLabel.Text = AracGridView.Rows[e.RowIndex].Cells["Guc"].Value.ToString(); YakitLabel.Text = AracGridView.Rows[e.RowIndex].Cells["Yakit"].Value.ToString(); SanzimanLabel.Text = AracGridView.Rows[e.RowIndex].Cells["Sanziman"].Value.ToString(); KilometreLabel.Text = AracGridView.Rows[e.RowIndex].Cells["Kilometre"].Value.ToString(); RenkLabel.Text = AracGridView.Rows[e.RowIndex].Cells["Renk"].Value.ToString(); DonanimLabel.Text = AracGridView.Rows[e.RowIndex].Cells["Donanim"].Value.ToString(); if (Session.Yetki == 1) { GunlukUcretLabel.Text = BLL_Arac.UyeUcretiGetir(plaka).ToString(); } else { GunlukUcretLabel.Text = AracGridView.Rows[e.RowIndex].Cells["Ucret"].Value.ToString(); } byte[] resim = BLL_Arac.AracResimGetir(plaka); if (resim != null) { MemoryStream mem = new MemoryStream(resim); AracPictureBox.Image = Image.FromStream(mem); } else { AracPictureBox.Image = null; } } } }
private void TumAraclarGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0) { string aracplaka = TumAraclarGridView.Rows[e.RowIndex].Cells["Plaka"].Value.ToString(); byte[] resim = BLL_Arac.AracResimGetir(aracplaka); if (resim == null) { MessageBox.Show("Araç resmi bulunmamaktadır.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MemoryStream mem = new MemoryStream(resim); AracResimForm resimformu = new AracResimForm(); resimformu.AracResimPictureBox.Image = Image.FromStream(mem); resimformu.Text = aracplaka + " - Resim"; resimformu.ShowDialog(); } } }