/// <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); }
/// <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); }