private void btnPay_Click(object sender, EventArgs e) { DBConnect pay = new DBConnect(); bool success = false;; if (cmbPaymentOption.SelectedItem.ToString() == "Deposit") { success = pay.MakePayment(int.Parse(txtBookingNo.Text), cmbPaymentOption.Text, double.Parse(lblDeposit.Text, System.Globalization.NumberStyles.Currency), cmbPaymentMethods.Text, DateTime.Now); } else if (cmbPaymentOption.SelectedItem.ToString() == "Total") { success = pay.MakePayment(int.Parse(txtBookingNo.Text), cmbPaymentOption.Text, double.Parse(lblTotalAmount.Text, System.Globalization.NumberStyles.Currency), cmbPaymentMethods.Text, DateTime.Now); } if (success == true) { MessageBox.Show("The payment process has been made successfully", "Successful Payment", MessageBoxButtons.OK, MessageBoxIcon.Information); this.reportViewer1.Visible = true; this.reportViewer1.Enabled = true; // TODO: This line of code loads data into the 'DataSet3.DataTable1' table. You can move, or remove it, as needed. this.DataTable1TableAdapter.Fill(this.DataSet3.DataTable1); this.reportViewer1.RefreshReport(); } else { MessageBox.Show("Making payment process is faild", "Faild Payment", MessageBoxButtons.OK, MessageBoxIcon.Error); } }