Exemplo n.º 1
0
 public override String AddContraint(String query)
 {
     try
     {
         String mot    = "groupe";
         String groupe = Utils.FindWord(query, mot);
         if (groupe != null ? groupe.Trim().Length > 0 : false)
         {
             int idx = Utils.Occurence(groupe, '.');
             if (idx > 1)
             {
                 query = query.Replace("WHERE", "INNER JOIN " + GroupeMatiere.ToTable() + " grp ON " + Utils.FindNextWord(query, ToTable()) + "groupe = grp.id WHERE");
                 idx   = groupe.IndexOf(mot);
                 if (idx > -1)
                 {
                     idx   = (groupe.Substring(0, idx) + "" + groupe.Substring(idx, mot.Length)).Length;
                     query = query.Replace(groupe, "grp" + groupe.Substring(idx, groupe.Length - idx));
                 }
                 query = new GroupeMatiere().AddContraint(query);
             }
         }
     }
     catch (Exception ex)
     {
         Messages.Exception("Matiere (AddContraint) ", ex);
     }
     return(query);
 }
Exemplo n.º 2
0
        public override bool Equals(Object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }
            GroupeMatiere other = (GroupeMatiere)obj;

            if (this.id != other.id)
            {
                return(false);
            }
            return(true);
        }