private void btnEditBooking_Click(object sender, EventArgs e) { try { if (txtBookingId.Text != "") { BookingView previusForm = new BookingView(Int32.Parse(txtBookingId.Text), true); this.Hide(); previusForm.ShowDialog(); this.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button1_Click(object sender, EventArgs e) { try { if (txtCustomerId.Text != "" || txtCustomerId.GetType() == typeof(int)) { BookingView nextForm = new BookingView(Convert.ToInt32(txtCustomerId.Text)); this.Hide(); nextForm.ShowDialog(); this.Close(); } else { lblMessage2.Text = "Select the customer Id from Table"; } } catch (Exception ex) { lblMessage2.Text = ex.Message; } }