private void dbtncancelbooking_Click(object sender, EventArgs e) { frmcancelbooking frmcancel = new frmcancelbooking(); frmcancel.MdiParent = this; frmcancel.Show(); }
private void btndelete_Click(object sender, EventArgs e) { if (txtID.Text == "") { MessageBox.Show("Booked ID is mising"); this.Close(); frmcancelbooking can = new frmcancelbooking(); can.Show(); } int BookID = Convert.ToInt32(txtID.Text); string RName = Convert.ToString(txtRName.Text); int i = 0; i = booking.CancelBooking(BookID, RName); if (i > 0) { MessageBox.Show("Successfully deleted"); DataTable dt = booking.DescendingView(); dgvCancelview.Refresh(); dgvCancelview.DataSource = dt; if (dt.Rows.Count > 0) { dgvCancelview.DataSource = dt; } else { MessageBox.Show("No Records Found !!!"); } } else { if (txtID.Text == "") { MessageBox.Show("Booked ID is mising"); } else if (txtRName.Text == "") { MessageBox.Show("Registrant name is mising"); } else if (txtID.Text == "" && txtRName.Text == "") { MessageBox.Show("Booked ID & Registrant name is mising"); } else { MessageBox.Show("Unsuccessfull to delete.Please Try again."); } } }