Ejemplo n.º 1
0
        /// <summary>
        /// fonction qui se déclenche lorsque l'utilisateur valide ses modifications. 
        /// Si tout est correctement rempli et que les modification ont été prises en compte alors la boite de dialogue est fermée est l'affichage du résumé des prêts est mis à jour (initialisé)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnValider_Click(object sender, EventArgs e)
        {
            Mysql m = new Mysql();

            Hashtable ht = new Hashtable();
            ht.Add("id", this.lblNumMateriel.Text);
            ht.Add("marque", this.cBoxMarque.Text);
            ht.Add("type", this.cBoxType.Text);
            ht.Add("date", this.dateMiseCirculation.Value.Year + "/" + this.dateMiseCirculation.Value.Month + "/" + this.dateMiseCirculation.Value.Day);
            ht.Add("garantie", this.garantie.Value);

            try
            {
                m.updateMateriel(ht);
                MessageBox.Show("la modification a réussie.", "Succès", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
                this.frmAppelant.init(this.materiel.getPersonne().getIdPersonne());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Echec", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }