/// <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> /// Restituisce l'oggetto SQuery in base all'indice /// </summary> /// <param name="index">Indice dell'oggetto</param> /// <returns>Oggetto SQuery restituito</returns> // public SQuery Item(int index) // { // return (SQuery) List[index]; // } /// <summary> /// Converte la collection in vettore /// </summary> /// <returns>Vettore di strutture SQuery</returns> public SQuery[] ToArray() { SQuery[] sQueryArray = new SQuery[List.Count]; for(int i=0; i < List.Count; i++) { sQueryArray[i] = (SQuery) List[i]; } // if(sQueryArray.Length > 0) // sQueryArray[0].ExternalOperator = LogicalOperator.Nothing; return sQueryArray; }
//private IDaoFactory _daoFactory = (IDaoFactory)Gipasoft.Windsor.Utils.WindsorUtils.Instance.WindsorContainer[typeof(IDaoFactory)]; #endregion Private Members #region Constructors public SceltaStabile() { InitializeComponent(); inizializza(); SQuery sQueryCodice = new SQuery("Codice", "="); sQueryCodice.Table = "Stabile"; codice.Tag = sQueryCodice; SQuery sQueryDescrizione = new SQuery("Descrizione", "LIKE"); sQueryDescrizione.Table = "Stabile"; descrizione.Tag = sQueryDescrizione; SQuery sQueryComune = new SQuery("Descrizione", "LIKE"); sQueryComune.Table = "Indirizzo.Comune"; comune.Tag = sQueryComune; SQuery sQueryProvince = new SQuery("ProvinciaAppartenenza.Codice", "="); sQueryProvince.Table = "Indirizzo.Comune"; province.Tag = sQueryProvince; }
/// <summary> /// Duplica l'istanza corrente dell'oggetto /// </summary> /// <returns>Oggetto duplicato</returns> public object Clone() { SQuery sQuery = new SQuery(); sQuery.NomeCampo = this.NomeCampo; sQuery.Operatore = this.Operatore; sQuery.Table = this.Table; sQuery.Valore = this.Valore; sQuery.Type =this.Type; sQuery.ExternalOperator = this.ExternalOperator; return sQuery; }
/// <summary> /// Metodo per aggiungere una struttura SQuery alla collection /// </summary> /// <param name="ordine">Oggetto <c>SQuery</c> che si vuole aggiungere</param> public void Add(SQuery squery) { List.Add(squery); }