Exemple #1
0
 //-------------------------------------------------------------------
 public CFormListeActiviteActeurs()
     : base(typeof(CActeur))
 {
     // Cet appel est requis par le Concepteur Windows Form.
     InitializeComponent();
     FiltreRapide = CFournisseurFiltreRapide.GetFiltreRapideForType(typeof(CActeur));
 }
Exemple #2
0
        private void InitSymbolesBibliotheque()
        {
            if (m_radioSymboleBib.Checked)
            {
                string strFiltre;
                if (m_typeEdite == typeof(CTypeSite))
                {
                    strFiltre = "timos.data.CSite";
                }
                else
                {
                    strFiltre = "timos.data.CEquipementLogique";
                }
                CFiltreData filtre       = new CFiltreData(CSymboleDeBibliotheque.c_champTypeCible + " = @1", strFiltre);
                CFiltreData filtreRapide = CFournisseurFiltreRapide.GetFiltreRapideForType(typeof(CSymboleDeBibliotheque));

                filtre = CFiltreData.GetAndFiltre(filtreRapide, filtre);
                m_cmbSymboleBib.Init(typeof(CFormListeSymboleDeBibliotheque),
                                     typeof(CFormEditionSymboleDeBibliotheque),
                                     "Libelle",
                                     filtre, false);

                if (m_objetEdite != null)
                {
                    if (m_objetEdite.SymboleDeBibliotheque != null)
                    {
                        m_cmbSymboleBib.ElementSelectionne = m_objetEdite.SymboleDeBibliotheque;
                        m_symboleBib = m_objetEdite.SymboleDeBibliotheque;
                    }
                }
            }
        }
Exemple #3
0
        private void RemplitDialog()
        {
            CFiltreData filtre = CFournisseurFiltreRapide.GetFiltreRapideForType(typeof(CTypeProjet));

            m_selectTypeProjet.Init(typeof(CFormListeTypeProjet), "Libelle", filtre, true);
            m_selectTypeProjet.ElementSelectionne = Projet.TypeProjet;
            m_selectTypeProjet.LockEdition        = true;

            m_extLinkField.FillDialogFromObjet(Projet);


            if (Projet.DateDebutPlanifiee != null)
            {
                m_dtpDateDebut.Value = new CDateTimeEx((DateTime)Projet.DateDebutPlanifiee);
            }
            else
            {
                m_dtpDateDebut.Value = null;
            }

            if (Projet.DateFinPlanifiee != null)
            {
                m_dtpDateFin.Value = new CDateTimeEx((DateTime)Projet.DateFinPlanifiee);
            }
            else
            {
                m_dtpDateFin.Value = null;
            }

            MAJAnomalies();
            m_bInitialise = true;
        }
        //--------------------------------------------------------------------------------------------
        private void InitSelectEO()
        {
            CFiltreData filtre = CFournisseurFiltreRapide.GetFiltreRapideForType(typeof(CEntiteOrganisationnelle));

            m_txtSelectEO.Init <CEntiteOrganisationnelle>(
                "Libelle",
                false);
        }
        public static CObjetDonnee SelectionRechercheRapide(
            string strInstructions,
            Type type,
            CFiltreData filtreDeBase,
            string strTexteRechercheRapide,
            string strChampAffiche,
            string strContexte)
        {
            if (type == null || !type.IsSubclassOf(typeof(CObjetDonnee)))
            {
                CFormAlerte.Afficher(I.T("Can not select an element from this type|30035"), EFormAlerteType.Erreur);
                return(null);
            }
            CFormSelectUnObjetDonnee form = new CFormSelectUnObjetDonnee();

            form.m_filtre          = filtreDeBase;
            form.m_strInstructions = strInstructions;
            InitVariablesDeForm(form, type);
            form.m_txtRecherche.Text     = strTexteRechercheRapide;
            form.TypeObjets              = type;
            form.m_filtreRechercheRapide = CFournisseurFiltreRapide.GetFiltreRapideForType(type);
            if (strChampAffiche == "")
            {
                strChampAffiche = DescriptionFieldAttribute.GetDescriptionField(type, "Libelle", true);
            }
            form.m_strProprieteAffichee = strChampAffiche;
            form.m_wndListeElements.Columns[0].Propriete = form.m_strProprieteAffichee;
            CObjetDonnee objet = null;

            form.RefreshListe();
            bool bOk = true;

            if (form.m_listeObjets == null || form.m_listeObjets.Count != 1)
            {
                bOk = form.ShowDialog() == DialogResult.OK;
            }
            if (bOk)
            {
                objet = form.ObjetDonnee;
            }
            form.Dispose();
            return(objet);
        }
