Bonjour,
private void button1_Click_1(object sender, EventArgs e)
{
try
{
cnx.Open();
string req = "UPDATE CLIENT SET CIN = '" + txtCin.Text + "',NOM_PRENOM = '" + txtPrenm.Text + "' WHERE ID_CLIENT = (SELECT C.ID_CLIENT FROM RECU R, CLIENT C where C.ID_CLIENT = R.ID_CLIENT and R.N_RECU = '" + txtNrecuRech.Text + "' and NATURE_RECETTE = 'Note de Renseignement')";
cmd = new SqlCommand(req, cnx);
dr = cmd.ExecuteReader();
DataTable DT1 = new DataTable();
DT1.Load(dr);
cnx.Close();
dr.Close();
actualiser_DATA();
MessageBox.Show("Bien modifié ! ", "Note", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
cnx.Open();
SqlCommand cmd2 = new SqlCommand("TEST_CRYS", cnx);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter oParam1 = cmd2.Parameters.Add("@N_RECU", SqlDbType.Char, 50, "N_RECU");
oParam1.Value = txtNrecuRech.Text;
DataTable dt = new DataTable();
dr = cmd2.ExecuteReader();
dt.Load(dr);
if (txtModePaiement.Text == "Chèque")
{
NR_CHEQUE crys = new NR_CHEQUE();
crys.SetDataSource(dt);
IMPRIMER_MODIFICATION_NR_CHEQUE NR_CHEREQUE = new IMPRIMER_MODIFICATION_NR_CHEQUE();
NR_CHEREQUE.crystalReportViewer1.ReportSource = crys;
NR_CHEREQUE.crystalReportViewer1.Refresh();
NR_CHEREQUE.Show();
}
cnx.Close();
dr.Close();
}
catch (Exception ee)
{
MessageBox.Show("Erreur : " + ee.Message);
}
finally
{
txtCin.Clear();
txtPrenm.Clear();
}