public static List<DateTime> FetchRepoAukcijaDateCollection(DataAccessAdapterBase adapter) { if (null == _repoAukcijaDateCollection) { EntityCollection<RepoAukcijaEntity> repoAukcijaEntityCollection = new EntityCollection<RepoAukcijaEntity>(new RepoAukcijaEntityFactory()); ExcludeIncludeFieldsList includeFieldList = new ExcludeIncludeFieldsList(false); includeFieldList.Add(RepoAukcijaFields.DatumAukcije); adapter.FetchEntityCollection(repoAukcijaEntityCollection, includeFieldList, null); _repoAukcijaDateCollection = repoAukcijaEntityCollection.OrderByDescending(ra => ra.DatumAukcije).Select(ra => ra.DatumAukcije).ToList(); } return _repoAukcijaDateCollection; }
public static TrgovanjeGlavaEntity FetchTrgovanjeGlavaForGuiDisplay(DataAccessAdapterBase adapter, DateTime date) { RelationPredicateBucket bucket = new RelationPredicateBucket(); bucket.PredicateExpression.Add(TrgovanjeGlavaFields.Datum <= date.Date); SortExpression sort = new SortExpression(TrgovanjeGlavaFields.Datum | SortOperator.Descending); EntityCollection<TrgovanjeGlavaEntity> trgovanjeGlavaCollection = new EntityCollection<TrgovanjeGlavaEntity>(new TrgovanjeGlavaEntityFactory()); adapter.FetchEntityCollection(trgovanjeGlavaCollection, bucket, 1, sort); if (0 == trgovanjeGlavaCollection.Count) { sort = new SortExpression(TrgovanjeGlavaFields.Datum | SortOperator.Ascending); adapter.FetchEntityCollection(trgovanjeGlavaCollection, null, 1, sort); } return FetchTrgovanjeGlavaForGuiDisplay(adapter, trgovanjeGlavaCollection.Single().TrgovanjeGlavaId); }
/// <summary> /// Efficient pageing for grid. /// </summary> /// <param name="pageNumber">Must be greater than zero.</param> /// <param name="sortDirection">Validne vrijednosti su 'asc' i 'desc'.</param> public static EntityCollection<ErrorEntity> FetchErrorCollectionForPaging(DataAccessAdapterBase adapter, RelationPredicateBucket bucket, PrefetchPath2 prefetchPath, int pageNumber, int pageSize, string sortField, bool isSortAscending) { string sortDirection = isSortAscending ? "asc" : "desc"; Type sortEntityFieldType = typeof(ErrorFields); string sortEntityFieldTypeName = SortHelper.GetEntityFieldTypeNameForSorting(sortField, sortEntityFieldType); if (!string.IsNullOrWhiteSpace(sortEntityFieldTypeName)) { sortEntityFieldType = Type.GetType(sortEntityFieldTypeName); } sortField = SortHelper.GetSortField(sortField); SortExpression sort = SortHelper.GetSortExpression(sortField, sortDirection, sortEntityFieldType); EntityCollection<ErrorEntity> toReturn = new EntityCollection<ErrorEntity>(new ErrorEntityFactory()); adapter.FetchEntityCollection(toReturn, bucket, pageSize, sort, prefetchPath, pageNumber, pageSize); return toReturn; }
public static EntityCollection<ErrorEntity> FetchErrorCollection(DataAccessAdapterBase adapter, IRelationPredicateBucket filterBucket, PrefetchPath2 prefetchPath) { EntityCollection<ErrorEntity> toReturn = new EntityCollection<ErrorEntity>(new ErrorEntityFactory()); adapter.FetchEntityCollection(toReturn, filterBucket, prefetchPath); return toReturn; }
protected ErrorEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if(SerializationHelper.Optimization != SerializationOptimization.Fast) { _childErrorCollection = (EntityCollection<ErrorEntity>)info.GetValue("_childErrorCollection", typeof(EntityCollection<ErrorEntity>)); _parentError = (ErrorEntity)info.GetValue("_parentError", typeof(ErrorEntity)); if(_parentError!=null) { _parentError.AfterSave+=new EventHandler(OnEntityAfterSave); } this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary>Gets the member collections queue from the queue (base first)</summary> /// <param name="collectionsQueue">The collections queue.</param> protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue) { base.GetFromMemberEntityCollectionsQueue(collectionsQueue); this._trgovanjeStavkaCollection = (EntityCollection<TrgovanjeStavkaEntity>) collectionsQueue.Dequeue(); }
protected ValutaRoEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if(SerializationHelper.Optimization != SerializationOptimization.Fast) { _trgovanjeStavkaCollection = (EntityCollection<TrgovanjeStavkaEntity>)info.GetValue("_trgovanjeStavkaCollection", typeof(EntityCollection<TrgovanjeStavkaEntity>)); this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary>Gets the member collections queue from the queue (base first)</summary> /// <param name="collectionsQueue">The collections queue.</param> protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue) { base.GetFromMemberEntityCollectionsQueue(collectionsQueue); this._auditInfoCollection = (EntityCollection<AuditInfoEntity>) collectionsQueue.Dequeue(); }
/// <summary>Gets the member collections queue from the queue (base first)</summary> /// <param name="collectionsQueue">The collections queue.</param> protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue) { base.GetFromMemberEntityCollectionsQueue(collectionsQueue); this._sudionikCollection = (EntityCollection<SudionikEntity>) collectionsQueue.Dequeue(); }
public static EntityCollection<SistemskaInstancaPodatakaRoEntity> FetchSistemskaInstancaPodatakaRoCollection(DataAccessAdapterBase adapter, IRelationPredicateBucket filterBucket, PrefetchPath2 prefetchPath) { EntityCollection<SistemskaInstancaPodatakaRoEntity> toReturn = new EntityCollection<SistemskaInstancaPodatakaRoEntity>(new SistemskaInstancaPodatakaRoEntityFactory()); adapter.FetchEntityCollection(toReturn, filterBucket, prefetchPath); return toReturn; }
protected SistemskaInstancaPodatakaRoEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if(SerializationHelper.Optimization != SerializationOptimization.Fast) { _htmlPageCollection = (EntityCollection<HtmlPageEntity>)info.GetValue("_htmlPageCollection", typeof(EntityCollection<HtmlPageEntity>)); this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
private static void LoadTrgovanjeGodinaList(DataAccessAdapterBase adapter) { EntityCollection<TrgovanjeGlavaEntity> trgovanjeGlavaCollection = new EntityCollection<TrgovanjeGlavaEntity>(new TrgovanjeGlavaEntityFactory()); ExcludeIncludeFieldsList includeFieldList = new ExcludeIncludeFieldsList(false); includeFieldList.Add(TrgovanjeGlavaFields.Datum); adapter.FetchEntityCollection(trgovanjeGlavaCollection, includeFieldList, null); _godinaTrgovanjaCollection = trgovanjeGlavaCollection.Select(tg => tg.Datum.Year).Distinct().ToList(); _godinaTrgovanjaCollection.Sort(); }
public void LoadTrgovanjeGlavaPrethodniDan(DataAccessAdapterBase adapter) { RelationPredicateBucket bucket = new RelationPredicateBucket(); bucket.PredicateExpression.Add(TrgovanjeGlavaFields.Datum < this.Datum); PrefetchPath2 prefetchPath = new PrefetchPath2(EntityType.TrgovanjeGlavaEntity); prefetchPath.Add(TrgovanjeGlavaEntity.PrefetchPathTrgovanjeStavkaCollection); SortExpression sort = new SortExpression(TrgovanjeGlavaFields.Datum | SortOperator.Descending); EntityCollection<TrgovanjeGlavaEntity> trgovanjeGlavaCollection = new EntityCollection<TrgovanjeGlavaEntity>(new TrgovanjeGlavaEntityFactory()); adapter.FetchEntityCollection(trgovanjeGlavaCollection, bucket, 1, sort, prefetchPath); _trgovanjeGlavaPrethodniDan = trgovanjeGlavaCollection.SingleOrDefault(); }
/// <summary> /// Returns number of entities after filterBucket is applied. /// If you need number of all entities send null as filterBucket. /// </summary> public static int GetNumberOfEntities(DataAccessAdapterBase adapter, IRelationPredicateBucket filterBucket) { EntityCollection entityCollection = new EntityCollection(new ErrorEntityFactory()); return adapter.GetDbCount(entityCollection, filterBucket); }
/// <summary>Gets the member collections queue from the queue (base first)</summary> /// <param name="collectionsQueue">The collections queue.</param> protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue) { base.GetFromMemberEntityCollectionsQueue(collectionsQueue); this._htmlPageCollection = (EntityCollection<HtmlPageEntity>) collectionsQueue.Dequeue(); }
/// <summary>Gets the member collections queue from the queue (base first)</summary> /// <param name="collectionsQueue">The collections queue.</param> protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue) { base.GetFromMemberEntityCollectionsQueue(collectionsQueue); this._childErrorCollection = (EntityCollection<ErrorEntity>) collectionsQueue.Dequeue(); }
protected RokEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if(SerializationHelper.Optimization != SerializationOptimization.Fast) { _trgovanjeStavkaCollection = (EntityCollection<TrgovanjeStavkaEntity>)info.GetValue("_trgovanjeStavkaCollection", typeof(EntityCollection<TrgovanjeStavkaEntity>)); _rokTip = (RokTipRoEntity)info.GetValue("_rokTip", typeof(RokTipRoEntity)); if(_rokTip!=null) { _rokTip.AfterSave+=new EventHandler(OnEntityAfterSave); } this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }