Ejemplo n.º 1
0
        private void btnSavePersonne_Click(object sender, EventArgs e)
        {
            try
            {
                if (personne != null)
                {
                    getAttributPersonne();

                    personne.Enregistrer();

                    //Apres l'insertion de la personne, on insere sa photo
                    photoPers.Enregistrer();

                    MessageBox.Show("Enregistrement éffectué", "Enregistrement", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    pathPhotoLoad = null;//Factory.Instance.GetIdPhoto(personne.Id) == 0)
                }
                try
                {
                    chargementCombo();
                }
                catch (Exception) { }

                try
                {
                    refreshPersonne();
                }
                catch (Exception)
                {
                    MessageBox.Show("Erreur lors de l'actualisation", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Echec de l'enregistrement", "Enregistrement", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }