Académique Documents
Professionnel Documents
Culture Documents
//SUPPRIMER
private void btnSupL_Click(object sender, EventArgs e)
{
if(dataGridView1.Rows != null && dataGridView1.Rows.Count != 0)
{
dataGridView1.Rows.RemoveAt(dataGridView1.CurrentCell.RowIndex);
sum();
}
else
{
MessageBox.Show("you cannot delete because it s already empty");
// ENREGISTRER
private void btnSave_Click(object sender, EventArgs e)
{
try
{
this.mainForm.StartTimer1();
CmdMaj = new SqlCommand("insert into Commande values('" +
txtNumC.Text + "','" + dateTimePicker1.Value + "','" + comboClient.Text + "')",
con);
con.Open();
CmdMaj.ExecuteNonQuery();
con.Close();
}
catch (SqlException )
{
this.mainForm.StartTimer2();
}
finally {
if (con.State == ConnectionState.Open)
con.Close();
initialiser();