//-------------------------------------------------------------------------
        protected override CResultAErreur MyInitChamps()
        {
            CResultAErreur result = CResultAErreur.True;

            using (CWaitCursor waiter = new CWaitCursor())
            {
                this.SuspendDrawing();
                try
                {
                    result = base.MyInitChamps();
                    if (!result)
                    {
                        return(result);
                    }

                    m_panelRecepteurFormulaires.Init(ObjetEdite, Formulaires);
                    AffecterTitre(ObjetEdite.DescriptionElement);
                }
                finally
                {
                    this.ResumeDrawing();
                }
            }

            return(result);
        }
        private CResultAErreur CFormEditionFamilleEquipementLogique_OnInitPage(object page)
        {
            CResultAErreur result = CResultAErreur.True;

            using (CWaitCursor waiter = new CWaitCursor())
            {
                if (page == m_pageDefinissionFiches)
                {
                    m_panelDefinisseurChamps.InitPanel(
                        Famille,
                        typeof(CFormListeChampsCustom),
                        typeof(CFormListeFormulaires));
                }
                else if (page == m_pageEntitesFilles)
                {
                    m_panelFilles.InitFromListeObjets(
                        Famille.FamillesFilles,
                        typeof(CFamilleEquipementLogique),
                        typeof(CFormEditionFamilleEquipementLogique),
                        Famille,
                        "FamilleParente");
                }
            }
            return(result);
        }
示例#3
0
 //---------------------------------------------------------------------------
 public override Form GetForm(CObjetDonneeAIdNumeriqueAuto objetDonnee, CListeObjetsDonnees liste)
 {
     using (CWaitCursor waiter = new CWaitCursor())
     {
         return((Form)Activator.CreateInstance(m_typeForm, new object[] { objetDonnee, liste }));
     }
 }
        void m_menuGrouperActions_Click(object sender, EventArgs e)
        {
            if (Selection.Count > 0)
            {
                CResultAErreur result = CResultAErreur.True;
                using (CWaitCursor waiter = new CWaitCursor())
                {
                    List <CAction> lst = new List <CAction>();
                    foreach (object obj in Selection)
                    {
                        CAction action = obj as CAction;
                        if (action != null && action.GetType() != typeof(CActionDebut) && action.GetType() != typeof(CActionPointEntree))
                        {
                            lst.Add(action);
                        }
                    }

                    result = CActionProcessFils.CreateForSelection(lst.ToArray());
                    if (result)
                    {
                        Selection.Clear();
                        if (result.Data is CAction)
                        {
                            Selection.Add(result.Data as CAction);
                        }

                        Refresh();
                    }
                }
                if (!result)
                {
                    CFormAfficheErreur.Show(result.Erreur);
                }
            }
        }
示例#5
0
 //-------------------------------------------------------------
 private void ImplementeTemplate()
 {
     using (CWaitCursor waiter = new CWaitCursor())
     {
         m_toolTip.SetToolTip(m_txtLibelle, "");
         if (Besoin != null && Besoin.IsNew() && m_listeTemplates != null &&
             !Besoin.HasChildren && !m_bIsEntering && !m_bIsInitializing && m_extModeEdition.ModeEdition)
         {
             m_listeTemplates.Filtre = new CFiltreData(CPhaseSpecifications.c_champLibelle + "=@1 and " +
                                                       CPhaseSpecifications.c_champUseAsTemplate + "=@2",
                                                       m_txtLibelle.Text,
                                                       true);
             if (m_listeTemplates.Count > 0)
             {
                 Besoin.Libelle = m_txtLibelle.Text;
                 Besoin.ApplyTemplate(m_listeTemplates[0] as CPhaseSpecifications);
                 ((CControleListeBesoins)AssociatedListControl).AddItemsFils((CItemBesoin)CurrentItem);
                 MyInitChamps(CurrentItem);
                 int?nItem = AssociatedListControl.CurrentItemIndex;
                 AssociatedListControl.CurrentItemIndex = nItem;
                 AssociatedListControl.Refresh();
             }
         }
     }
 }
 //-------------------------------------------------------------------------------
 internal void Expand(CCustomizableListItem item)
 {
     using (CWaitCursor waiter = new CWaitCursor())
     {
         CSetupSmartImportItem si = item as CSetupSmartImportItem;
         if (si != null && si.ChildItems.Count() == 0)
         {
             CSetupSmartImportChampEntiteItem root = si as CSetupSmartImportChampEntiteItem;
             if (root != null)
             {
                 CreateChilds(si, root.ValeursExemples, root.ConfigMappage);
             }
             CSetupSmartImportEntiteParentItem itemParent = si as CSetupSmartImportEntiteParentItem;
             if (itemParent != null)
             {
                 CreateChilds(
                     si,
                     itemParent.ValeursParent,
                     itemParent.MappageEntiteParente != null ? itemParent.MappageEntiteParente.ConfigEntiteParente : null);
             }
             CSetupSmartImportEntiteFilleItem itemFille = si as CSetupSmartImportEntiteFilleItem;
             if (itemFille != null)
             {
                 CreateChilds(itemFille);
             }
         }
         if (si != null)
         {
             si.Expand();
         }
         Refresh();
     }
 }
