Beispiel #1
0
 private void btnADD_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(numSize.Value.ToString()) || String.IsNullOrWhiteSpace(numFloor.Value.ToString()) || String.IsNullOrWhiteSpace(numRoomCount.Value.ToString()) || String.IsNullOrWhiteSpace(numDoorNumber.Value.ToString()) || String.IsNullOrWhiteSpace(txtStreet.Text.ToString()))
     {
         MessageBox.Show("Boş değer girdisi algılandı lütfen değerleri kontrol ediniz", "Girdilerde Hata Tespit Edildi..");
     }
     else
     {
         Core.Adress.Adress Adress = new Core.Adress.Adress()
         {
             City       = cmbCities.SelectedItem.ToString(),
             District   = cmbDisc.SelectedItem.ToString(),
             Street     = txtStreet.Text,
             DoorNumber = numDoorNumber.Value.ToString()
         };
         if (rdSaleTrue.Checked == true)
         {
             Core.SaleHouse newSaleHouse = new Core.SaleHouse((int)numRoomCount.Value, (int)numFloor.Value, (double)numSize.Value, (Core.House.Type)cmbHouseType.SelectedItem, dateTimePicker1.Value, true, false, false, (double)numSellorDeposit.Value, Adress);
             Core.Util.HaveHouses.getInstance().AddList(newSaleHouse);
         }
         else
         {
             Core.RentHouse newRentHouse = new Core.RentHouse((int)numRoomCount.Value, (int)numFloor.Value, (double)numSize.Value, (Core.House.Type)cmbHouseType.SelectedItem, dateTimePicker1.Value, true, false, false, (double)numSellorDeposit.Value, Adress);
             Core.Util.HaveHouses.getInstance().AddList(newRentHouse);
         }
         MessageBox.Show("Ev Kaydedildi");
     }
 }
Beispiel #2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(numSize.Value.ToString()) || String.IsNullOrWhiteSpace(numFloor.Value.ToString()) || String.IsNullOrWhiteSpace(numRoomCount.Value.ToString()) || String.IsNullOrWhiteSpace(numDoorNumber.Value.ToString()) || String.IsNullOrWhiteSpace(txtStreet.Text.ToString()))
            {
                MessageBox.Show("Boş değer girdisi algılandı lütfen değerleri kontrol ediniz", "Girdilerde Hata Tespit Edildi..");
            }
            else
            {
                Core.RentHouse     rt     = have.FindRent(privateNumber);
                Core.SaleHouse     sl     = have.FindSale(privateNumber);
                Core.Adress.Adress Adress = new Core.Adress.Adress()
                {
                    City       = cmbCities.SelectedItem.ToString(),
                    District   = cmbDisc.SelectedItem.ToString(),
                    Street     = txtStreet.Text,
                    DoorNumber = numDoorNumber.Value.ToString()
                };

                if (houseType == 0)
                {
                    rt.RoomCount   = (int)numRoomCount.Value;
                    rt.FloorNumber = (int)numFloor.Value;
                    rt.HouseSize   = (int)numSize.Value;
                    rt.BuildDate   = (DateTime)dateTimePicker1.Value;
                    rt.HouseType   = (Core.House.Type)cmbHouseType.SelectedItem;
                    rt.RentPrice   = (double)numRentPrice.Value;
                    rt.RentDeposit = (double)numSellorDeposit.Value;
                    rt.Adress      = null;
                    rt.Adress      = Adress;
                }
                else
                {
                    sl.RoomCount   = (int)numRoomCount.Value;
                    sl.FloorNumber = (int)numFloor.Value;
                    sl.HouseSize   = (int)numSize.Value;
                    sl.BuildDate   = (DateTime)dateTimePicker1.Value;
                    sl.HouseType   = (Core.House.Type)cmbHouseType.SelectedItem;
                    sl.SalePrice   = (double)numSellorDeposit.Value;
                    sl.Adress      = null;
                    sl.Adress      = Adress;
                }
                MessageBox.Show("Ürün başarılı bir şekilde düzenlendi...", "Düzenleme başarılı olmuştur");
            }
        }