Exemple #6
0
        //------------------------------------------------------------
        private void m_btnIntervenant_Click(object sender, EventArgs e)
        {
            CActeur part = (CActeur)CFormSelectUnObjetDonnee.SelectionRechercheRapide(
                I.T("Select an operator|20738"),
                typeof(CActeur),
                CFournisseurFiltreRapide.GetFiltreRapideForType(typeof(CActeur)),
                "",
                "",
                "");

            if (part != null)
            {
                CActeur part2 = new CActeur(m_contexteDonnee);
                part2.ReadIfExists(part.Id);
                part = part2;

                m_fournisseurEntreesPlanning.AddRessource(part);
                m_controlPlanning.Refresh();
                Refresh();
            }
        }
        private void OnChangeTypeSelectionne()
        {
            if (m_gestionnaireModeEdition.ModeEdition)
            {
                return;
            }
            m_preferenceEditee        = null;
            m_panelEditFiltre.Visible = false;


            if (m_wndListeTypes.SelectedItems.Count == 1)
            {
                CInfoClasseDynamique info = (CInfoClasseDynamique)m_wndListeTypes.SelectedItems[0].Tag;
                if (info != null)
                {
                    m_panelEditFiltre.Visible = true;
                    m_preferenceEditee        = CPreferenceFiltreRapide.GetPreferenceForType(info.Classe);
                    CFiltreData filtre = null;
                    if (m_preferenceEditee == null || m_preferenceEditee.FiltrePrefere == null)
                    {
                        filtre = CFournisseurFiltreRapide.GetFiltreRapideForType(info.Classe);
                    }
                    else
                    {
                        filtre = m_preferenceEditee.FiltrePrefere;
                    }
                    if (filtre == null)
                    {
                        filtre = new CFiltreData();
                    }
                    m_txtFiltre.Text = filtre.Filtre;
                    if (filtre.Parametres.Count < 1)
                    {
                        filtre.Parametres.Add("");
                    }
                    m_lblTypeEnCours.Text    = info.Nom;
                    m_panelParametres.Filtre = filtre;
                }
            }
        }
Exemple #8
0
        //---------------------------------------------------
        private void RemplitDialog()
        {
            CFiltreData filtre = CFournisseurFiltreRapide.GetFiltreRapideForType(typeof(CTypeIntervention));

            m_selectTypeInter.Init(typeof(CFormListeTypeIntervention), "Libelle", filtre, true);
            m_selectTypeInter.ElementSelectionne = m_intervention.TypeIntervention;
            m_selectTypeInter.LockEdition        = true;

            m_extLinkField.FillDialogFromObjet(Intervention);


            if (Intervention.DateDebutPrePlanifiee != null)
            {
                m_dtpDateDebutPre.Value = new CDateTimeEx((DateTime)Intervention.DateDebutPrePlanifiee);
            }
            else
            {
                m_dtpDateDebutPre.Value = null;
            }

            if (Intervention.DateFinPrePlanifiee != null)
            {
                m_dtpDateFinPre.Value = new CDateTimeEx((DateTime)Intervention.DateFinPrePlanifiee);
            }
            else
            {
                m_dtpDateFinPre.Value = null;
            }


            m_lblDateStart.Text = Intervention.DateDebutPlanifiee != null?Intervention.DateDebutPlanifiee.Value.ToShortDateString() : I.T("None|148");

            m_lblDateEnd.Text = Intervention.DateDebutPlanifiee != null?Intervention.DateFinPlanifiee.Value.ToShortDateString() : I.T("None|148");


            //m_dtpDateDebutPre.Format = DateTimePickerFormat.Short;
            //m_dtpDateFinPre.Format = DateTimePickerFormat.Short;
            MAJAnomalies();
            m_bInitialise = true;
        }
        /// ////////////////////////////////////////////
        private void CFormSelectUnObjetDonnee_Load(object sender, System.EventArgs e)
        {
            // Lance la traduction du formulaire
            sc2i.win32.common.CWin32Traducteur.Translate(this);

            if (m_listeObjets != null)
            {
                m_imageType.Image = DynamicClassAttribute.GetImage(m_listeObjets.TypeObjets);
            }
            m_lblInstructions.Text = m_strInstructions;

            Text = sc2i.common.DynamicClassAttribute.GetNomConvivial(m_typeObjets);
            if (m_filtreRechercheRapide == null && m_typeObjets != null)
            {
                m_filtreRechercheRapide = CFournisseurFiltreRapide.GetFiltreRapideForType(m_typeObjets);
            }
            if (m_filtreRechercheRapide == null || !m_filtreRechercheRapide.HasFiltre)
            {
                m_panelRecherche.Visible = false;
            }
            RefreshListe();
        }
Exemple #10
0
        //---------------------------------------------------------------------------
        /// <summary>
        /// Remplace la fonction de sélection dans C2iTextBoxFiltreRapide
        /// </summary>
        /// <param name="typeObjets"></param>
        /// <param name="filtreRapide"></param>
        /// <param name="strRechercheRapide"></param>
        /// <param name="bSelectionPriseEnCharge"></param>
        /// <returns></returns>
        public static CObjetDonnee MySelectionneurObjetRapide(
            Type typeObjets,
            CFiltreData filtreDeBase,
            string strRechercheRapide,
            ref bool bSelectionPriseEnCharge)
        {
            if (bSelectionPriseEnCharge)
            {
                return(null);
            }
            Type typeForm = CFormFinder.GetTypeFormToList(typeObjets);

            bSelectionPriseEnCharge = typeForm != null && typeof(CFormListeStandard).IsAssignableFrom(typeForm);
            if (!bSelectionPriseEnCharge)
            {
                return(null);
            }
            CFormListeStandard frmListe = (CFormListeStandard)Activator.CreateInstance(typeForm, null);

            frmListe.FiltreDeBase = filtreDeBase;
            frmListe.FiltreRapide = CFournisseurFiltreRapide.GetFiltreRapideForType(typeObjets);
            if (frmListe.ListeObjets != null)
            {
                frmListe.ListeObjets.FiltrePrincipal = filtreDeBase;
            }

            Thread th = new Thread(new ThreadStart(SelectOnSTAThread));

            th.SetApartmentState(ApartmentState.STA);
            m_formForThread = frmListe;
            m_strTextRechercheRapideForThread = strRechercheRapide;
            m_objetSelectedByThread           = null;
            th.Start();
            th.Join();
            return(m_objetSelectedByThread);
        }
 /// ///////////////////////////////////////////////////////
 public static void Autoexec()
 {
     CFournisseurFiltreRapide.SetFiltreDelegate(new GetFiltreRapideDelegate(GetFiltreRapide));
 }