Beispiel #1
0
        private void btnRmv_Click(object sender, EventArgs e)
        {
            //instantiate Property Object
            Property myProperty = new Property();

            myProperty.setPropId(Convert.ToInt32(txtPropID.Text));
            myProperty.setRentPerMonth(Convert.ToInt32(txtRent.Text));
            myProperty.setBedrooms(Convert.ToInt32(txtBedrooms.Text));
            myProperty.setStreet(txtAdd1.Text);
            myProperty.setTown(txtAdd2.Text);
            myProperty.setCounty(txtCounty.Text);
            myProperty.setHouseType(txtHouse.Text);
            myProperty.setOwnerId(Convert.ToInt32(txtOwnerId.Text));

            //Set Property record in table as Inactive
            myProperty.rmvProperty();

            //Display Confirmation message
            MessageBox.Show("Property Removed From System", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);

            //Reset UI
            txtRent.Text      = "";
            txtBedrooms.Text  = "";
            txtBathrooms.Text = "";
            txtAdd1.Text      = "";
            txtAdd2.Text      = "";
            txtCounty.Text    = "";
            txtHouse.Text     = "";
            txtOwnerId.Text   = "";
        }