Example #1
0
        private void btn_Insertion_Click(object sender, EventArgs e)
        {
            string Libelles = string.Empty;
            string Code     = string.Empty;
            bool   rt       = false;

            if ((txt_CodeRub.Text == "") || (txt_NameRub.Text == ""))
            {
                MessageBox.Show("You must complete all required fields !", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                Code     = txt_CodeRub.Text;
                Libelles = txt_NameRub.Text;
                rt       = service.ModifierRubric(Refer, Code, Libelles);
                if (rt)
                {
                    MessageBox.Show("Editing completed successfully");
                    Hide();
                    (Application.OpenForms["List_Of_Rubrique"] as List_Of_Rubrique).ViderGrid();
                    (Application.OpenForms["List_Of_Rubrique"] as List_Of_Rubrique).RemplirGrid();
                }
                else
                {
                    MessageBox.Show("Erreur de Modification", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }