/// <summary> /// Handles the PerformSelect Event of the LLBLGenProDataSource, which is raised when LivePersistence is set to false. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ProductsDS_PerformSelect(object sender, SD.LLBLGen.Pro.ORMSupportClasses.PerformSelectEventArgs2 e) { //Use a prefetchPath to Category, to display each Product's Category Name . PrefetchPath2 prefetchPath = new PrefetchPath2((int)EntityType.ProductEntity); prefetchPath.Add(ProductEntity.PrefetchPathCategory); // build a list of fields to be excluded from the fetch. ExcludeIncludeFieldsList excludedFields = new ExcludeIncludeFieldsList(true); excludedFields.Add(ProductFields.UnitsInStock); excludedFields.Add(ProductFields.UnitsOnOrder); excludedFields.Add(ProductFields.ReorderLevel); excludedFields.Add(ProductFields.SupplierId); // use the DataAccessAdapter's FetchEntityCollection to fetch the contained collection // pass the filter and sorter passed in the PerformSelectEventArgs2 // as well as the list of excluded fields. DataAccessAdapter adapter = new DataAccessAdapter(); adapter.FetchEntityCollection(e.ContainedCollection, e.Filter, e.MaxNumberOfItemsToReturn, e.Sorter, prefetchPath, excludedFields, e.PageNumber, e.PageSize); }
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; }
/// <summary> /// Handles the PerformSelect Event of the LLBLGenProDataSource, which is raised when LivePersistence is set to false. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void EmployeesListDS_PerformSelect(object sender, SD.LLBLGen.Pro.ORMSupportClasses.PerformSelectEventArgs2 e) { // build a list of fields to be excluded from the fetch. ExcludeIncludeFieldsList excludedFields = new ExcludeIncludeFieldsList(true); excludedFields.Add(EmployeeFields.BirthDate); excludedFields.Add(EmployeeFields.Address); excludedFields.Add(EmployeeFields.City); excludedFields.Add(EmployeeFields.Country); excludedFields.Add(EmployeeFields.Extension); excludedFields.Add(EmployeeFields.HireDate); excludedFields.Add(EmployeeFields.HomePhone); excludedFields.Add(EmployeeFields.Notes); excludedFields.Add(EmployeeFields.Photo); excludedFields.Add(EmployeeFields.PhotoPath); excludedFields.Add(EmployeeFields.PostalCode); excludedFields.Add(EmployeeFields.Region); excludedFields.Add(EmployeeFields.ReportsTo); excludedFields.Add(EmployeeFields.TitleOfCourtesy); // use the DataAccessAdapter's FetchEntityCollection to fetch the contained collection // pass the filter and sorter passed in the PerformSelectEventArgs2 // as well as the list of excluded fields and paging parameters DataAccessAdapter adapter = new DataAccessAdapter(); adapter.FetchEntityCollection(e.ContainedCollection, e.Filter, e.MaxNumberOfItemsToReturn, e.Sorter, e.PrefetchPath, excludedFields, e.PageNumber, e.PageSize); }
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(); }