示例#7
0
        private CResultAErreur m_gestionnaireTabControl_OnInitPage(object page)
        {
            CResultAErreur result = CResultAErreur.True;

            using (CWaitCursor waiter = new CWaitCursor())
            {
                if (page == m_pageContrats)
                {
                    //Initialisation des contrats
                    m_panelListeContrats.InitFromListeObjets(
                        Client.Contrats,
                        typeof(CContrat),
                        typeof(CFormEditionContrat),
                        Client,
                        "Client");
                }
                else if (page == m_pageTickets)
                {
                    //Initialisation des Tickets
                    m_panelListeTickets.InitFromListeObjets(
                        Client.Tickets,
                        typeof(CTicket),
                        typeof(CFormEditionTicket),
                        Client,
                        "Client");
                }
            }

            return(result);
        }
 private void m_btnConnect_Click(object sender, EventArgs e)
 {
     using (CWaitCursor waiter = new CWaitCursor())
     {
         CFormWaiting.DoWork(new DoWorkDelegate(RecupereListeSites));
     }
 }
        private CResultAErreur CFormEditionFamilleEquipement_OnInitPage(object page)
        {
            CResultAErreur result = CResultAErreur.True;

            using (CWaitCursor waiter = new CWaitCursor())
            {
                if (page == m_pageEquipements)
                {
                    m_panelChampsTypeEquipement.InitPanel(
                        Famille.GetDefinisseurPourTypeEquipement(),
                        typeof(CFormListeChampsCustom),
                        typeof(CFormListeFormulaires));
                }
                else if (page == m_pageConsommables)
                {
                    m_paneChampsTypeConsommables.InitPanel(
                        Famille.GetDefinisseurPourTypeConsommable(),
                        typeof(CFormListeChampsCustom),
                        typeof(CFormListeFormulaires));
                }
                else if (page == m_pageEntitesFilles)
                {
                    m_panelFilles.InitFromListeObjets(
                        Famille.FamillesFilles,
                        typeof(CFamilleEquipement),
                        typeof(CFormEditionFamilleEquipement),
                        Famille,
                        "FamilleParente");
                }
            }
            return(result);
        }
示例#10
0
 //----------------------------------------------
 private void ShowPreview()
 {
     m_timerPreview.Stop();
     using (CWaitCursor waiter = new CWaitCursor())
     {
         if (m_wndListeForms.SelectedItems.Count == 1)
         {
             ListViewItem    item      = m_wndListeForms.SelectedItems[0];
             C2iWndReference reference = item.Tag as C2iWndReference;
             if (reference != null)
             {
                 if (m_wndPreview.Image != null)
                 {
                     m_wndPreview.Image.Dispose();
                     m_wndPreview.Image = null;
                 }
                 m_lblForm.Text = reference.WndLabel;
                 C2iWnd wnd = C2iWndProvider.GetForm(reference);
                 if (wnd != null)
                 {
                     Bitmap   bmp = new Bitmap(wnd.Size.Width + 2, wnd.Size.Height + 2);
                     Graphics g   = Graphics.FromImage(bmp);
                     CContextDessinObjetGraphique ctx = new CContextDessinObjetGraphique(g);
                     wnd.Draw(ctx);
                     g.Dispose();
                     m_wndPreview.Image = bmp;
                 }
             }
         }
     }
 }
