Ejemplo n.º 1
0
        private void m_lnkSupprimerListeOp_LinkClicked(object sender, EventArgs e)
        {
            if (m_lstListeOperations.SelectedItems.Count != 1)
            {
                return;
            }

            CIntervention_ListeOperations rel = (CIntervention_ListeOperations)m_lstListeOperations.SelectedItems[0].Tag;

            m_gestionnaireEditionListeOp.SetObjetEnCoursToNull();
            CResultAErreur result = rel.Delete();

            if (!result)
            {
                CFormAlerte.Afficher(result.Erreur);
                return;
            }

            if (m_lstListeOperations.SelectedItems.Count == 1)
            {
                if (m_lstListeOperations.SelectedItems[0] != null)
                {
                    m_lstListeOperations.SelectedItems[0].Remove();
                }
            }
            InitSelectListeOperations();
        }
Ejemplo n.º 2
0
 private void m_gestionnaireEditionListeOp_MAJ_Champs(object sender, CObjetDonneeResultEventArgs args)
 {
     if (args.Objet != null)
     {
         CIntervention_ListeOperations interListeOp = (CIntervention_ListeOperations)args.Objet;
         m_extLinkListeOperations.FillObjetFromDialog(interListeOp);
     }
 }
Ejemplo n.º 3
0
 //--------------------------------------------------------------------------------------------------
 private void m_gestionnaireEditionListeOp_InitChamp(object sender, CObjetDonneeResultEventArgs args)
 {
     m_panelInfosListeOp.Visible = args.Objet is CIntervention_ListeOperations;
     if (args.Objet is CIntervention_ListeOperations)
     {
         m_interListeOp = (CIntervention_ListeOperations)args.Objet;
         m_extLinkListeOperations.FillDialogFromObjet((CIntervention_ListeOperations)args.Objet);
     }
     else
     {
         m_interListeOp = null;
     }
 }
Ejemplo n.º 4
0
        //-------------------------------------------------------------------
        public override CResultAErreur VerifieDonnees(CObjetDonnee objet)
        {
            CResultAErreur result = CResultAErreur.True;

            try
            {
                CIntervention_ListeOperations relation = (CIntervention_ListeOperations)objet;
            }
            catch (Exception e)
            {
                result.EmpileErreur(new CErreurException(e));
            }
            return(result);
        }
Ejemplo n.º 5
0
        //----------------------------------------------------------------------
        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);
        }