//---------------------------------------------------------------------- private void m_lnkAjouterListeOp_LinkClicked(object sender, EventArgs e) { if (m_txtSelectListeOperation.ElementSelectionne == null) { return; } CListeOperations listeOperation = (CListeOperations)m_txtSelectListeOperation.ElementSelectionne; //CListeObjetsDonnees listeExistants = Intervention.RelationsListesOperations; //int index = listeExistants.Count; //listeExistants.Filtre = new CFiltreData(CListeOperations.c_champId + "=@1", // listeOperation.Id); //if (listeExistants.Count != 0) //{ // MessageBox.Show(I.T( "Can not add this operation list|1160")); // return; //} m_txtSelectListeOperation.ElementSelectionne = null; CIntervention_ListeOperations rel = new CIntervention_ListeOperations(Intervention.ContexteDonnee); rel.CreateNewInCurrentContexte(); rel.ListeOperations = listeOperation; rel.Intervention = Intervention; rel.Libelle = listeOperation.Libelle; rel.IsBasculeEnOperationsPrev = false; ListViewItem item = new ListViewItem(); m_lstListeOperations.Items.Add(item); m_lstListeOperations.UpdateItemWithObject(item, rel); foreach (ListViewItem itemSel in m_lstListeOperations.SelectedItems) { itemSel.Selected = false; } item.Selected = true; InitSelectListeOperations(); }
public CResultAErreur MAJChamps(CContexteDonnee ctx, string labelContrat) { CResultAErreur result = CResultAErreur.True; if (IsInDB) { if (Deleted) { return(InterventionInDB.Delete()); } } else { if (!Deleted) { CIntervention inter = new CIntervention(ctx); inter.CreateNewInCurrentContexte(); inter.DateDebutPrePlanifiee = DateDebut; inter.DateFinPrePlanifiee = DateFin; inter.Libelle = Label; inter.TypeIntervention = TypeIntervention; inter.Site = Site; foreach (CListeOperations listeOp in ListesOperations) { CIntervention_ListeOperations rel = new CIntervention_ListeOperations(ctx); rel.CreateNewInCurrentContexte(); rel.ListeOperations = listeOp; rel.Intervention = inter; rel.Libelle = I.T("@1 for contract @2|540", rel.ListeOperations.Libelle, labelContrat); } InterventionInDB = inter; } } return(result); }