示例#11
0
 //---------------------------------------------------------------------------
 public override Form GetForm()
 {
     using (CWaitCursor waiter = new CWaitCursor())
     {
         return((Form)Activator.CreateInstance(m_typeForm));
     }
 }
示例#12
0
 // ////////////////////////////////////////////////////////////////////////////////////
 /// <summary>
 /// Création des contrôles windows
 /// </summary>
 /// <param name="controlParent"></param>
 /// <param name="wndParent"></param>
 /// <param name="tooltip"></param>
 /// <returns></returns>
 public virtual CResultAErreur CreateControlePrincipalEtChilds(
     Control controlParent,
     C2iWnd wndParent,
     IFournisseurProprietesDynamiques fournisseur)
 {
     using (CWaitCursor waiter = new CWaitCursor())
     {
         controlParent.SuspendDrawing();
         CResultAErreur result = CResultAErreur.True;
         m_controlesPrincipaux.Clear();
         IControleWndFor2iWnd ctrlPrincipal = CreateControle(wndParent, controlParent, fournisseur);
         if (ctrlPrincipal != null &&
             ctrlPrincipal.Control != null)
         {
             C2iWndFenetre fen = wndParent as C2iWndFenetre;
             if (fen != null && fen.AutoSize)
             {
                 ctrlPrincipal.Control.Dock = DockStyle.Top;
             }
             else
             {
                 ctrlPrincipal.Control.Dock = DockStyle.Fill;
             }
         }
         if (ctrlPrincipal != null)
         {
             m_controlesPrincipaux.Add(ctrlPrincipal);
         }
         controlParent.ResumeDrawing();
         return(result);
     }
 }
示例#13
0
        private void m_timerFiltre_Tick(object sender, System.EventArgs e)
        {
            using (CWaitCursor waiter = new CWaitCursor())
            {
                m_timerFiltre.Stop();

                RemplitArbre(false);
            }
        }
        //-------------------------------------------------------------------------
        private CResultAErreur CFormEditionTypeEntiteOrganisationnelle_OnInitPage(object page)
        {
            CResultAErreur result = CResultAErreur.True;

            using (CWaitCursor waiter = new CWaitCursor())
            {
                if (page == pageChampsCustom)
                {
                    m_panelDefinisseurChamps.InitPanel(
                        TypeEntiteOrganisationnelle,
                        typeof(CFormListeChampsCustom),
                        typeof(CFormListeFormulaires));
                }
                else if (page == pageCoor)
                {
                    result = m_panelSystemeCoordonnees.Init(TypeEntiteOrganisationnelle);
                    if (result)
                    {
                        result = m_ctrlOptionsCoor.Init(TypeEntiteOrganisationnelle);
                    }
                }
                else if (page == pageSetup)
                {
                    foreach (CControleSelectFormulaireParType ctrl in m_listeControlesFormulairesParTypes)
                    {
                        result = ctrl.InitChamps(TypeEntiteOrganisationnelle);
                        if (!result)
                        {
                            return(result);
                        }
                    }
                    // Sélection des Exception pour les Types d'entités
                    m_lstViewExceptionsPourType.BeginUpdate();
                    m_lstViewExceptionsPourType.CheckBoxes = m_gestionnaireModeEdition.ModeEdition;
                    List <CInfoClasseDynamique> lstTypesElementsAEO = new List <CInfoClasseDynamique>();
                    foreach (CInfoClasseDynamique info in DynamicClassAttribute.GetAllDynamicClassHeritant(typeof(IElementAEO)))
                    {
                        if (!info.Classe.IsInterface)
                        {
                            lstTypesElementsAEO.Add(info);
                        }
                    }
                    m_lstViewExceptionsPourType.Remplir(lstTypesElementsAEO);

                    foreach (ListViewItem item in m_lstViewExceptionsPourType.Items)
                    {
                        item.Checked = TypeEntiteOrganisationnelle.HasExceptionForType(((CInfoClasseDynamique)item.Tag).Classe);
                        if (!item.Checked && !m_gestionnaireModeEdition.ModeEdition)
                        {
                            m_lstViewExceptionsPourType.Items.Remove(item);
                        }
                    }
                    m_lstViewExceptionsPourType.EndUpdate();
                }
            }
            return(result);
        }
