This sample is a solution containing 2 projects:
- OrderProcessingSetup creates a DataStore using just the basic API provided by Semata.DataStore.
- OrderProcessing is a WPF application that uses a generated object model and views.
You need to run OrderProcessingSetup first to create the DataStore that OrderProcessing will use.
Order Processing
All the non-generated code is contained in OrderProcessing.cs. Most of the code consists of providing a number of master/detail views: Customer -> Order, Order -> OrderLine, etc. This is done by adding the relevant properties to the partial classes.
The OrderLine view is extended by overriding the Validate, Write, and Delete methods to maintain consistency between the Product stock levels and the quantity on the OrderLine.
The commented out code achieves the same by implementing partial methods on the OrderLine class, rather than overriding methods in the OrderLineView. We have tended to use the latter.