private void btn_Insertion_Click(object sender, EventArgs e) { string Nom = string.Empty; string Code = string.Empty; bool rt = false; if ((txt_CodeSoc.Text == "") || (txt_Soc.Text == "")) { MessageBox.Show("You must complete all required fields !", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { Nom = txt_CodeSoc.Text; Code = txt_Soc.Text; rt = service.ModifierSociete(Refer, Nom, Code); if (rt) { MessageBox.Show("Editing completed successfully"); Hide(); (Application.OpenForms["Consult_Company"] as Consult_Company).ViderGrid(); (Application.OpenForms["Consult_Company"] as Consult_Company).RemplirGrid(); } else { MessageBox.Show("Erreur de Modification", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }