private void btnUpdate_Click(object sender, EventArgs e) { //Validate Data if (txtDVDId.Text.Equals("") || txtDVDTitle.Text.Equals("") || txtDVDDescription.Text.Equals("") || txtDVDYearRelease.Text.Equals("") || txtRateCode.Text.Equals("")) { MessageBox.Show("All field must be entered.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); txtDVDId.Focus(); return; } //instantiate Rate Object DVD myDVD = new DVD(); myDVD.setDVDId(Convert.ToInt32(txtDVDId.Text)); myDVD.setTitle(txtDVDTitle.Text); myDVD.setDescription(txtDVDDescription.Text); myDVD.setYear(Convert.ToInt32(txtDVDYearRelease.Text)); myDVD.setRateCode(txtRateCode.Text); //INSERT DVD record into table myDVD.updDVD(); //Display Confirmation Message MessageBox.Show("DVD has been Updated.", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); //Reset UI grpDVD.Visible = false; cboDVD.SelectedIndex = -1; }