public void Modifier_Plan() { if (plan != null) { var f = new frmPlan(); f.Acces = Acces; f.Creation = false; f.plan = plan; f.Initialiser(); if (f.ShowDialog(this) == DialogResult.OK) { plan = f.plan; try { lstPlan.SelectedNode.Text = plan.Libelle; lstPlan.SelectedNode.ToolTipText = plan.Code; lstPlan.SelectedNode.Tag = plan; lstPlan.SelectedNode.ImageIndex = Donner_IndexImage(plan.TypePlan); } catch { } } } }
void Ajouter_Plan() { var f = new frmPlan(); f.Acces = Acces; f.Creation = true; f.plan = new Plan(); f.plan.Actif = true; f.Initialiser(); if (f.ShowDialog(this) == DialogResult.OK) { Afficher_ListePlan(); TreeNode[] Nd = lstPlan.Nodes.Find(f.plan.ID.ToString(), true); if (Nd.Count() > 0) { lstPlan.SelectedNode = Nd[0]; Nd[0].EnsureVisible(); } } }