private void btnDelete_Click(object sender, EventArgs e) { if (type == "Kiralik") { var dialogWindow = MessageBox.Show("Kiralık Ev Silmek İstiyor Musunuz ?", "Bilgi Kutusu", MessageBoxButtons.YesNo); if (dialogWindow == DialogResult.Yes) { RentHouse deleteHouse = rentHouseOperations.GetById(txtId.Text); string path = Application.StartupPath + "/HouseImages/RentHouses/"; GeneratorFolder generatorFolder = new GeneratorFolder(); generatorFolder.DeleteFolder(path, txtId.Text); rentHouseOperations.Delete(deleteHouse); MessageBox.Show("Kiralık Ev Silindi."); this.Hide(); } } else { var dialogWindow = MessageBox.Show("Satılık Ev Silmek İstiyor Musunuz ?", "Bilgi Kutusu", MessageBoxButtons.YesNo); if (dialogWindow == DialogResult.Yes) { SaleHouse deleteHouse = saleHouseOperations.GetById(txtId.Text); string path = Application.StartupPath + "/HouseImages/SaleHouses/"; GeneratorFolder generatorFolder = new GeneratorFolder(); generatorFolder.DeleteFolder(path, txtId.Text); saleHouseOperations.Delete(deleteHouse); MessageBox.Show("Satılık Ev Silindi."); this.Hide(); } } }
/* Satilik Ev Silme */ private void btnSaleDelete_Click(object sender, EventArgs e) { if (txtSaleId.Text.Length > 0) { var dialogWindow = MessageBox.Show("Satılık Ev Silmek İstiyor Musunuz ?", "Bilgi Kutusu", MessageBoxButtons.YesNo); if (dialogWindow == DialogResult.Yes) { SaleHouse deleteHouse = saleHouseOperations.GetById(txtSaleId.Text); string path = Application.StartupPath + "/HouseImages/SaleHouses/"; GeneratorFolder generatorFolder = new GeneratorFolder(); generatorFolder.DeleteFolder(path, txtSaleId.Text); saleHouseOperations.Delete(deleteHouse); MessageBox.Show("Satılık Ev Silindi."); txtSaleId.Text = ""; FillSaleHouseList(); } } else { MessageBox.Show("Lütfen Bir Ev Seçiniz."); } }