public static CEntiteDeMemoryDb SelectionRechercheRapide( CMemoryDb dbMemory, string strInstructions, Type type, CFiltreMemoryDb filtreDeBase, CFiltreMemoryDb filtreRapide, string strTexteRechercheRapide, string strChampAffiche, string strContexte) { if (type == null || !type.IsSubclassOf(typeof(CEntiteDeMemoryDb))) { CFormAlerte.Afficher(I.T("Can not select an element from this type|30035"), EFormAlerteType.Erreur); return(null); } CFormSelectUneEntiteMemoryDb form = new CFormSelectUneEntiteMemoryDb(); form.m_filtre = filtreDeBase; form.m_strInstructions = strInstructions; form.m_contexteMemoire = dbMemory; form.m_txtRecherche.Text = strTexteRechercheRapide; form.TypeObjets = type; form.m_filtreRechercheRapide = filtreRapide; if (strChampAffiche == "") { strChampAffiche = DescriptionFieldAttribute.GetDescriptionField(type, "Libelle", true); } form.m_strProprieteAffichee = strChampAffiche; form.m_wndListeElements.Columns[0].Propriete = form.m_strProprieteAffichee; CEntiteDeMemoryDb 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); }
public static CEntiteDeMemoryDb SelectObjetDonnee(CMemoryDb dbMemory, string strInstructions, CListeEntitesDeMemoryDbBase liste, string strPropriete) { CFormSelectUneEntiteMemoryDb form = new CFormSelectUneEntiteMemoryDb(); form.m_listeObjets = liste; form.m_strInstructions = strInstructions; form.m_filtre = liste.Filtre; form.TypeObjets = liste.TypeElements; form.m_strProprieteAffichee = strPropriete; form.m_contexteMemoire = dbMemory; form.m_wndListeElements.Columns[0].Propriete = strPropriete; CEntiteDeMemoryDb objet = null; if (form.ShowDialog() == DialogResult.OK) { objet = form.ObjetDonnee; } form.Dispose(); return(objet); }
public static CEntiteDeMemoryDb SelectObjetDonnee(CMemoryDb dbMemory, string strInstructions, Type type, CFiltreMemoryDb filtre, string strPropriete) { if (!type.IsSubclassOf(typeof(CEntiteDeMemoryDb))) { CFormAlerte.Afficher(I.T("Impossible to select an element from this type|30035"), EFormAlerteType.Erreur); return(null); } CFormSelectUneEntiteMemoryDb form = new CFormSelectUneEntiteMemoryDb(); form.m_filtre = filtre; form.m_strInstructions = strInstructions; form.TypeObjets = type; form.m_strProprieteAffichee = strPropriete; form.m_contexteMemoire = dbMemory; form.m_wndListeElements.Columns[0].Propriete = strPropriete; CEntiteDeMemoryDb objet = null; if (form.ShowDialog() == DialogResult.OK) { objet = form.ObjetDonnee; } form.Dispose(); return(objet); }