Exemple #1
0
        public ctrlModifCollab(MCollaborateur unCollab)
        {
            leForm      = new frmCollab(unCollab);
            leCollab    = unCollab;
            leForm.Text = unCollab.PrenomCollabo + " " + unCollab.NomCollabo;
            leForm.btnValider.Visible = true;
            leForm.btnAnnuler.Text    = "Annuler";
            leForm.btnValider.Click  += this.btnOK_Click;
            leForm.btnAnnuler.Click  += this.btnAnnuler_Click;
            CollaborateurDAOEFStatic.InstancieContrats(unCollab);
            leForm.grdContrats.DataSource       = unCollab.ListerContrats();
            leForm.grdContrats.CellDoubleClick += this.grdContrats_CellDoubleClick;
            leForm.btnDetailsContrat.Click     += this.btnVoirContrat_Click;
            leForm.btnCloture.Click            += this.btnCloturer_Click;
            leForm.btnAjoutContrat.Click       += this.btnAjoutContrat_Click;

            //leForm.MdiParent = frmMDI.getInstance();
            if (leForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (leForm.VerifChamps())
                {
                    if (leForm.Instancie())
                    {
                        CollaborateurDAOEFStatic.ModifieCollaborateur(leForm.getCollab());
                    }
                }
            }
        }
Exemple #2
0
 /// <summary>
 /// Action attribuée au bouton valider, définit un dialogresult OK
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnValider_Click(object sender, EventArgs e)
 {
     //Appeler les vérifications de champs et si OK, ajouter le collab à la liste et retourner OK
     if (leForm.VerifChamps())
     {
         if (leForm.Instancie())
         {
             this.leCollab = leForm.getCollab();;
             leCollab.AddContrat(this.leContrat);
             //ContratDAOEFStatic.InsereContrat(this.leContrat, DonneesDAO.DbContextAbiDao.CollaborateurSet.Find(this.leCollab.Matricule));
             leForm.DialogResult = DialogResult.OK;
             this.Retour         = DialogResult.OK;
         }
     }
 }