How to Use Crosslight Enterprise Framework and Related Tables?

8 replies. Last post: January 28, 2015 11:15 AM by Product Support
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Jimmy TungolMember

Hi Guys,

How do use Crosslight's Enterprise Framework to display text from a related table, and filter data using a subquery? Say for instance, we have a main table or entity called Location with fields such as LocationID, LocationName, Address, City, State, and Zip. Another entity is called Tickets, which has fields called TicketID, LocationID, UserID, Commission, Tax, Expense, Gross, DateCollected, and CollectionDate, where LocationID is a foreign key related to Location entity with one to many relationship... and UserID is a foreign key related to the User entity that was adopted from "User Management ang Authentication".

  1. Filter Data Using a Subquery. Once the app loads, it will load a list of Tickets that are not yet collected (DateCollected is null) and UserID is equal to the logged user. This should be straight forward using the QueryDefition. Now, when you add a new Ticket the user needs to select a Location (much like the Category selection list from your samples). The issue that we are facing is... the app should only list Locations in a selection list that do not have uncollected Tickets. The query looks like this... SELECT * FROM Location WHERE LocationID NOT IN (SELECT LocationID FROM Ticket WHERE DateCollected IS NULL AND UserID = @UserID). How do we implement this type of filters, while the EditableEntityRepository that was generated by the Intersoft loads all location?
  2. Display Text from Related Entity. We believe this is supported... but not sure sure which sample can we use as reference to achieve this. When the list of Tickets is loaded by the application using DataListViewModelBase, we need to display the LocationName as the DisplayMemberPath, and concatenated (Address, City, State, and Zip) or FullAddress as the DetailMemberPath. Looking at some samples, we understand that we can use Location partial class to implement the FullAddress, but will it work if we specify DisplayMemberPath = "Location.LocationName" and DetailMemberPath = "Location.FullAddress" in an ItemBindingDescription object for the TicketListBindingProvider?

Please advise. A sample for these kinds of scenarios would be nice. Thanks!

All times are GMT -5. The time now is 11:43 PM.
Previous Next