/* Satilik Ev Güncelleme */ private void btnSaleUpdate_Click(object sender, EventArgs e) { if (txtSaleId.Text.Length > 0) { var dialogWindow = MessageBox.Show("Satılık Ev Güncellemek İstiyor Musunuz ?", "Bilgi Kutusu", MessageBoxButtons.YesNo); if (dialogWindow == DialogResult.Yes) { SaleHouse updateHouse = saleHouseOperations.GetById(txtSaleId.Text); SaleHouse saleHouse = new SaleHouse(); saleHouse.Id = txtSaleId.Text; saleHouse.RoomCount = Convert.ToInt32(txtSaleRoomCount.Value); saleHouse.FloorNumber = Convert.ToInt32(txtSaleFloorNumber.Value); saleHouse.District = txtSaleDistrict.Text; saleHouse.Area = txtSaleArea.Text; saleHouse.CreateDate = Convert.ToDateTime(txtSaleCreatedDate.Text); saleHouse.Type = ConvertHouseType.GetHouseType(txtSaleType.Text); saleHouse.IsEnabled = Convert.ToBoolean(txtSaleEnabled.Checked); saleHouse.SalePrice = Convert.ToDecimal(txtSalePrice.Value); saleHouseOperations.Update(updateHouse, saleHouse); MessageBox.Show("Satılık Ev Güncellendi."); FillSaleHouseList(); } } else { MessageBox.Show("Lütfen Bir Ev Seçiniz."); } }
private void btnUpdate_Click(object sender, EventArgs e) { if (type == "Kiralik") { var dialogWindow = MessageBox.Show("Kiralık Ev Güncellemek İstiyor Musunuz ?", "Bilgi Kutusu", MessageBoxButtons.YesNo); if (dialogWindow == DialogResult.Yes) { RentHouse updateHouse = rentHouseOperations.GetById(txtId.Text); RentHouse rentHouse = new RentHouse(); rentHouse.Id = txtId.Text; rentHouse.RoomCount = Convert.ToInt32(txtRoomCount.Value); rentHouse.FloorNumber = Convert.ToInt32(txtFloorNumber.Value); rentHouse.District = txtDistrict.Text; rentHouse.Area = txtArea.Text; rentHouse.CreateDate = Convert.ToDateTime(txtCreatedDate.Text); rentHouse.Type = ConvertHouseType.GetHouseType(txtType.Text); rentHouse.IsEnabled = Convert.ToBoolean(txtEnabled.Checked); rentHouse.RentPrice = Convert.ToDecimal(txtRentPrice.Value); rentHouse.RentDeposit = Convert.ToDecimal(txtRentDeposit.Value); rentHouseOperations.Update(updateHouse, rentHouse); MessageBox.Show("Kiralık Ev Güncellendi."); this.Hide(); } } else { var dialogWindow = MessageBox.Show("Satılık Ev Güncellemek İstiyor Musunuz ?", "Bilgi Kutusu", MessageBoxButtons.YesNo); if (dialogWindow == DialogResult.Yes) { SaleHouse updateHouse = saleHouseOperations.GetById(txtId.Text); SaleHouse saleHouse = new SaleHouse(); saleHouse.Id = txtId.Text; saleHouse.RoomCount = Convert.ToInt32(txtRoomCount.Value); saleHouse.FloorNumber = Convert.ToInt32(txtFloorNumber.Value); saleHouse.District = txtDistrict.Text; saleHouse.Area = txtArea.Text; saleHouse.CreateDate = Convert.ToDateTime(txtCreatedDate.Text); saleHouse.Type = ConvertHouseType.GetHouseType(txtType.Text); saleHouse.IsEnabled = Convert.ToBoolean(txtEnabled.Checked); saleHouse.SalePrice = Convert.ToDecimal(txtSalePrice.Value); saleHouseOperations.Update(updateHouse, saleHouse); MessageBox.Show("Satılık Ev Güncellendi."); this.Hide(); } } }