/// <summary> /// Crea una struttura SQueryBlockCollection contenente un solo criterio di filtro. /// </summary> /// <param name="sQuery">Criterio di filtro</param> public SQueryBlockCollection(SQuery sQuery) : base() { SQueryCollection sQueryColl = new SQueryCollection(LogicalOperator.And); sQueryColl.Add(sQuery); if (sQuery.Valore != null && sQuery.Valore != string.Empty && sQuery.ValoreObject == null) sQuery.ValoreObject = sQuery.Valore; this.Add(sQueryColl); }
/// <summary> /// Trova e aggiunge una struttura SQueryCollection per legare una una tabella con una detail /// </summary> /// <param name="currentRow">Riga corrente Master</param> /// <param name="ds">DataSet di riferimento</param> /// <param name="tableName">Nome della tabella Detail</param> /// <returns>Relazione trovata</returns> public static SQueryCollection FoundFilter(DataRow currentRow, DataSet ds, string tableName) { SQueryCollection risultato = new SQueryCollection(LogicalOperator.And); DataRelation relation = FoundRelation(currentRow, ds, tableName); for(int i=0; i< relation.ChildColumns.Length; i++) { risultato.Add(new SQuery(relation.ChildColumns[i].ColumnName, "=", currentRow[relation.ParentColumns[i].ColumnName].ToString())); } return risultato; }
/// <summary> /// Metodo per aggiungere una SQueryCollection /// </summary> /// <param name="ordine">Oggetto Order che si vuole aggiungere</param> public void Add(SQueryCollection squeryCollection) { List.Add(squeryCollection); }
/// <summary> /// Converte la collection in vettore /// </summary> /// <returns>Vettore di SQueryCollection</returns> public SQueryCollection[] ToArray() { SQueryCollection[] sQueryBlockArray = new SQueryCollection[List.Count]; for(int i=0; i < List.Count; i++) { sQueryBlockArray[i] = (SQueryCollection) List[i]; } return sQueryBlockArray; }
/// <summary> /// Duplica l'istanza corrente dell'oggetto /// </summary> /// <returns>Oggetto duplicato</returns> public object Clone(bool enableBlankTable) { SQueryCollection sQueryCollection = new SQueryCollection(this.ExternalOperatorBefore); foreach(SQuery sQuery in this) { if(sQuery.Table != string.Empty || enableBlankTable) sQueryCollection.Add((SQuery)sQuery.Clone()); } return sQueryCollection; }
/// <summary> /// Metodo per aggiungere una SQueryCollection alla collection /// </summary> /// <param name="sQueryCollection">Oggetto SQueryCollection che si vuole aggiungere</param> public void AddRange(SQueryCollection sQueryCollection) { foreach(SQuery sQuery in sQueryCollection) { List.Add(sQuery); } }