示例#15
0
        /// //////////////////////////////////////////////////////////
        private void ItemFiltreClick(object sender, EventArgs e)
        {
            if (!(sender is CMenuItemFiltre))
            {
                return;
            }
            CFiltreDynamiqueInDb filtreInDb = ((CMenuItemFiltre)sender).Filtre;
            CFiltreDynamique     filtreDyn  = filtreInDb.Filtre;
            CFiltreData          filtreData = CFormFiltreDynamic.GetFiltreData(filtreDyn);

            if (filtreData == null)
            {
                return;
            }
            CListeObjetsDonnees listeSel = new CListeObjetsDonnees(CSc2iWin32DataClient.ContexteCourant, m_typeLien.TypeElements);

            filtreData      = CFiltreData.GetAndFiltre(filtreData, m_typeLien.FiltreDataAssocie);
            listeSel.Filtre = filtreData;

            try
            {
                if (listeSel.CountNoLoad == 0)
                {
                    CFormAlerte.Afficher(I.T("No @1 matches the filter|30089", DynamicClassAttribute.GetNomConvivial(m_typeLien.TypeElements)), EFormAlerteType.Exclamation);
                    return;
                }
                if (CFormAlerte.Afficher(I.T("You will add @1 element(s) to the selection. Continue ?|30088", listeSel.CountNoLoad.ToString()), EFormAlerteType.Question) == DialogResult.Yes)
                {
                    CListeObjetsDonnees listeExiste = m_entreeAgenda.RelationsElementsAgenda;
                    listeExiste.Filtre = new CFiltreData(CRelationTypeEntreeAgenda_TypeElementAAgenda.c_champId + "=@1",
                                                         m_typeLien.Id);
                    listeExiste.Filtre = CFiltreData.GetAndFiltre(listeExiste.Filtre, new CFiltreData(CRelationTypeEntreeAgenda_TypeElementAAgenda.c_champId + "=@1",
                                                                                                      m_typeLien.Id));
                    using (CWaitCursor waiter = new CWaitCursor())
                    {
                        foreach (CObjetDonneeAIdNumerique objet in listeSel)
                        {
                            listeExiste.Filtre = new CFiltreData(CRelationEntreeAgenda_ElementAAgenda.c_champIdElementAAgenda + "=@1",
                                                                 objet.Id);
                            if (listeExiste.Count == 0)
                            {
                                CRelationEntreeAgenda_ElementAAgenda rel = new CRelationEntreeAgenda_ElementAAgenda(m_entreeAgenda.ContexteDonnee);
                                rel.CreateNewInCurrentContexte();
                                rel.EntreeAgenda = m_entreeAgenda;
                                rel.RelationTypeEntree_TypeElement = m_typeLien;
                                rel.ElementLie = objet;
                            }
                        }
                        UpdateListe();
                    }
                }
            }
            catch
            {
            }
        }
