Exemplo n.º 1
0
        //-------------------------------------------------------------------
        public void AppliquerFiltre()
        {
            CFiltreData filtre = null;

            CActeur acteur = m_txtActeur.ElementSelectionne as CActeur;

            if (acteur != null)
            {
                CFiltreData filtreAss = new CFiltreData();
                string[]    strCodes  = acteur.GetListeCodesAffectationEtape();
                foreach (string strCode in strCodes)
                {
                    filtreAss.Filtre += CEtapeWorkflow.c_champAffectations + " like @" +
                                        (filtreAss.Parametres.Count + 1) + " or ";
                    filtreAss.Parametres.Add("%~" + strCode + "~%");
                }
                if (filtreAss.Filtre.Length > 0)
                {
                    filtreAss.Filtre = filtreAss.Filtre.Remove(filtreAss.Filtre.Length - 4, 4);
                    filtre           = CFiltreData.GetAndFiltre(filtre, filtreAss);
                }
            }
            CEtatEtapeWorkflow etat = m_cmbEtats.SelectedValue as CEtatEtapeWorkflow;

            if (etat != null)
            {
                CFiltreData filtreTmp = new CFiltreData(CEtapeWorkflow.c_champEtat + "=@1",
                                                        etat.CodeInt);
                filtre = CFiltreData.GetAndFiltre(filtreTmp, filtre);
            }

            CTypeWorkflow type = m_txtTypeWorkflow.ElementSelectionne as CTypeWorkflow;

            if (type != null)
            {
                filtre = CFiltreData.GetAndFiltre(filtre,
                                                  new CFiltreDataAvance(CEtapeWorkflow.c_nomTable,
                                                                        CTypeEtapeWorkflow.c_nomTable + "." +
                                                                        CTypeWorkflow.c_champId + "=@1", type.Id));
            }
            if (m_txtLabel.Text.Trim().Length > 0)
            {
                filtre = CFiltreData.GetAndFiltre(filtre,
                                                  new CFiltreDataAvance(CEtapeWorkflow.c_nomTable,
                                                                        "(" + CEtapeWorkflow.c_champLibelle + " like @1) or (" +
                                                                        CEtapeWorkflow.c_champLibelle + "=@2 and " +
                                                                        CTypeEtapeWorkflow.c_nomTable + "." +
                                                                        CTypeEtapeWorkflow.c_champLibelle + " like @1)",
                                                                        "%" + m_txtLabel.Text.Trim() + "%", ""));
            }


            Filtre = filtre;

            OnAppliqueFiltre(new object(), null);
        }
Exemplo n.º 2
0
        public static string[] GetCodesAffectationsEtapeConcernant(CContexteDonnee contexteDonnee)
        {
            CDonneesActeurUtilisateur user     = GetUserForSession(contexteDonnee);
            List <string>             strCodes = new List <string>();

            if (user != null)
            {
                CActeur acteur = user.Acteur;
                strCodes.AddRange(acteur.GetListeCodesAffectationEtape());
            }
            return(strCodes.ToArray());
        }