1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| private void button3_Click(object sender, EventArgs e)
{
try
{
if (txtdate.Text == "" || txtlibelle.Text == "" || txtmontant.Text == "" || cbocomptable.Text == "")
{
MessageBox.Show("Les informations incomplètes");
}
else
{
int IdSortie = Convert.ToInt32(txtidsortie.Text);
string Libelle = txtlibelle.Text;
int Montant = Convert.ToInt32(txtmontant.Text);
string DateSortie = txtdate.Text;
int Comptable = Convert.ToInt32(cbocomptable.Text);
string Req = "update T_Sortie set Libelle='" + Libelle + "',Montant=" + Montant + ",DateSrtie='" + DateSortie + "',Comptable=" + Comptable + " where IdSortie=" + IdSortie + "";
cl.envoyerdata(Req);
afficher();
this.t_SortieTableAdapter.Fill(this.bd_kayalubilDataSet9.T_Sortie);
MessageBox.Show("Modifier avec succès!!!");
txtidsortie.Text = "";
txtdate.Text = "";
txtlibelle.Text = "";
txtmontant.Text = "";
cbocomptable.Text = "";
txtidsortie.Text = "";
txtdate.Focus();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
} |
Partager