示例#16
0
 //------------------------------------------------------------------------------
 private void m_btnMessageComplet_Click(object sender, EventArgs e)
 {
     using (CWaitCursor cur = new CWaitCursor())
     {
         CResultAErreur result = Mail.RetriveFullMessage();
         if (!result)
         {
             CFormAlerte.Afficher(result.MessageErreur);
         }
         InitVisuCopsMessage();
     }
 }
        private void m_lnkDemarrer_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            CResultAErreur result = CResultAErreur.True;

            try
            {
                C2iStructureImport structure = m_panelStructure.GetStructureFinale();
                if (structure.Mappages.Select(m => m.IsCle).Count() == 0)
                {
                    if (MessageBox.Show(I.T("Warning, You didn't select any identification field. Continue ?|20052"),
                                        "",
                                        MessageBoxButtons.YesNo) == DialogResult.No)
                    {
                        return;
                    }
                }
                string strFichier = m_panelStructure.NomFichier;

                using (CContexteDonnee ctx = new CContexteDonnee(CSc2iWin32DataClient.ContexteCourant.IdSession, true, false))
                {
                    ctx.SetVersionDeTravail(CSc2iWin32DataClient.ContexteCourant.IdVersionDeTravail, false);
                    using (CWaitCursor waiter = new CWaitCursor())
                    {
                        result = structure.Importer(strFichier, ctx);
                    }
                    if (result)
                    {
                        DataTable table     = ctx.GetTableSafe(CContexteDonnee.GetNomTableForType(structure.TypeCible));
                        int       nNbUpdate = structure.NbUpdated;
                        int       nNbCreate = structure.NbCreated;
                        if (CFormAlerte.Afficher(I.T("This opération will create @1 and update @2 elements. Do you confirm this operation ?|20050",
                                                     nNbCreate.ToString(),
                                                     nNbUpdate.ToString()), EFormAlerteType.Question) == DialogResult.Yes)
                        {
                            result = ctx.SaveAll(true);
                            if (result)
                            {
                                CFormAlerte.Afficher(I.T("Import ended with success|20051"), EFormAlerteType.Info);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                result.EmpileErreur(new CErreurException(ex));
            }
            if (!result)
            {
                CFormAfficheErreur.Show(result.Erreur);
            }
        }
        private void SelectionMultiples()
        {
            CListeObjetsDonnees liste = ListeRelations;

            CObjetDonneeAIdNumerique[] elts = (CObjetDonneeAIdNumerique[])CInterpreteurTextePropriete.CreateListeFrom(
                liste, "ElementLie", typeof(CObjetDonneeAIdNumerique));
            elts = CFormSelectElementsMultiples.GetListeElements(
                m_typeRelation.TypeElements,
                m_typeRelation.FiltreDataAssocie,
                elts);
            if (elts != null)
            {
                using (CWaitCursor waiter = new CWaitCursor())
                {
                    //Table Entite->Vrai si existe dans les deux liste
                    //			->Faux si existe uniquement dans l'ancienne liste (à supprimer)
                    //			->Null si existe uniquement dans la nouvelle liste (à créer)
                    Hashtable tableExistants = new Hashtable();
                    foreach (CRelationEntreeAgenda_ElementAAgenda rel in ListeRelations)
                    {
                        tableExistants[rel.ElementLie] = false;
                    }
                    foreach (CObjetDonneeAIdNumerique objet in elts)
                    {
                        if (tableExistants[objet] == null)                          //création
                        {
                            CRelationEntreeAgenda_ElementAAgenda rel = new CRelationEntreeAgenda_ElementAAgenda(m_entreeAgenda.ContexteDonnee);
                            rel.CreateNewInCurrentContexte();
                            rel.ElementLie   = objet;
                            rel.EntreeAgenda = m_entreeAgenda;
                            rel.RelationTypeEntree_TypeElement = m_typeRelation;
                        }
                        else
                        {
                            tableExistants[objet] = true;
                        }
                    }
                    //Supprime ceux qui doivent être supprimés
                    foreach (CRelationEntreeAgenda_ElementAAgenda rel in ListeRelations.ToArrayList())
                    {
                        object val = tableExistants[rel.ElementLie];
                        if (val is bool && ((bool)val) == false)
                        {
                            rel.Delete();
                        }
                    }
                }
            }
            RefreshText();
        }
 private void m_btnActivate_Click(object sender, EventArgs e)
 {
     using (CWaitCursor waiter = new CWaitCursor())
     {
         CListeObjetsDonnees lstConsultations = m_panelListe.GetElementsSelectionnes();
         if (lstConsultations.Count <= 0)
         {
             CFormAlerte.Afficher(I.T("Any selected consultation |60062"), EFormAlerteType.Exclamation);
         }
         foreach (CConsultationAlarmesEnCoursInDb consultation in lstConsultations)
         {
             CFormListeAlarmeEnCours listAlarmeEnCours = new CFormListeAlarmeEnCours(consultation, Navigateur);
             listAlarmeEnCours.Show();
         }
     }
 }
示例#20
0
        /// //////////////////////////////////////////////////////////
        private void ItemFiltreClick(object sender, EventArgs e)
        {
            if (!(sender is CMenuItemFiltre))
            {
                return;
            }
            CFiltreDynamiqueInDb filtreInDb = ((CMenuItemFiltre)sender).Filtre;
            CFiltreDynamique     filtreDyn  = filtreInDb.Filtre;
            CFiltreData          filtreData = CFormFiltreDynamic.GetFiltreData(filtreDyn);

            if (filtreData == null)
            {
                return;
            }
            CListeObjetsDonnees listeSel = new CListeObjetsDonnees(CSc2iWin32DataClient.ContexteCourant, m_typElements);

            filtreData      = CFiltreData.GetAndFiltre(filtreData, m_filtreInitial);
            listeSel.Filtre = filtreData;

            try
            {
                if (listeSel.CountNoLoad == 0)
                {
                    CFormAlerte.Afficher("Aucun " + DynamicClassAttribute.GetNomConvivial(m_typElements) + " ne correspond au filtre", EFormAlerteType.Exclamation);
                    return;
                }
                if (CFormAlerte.Afficher(I.T("You will add @1 element(s) to the selection. Continue ?|30088", listeSel.CountNoLoad.ToString()), EFormAlerteType.Question) == DialogResult.Yes)
                {
                    using (CWaitCursor waiter = new CWaitCursor())
                    {
                        bool bModif = false;
                        foreach (CObjetDonneeAIdNumerique objet in listeSel)
                        {
                            bModif |= AddElement(objet);
                        }
                        if (bModif && OnChangeSelection != null)
                        {
                            OnChangeSelection(this, new EventArgs( ));
                        }
                        UpdateListe();
                    }
                }
            }
            catch
            {
            }
        }
示例#21
0
        private CResultAErreur m_gestionnaireTabControl_OnInitPage(object page)
        {
            CResultAErreur result = CResultAErreur.True;

            using (CWaitCursor waiter = new CWaitCursor())
            {
                if (page == m_pageFormulaires)
                {
                    m_panelChamps.ElementEdite = TypeTableParametrable;
                }
                else if (page == m_pageChampsCustom)
                {
                    m_panelEditChamps.InitPanel(
                        TypeTableParametrable,
                        typeof(CFormListeChampsCustom),
                        typeof(CFormListeFormulaires));
                }
                //Géré dans l'initialisation globale
                //else if (page == m_pageClePrimaire || page == m_pageColonnes)
                //{
                //}
                else if (page == m_pageTypesEquipements)
                {
                    m_typesEquipementsSelec.Init(
                        new CListeObjetsDonnees(TypeTableParametrable.ContexteDonnee, typeof(CTypeEquipement)),
                        TypeTableParametrable.RelationsTypesEquipements,
                        TypeTableParametrable,
                        "TypeTableParametrable",
                        "TypeEquipement");

                    m_typesEquipementsSelec.RemplirGrille();
                }
                else if (page == m_pageTypesSites)
                {
                    m_typesSitesSelec.Init(
                        new CListeObjetsDonnees(TypeTableParametrable.ContexteDonnee, typeof(CTypeSite)),
                        TypeTableParametrable.RelationsTypesSites,
                        TypeTableParametrable,
                        "TypeTableParametrable",
                        "TypeSite");
                    m_typesSitesSelec.RemplirGrille();
                }
            }
            return(result);
        }
        private CResultAErreur CFormEditionFamilleModulesMib_OnInitPage(object page)
        {
            CResultAErreur result = CResultAErreur.True;

            using (CWaitCursor waiter = new CWaitCursor())
            {
                if (page == m_pageEntitesFilles)
                {
                    m_panelFilles.InitFromListeObjets(
                        Famille.FamillesFilles,
                        typeof(CSpvFamilleMibmodule),
                        typeof(CFormEditionFamilleModulesMib),
                        Famille,
                        "FamilleParente");
                }
            }
            return(result);
        }
 //-------------------------------------------------------------------------------
 public void Fill(
     CValeursProprietes valeurs,
     CConfigMappagesSmartImport configMappage,
     DataTable sourceTable)
 {
     using (CWaitCursor waiter = new CWaitCursor())
     {
         List <CSetupSmartImportItem> lst = new List <CSetupSmartImportItem>();
         lst.Add(new CSetupSmartImportChampEntiteItem(null,
                                                      valeurs,
                                                      new CSourceSmartImportObjet(),
                                                      configMappage,
                                                      0));
         ((CControleSetupSmartImportField)ItemControl).SourceTable = sourceTable;
         Items = lst.ToArray();
         ExpandItemsWithData(Items[0] as CSetupSmartImportItem);
     }
 }
示例#24
0
 //--------------------------------------------------------------------------------
 private void CTreeListeTables_BeforeExpand(object sender, TreeViewCancelEventArgs e)
 {
     if (e.Node.Tag is CEasyQuerySource)
     {
         if (e.Node.Nodes.Count == 1 && e.Node.Nodes[0].Tag == null)
         {
             using (CWaitCursor waiter = new CWaitCursor())
             {
                 e.Node.Nodes.Clear();
                 CEasyQuerySource source = e.Node.Tag as CEasyQuerySource;
                 FillNodes(e.Node.Nodes, source, source.RootFolder);
             }
         }
     }
     else if (e.Node.Tag is ITableDefinition)
     {
         if (e.Node.Nodes.Count == 1 && e.Node.Nodes[0].Tag == null)
         {
             e.Node.Nodes.Clear();
             ITableDefinition table = e.Node.Tag as ITableDefinition;
             foreach (IColumnDefinition col in table.Columns)
             {
                 TreeNode node = new TreeNode(col.ColumnName);
                 node.Tag                = col;
                 node.ImageIndex         = GetImageNum(col.ImageKey);
                 node.SelectedImageIndex = node.ImageIndex;
                 e.Node.Nodes.Add(node);
             }
         }
     }
     else if (e.Node.Tag is CEasyQuerySourceFolder)
     {
         if (e.Node.Nodes.Count == 1 && e.Node.Nodes[0].Tag == null)
         {
             CEasyQuerySourceFolder folder = e.Node.Tag as CEasyQuerySourceFolder;
             e.Node.Nodes.Clear();
             FillNodes(e.Node.Nodes, folder.Source, folder);
             if (Nodes.Count == 1)
             {
                 Nodes[0].Expand();
             }
         }
     }
 }
示例#25
0
        }//MyInitChamps()

        //--------------------------------------------------------------
        public override sc2i.common.CResultAErreur MyMajChamps()
        {
            CResultAErreur result = base.MyMajChamps();

            if (!result)
            {
                return(result);
            }
            if (m_chkSuperviser.Checked)
            {
                if (m_spvTypeLiaison == null)
                {
                    result = CSpvTypliai.CanSupervise(TypeLienReseau);
                    if (!result)
                    {
                        m_chkSuperviser.Checked = false;
                        return(result);
                    }
                    //m_spvTypeLiaison = CSpvTypliai.GetSpvTypliaiFromTypeLienReseauAvecCreation(TypeLienReseau);
                    m_spvTypeLiaison = CSpvTypliai.GetObjetSpvFromObjetTimosAvecCreation(TypeLienReseau);
                }
            }
            else
            {
                if (m_spvTypeLiaison != null)
                {
                    result = CResultAErreur.True;
                    using (CWaitCursor waiter = new CWaitCursor())
                    {
                        result = m_spvTypeLiaison.Delete(true);
                    }
                    if (!result)
                    {
                        m_chkSuperviser.Checked = true;
                        return(result);
                    }
                    else
                    {
                        m_spvTypeLiaison = null;
                    }
                }
            }
            return(result);
        }
示例#26
0
 /// ///////////////////////////////////////////////
 private void DeleteAll()
 {
     if (ListeRelations.Count > 1)
     {
         if (CFormAlerte.Afficher(I.T("You are about to dissociate @1 elements from this agenda entry. Do you confirm ?|30117", ListeRelations.Count.ToString()),
                                  EFormAlerteType.Question) == DialogResult.No)
         {
             return;
         }
     }
     using (CWaitCursor waiter = new CWaitCursor())
     {
         ArrayList lst = new ArrayList(ListeRelations);
         foreach (IRelationElementALien_Element rel in lst)
         {
             rel.Delete();
         }
     }
     RefreshText();
 }
 private void GetDataMediation()
 {
     using (CWaitCursor waiter = new CWaitCursor())
     {
         CSnmpConnexion cnx = GetConnexion();
         try
         {
             IServiceMediation service             = cnx.ServiceMediation;
             CConfigurationServiceMediation config = service.Configuration;
             DataSet ds = config.DataBase;
             m_dataGrid.DataSource = ds;
         }
         catch (Exception ex)
         {
             CResultAErreur result = CResultAErreur.True;
             result.EmpileErreur(new CErreurException(ex));
             result.EmpileErreur(I.T("Error while reading configuration|20331"));
             CFormAlerte.Afficher(result.Erreur);
         }
     }
 }
示例#28
0
        //-------------------------------------
        void txtSelectTemplate_OnSelectObject(object sender, CObjetDonneeEventArgs args)
        {
            CPhaseSpecifications phase = args.Objet as CPhaseSpecifications;

            if (phase != null)
            {
                CElementDeGanttProjet prj = m_gantt.SelectedElement as CElementDeGanttProjet;
                CProjet projetParent      = prj != null ? prj.ProjetAssocie : null;
                if (projetParent != null)
                {
                    if (CFormAlerte.Afficher(I.T("Apply template '@1' to project '@2'|20730",
                                                 phase.Libelle, projetParent.Libelle),
                                             EFormAlerteBoutons.OuiNon,
                                             EFormAlerteType.Question) == DialogResult.Yes)
                    {
                        CListeObjetsDonnees lst = phase.Besoins;
                        lst.Filtre = new CFiltreData(CBesoin.c_champTypeBesoin + "=@1 and " +
                                                     CTypeProjet.c_champId + " is null",
                                                     (int)ETypeDonneeBesoin.Projet);
                        CTypeProjet typeProjetDefault = null;
                        if (lst.Count > 0)
                        {
                            typeProjetDefault = CFormSelectUnObjetDonnee.SelectObjetDonnee(
                                I.T("Select default project type (for needs without project type)|20737"),
                                typeof(CTypeProjet), null, "Libelle") as CTypeProjet;
                            if (typeProjetDefault == null)
                            {
                                return;
                            }
                        }
                        using (CWaitCursor waiter = new CWaitCursor())
                        {
                            projetParent.ApplySpecificationTemplate(phase, typeProjetDefault);
                            Reinit();
                        }
                    }
                }
            }
        }
        private CResultAErreur CFormEditionTypeMetaProjet_OnInitPage(object page)
        {
            CResultAErreur result = CResultAErreur.True;

            using (CWaitCursor waiter = new CWaitCursor())
            {
                if (page == m_pageChampCustom)
                {
                    m_panelEditChamps.InitPanel(
                        TypeMetaProjet,
                        typeof(CFormListeChampsCustom),
                        typeof(CFormListeFormulaires));
                }
                if (page == m_pageEOS)
                {
                    m_panelEOS.Init(TypeMetaProjet);
                }
            }


            return(result);
        }
示例#30
0
        private CResultAErreur CFormEditionEntiteOrganisationnelle_OnInitPage(object page)
        {
            CResultAErreur result = CResultAErreur.True;

            using (CWaitCursor waiter = new CWaitCursor())
            {
                if (page == m_pageEntitesFilles)
                {
                    m_panelFilles.InitFromListeObjets(
                        EntiteOrganisationnelle.EntiteFilles,
                        typeof(CEntiteOrganisationnelle),
                        typeof(CFormEditionEntiteOrganisationnelle),
                        EntiteOrganisationnelle,
                        "EntiteParente");
                }
                else if (page == m_pageFiche)
                {
                    m_panelChamps.ElementEdite = EntiteOrganisationnelle;
                }
            }
            return(result);
        }