Exercise - Calling Controllers Across Project Scopes
- Using the runtime Developer Tools, Generate Entity C# add the Region entity to the NorthwindBase, Models.
- Build NorthwindBase.
- Add a new UIController to the Exercises name space in Northwind project, name it ShowRegions.
- Set the new Region entity as the main table.
- Build and add a grid that will show all the columns in the form.
- Save changes to Git.
- Build and test.
- In the customer project create a new folder name it Exercises.
- Add a new UIController under the new folder, name it ShowCustomerPerRegion.
- Set the Customers entity as the main table.
- In the Run method add a parameter : type Number name pRegionID.
- Add a where in the Run method to show only customer that have the same Region have the parameter, notice that you will need to use .ToString().
- Add the following columns to a grid on the form:
- CustomerID.
- CompanyName.
- Address.
- City.
- Region.
- In ShowRegions.
- Add a button to the screen, set the button text to Show Region Customers.
- Try to call the ShowCustomerPerRegion from the button click event.
- In NorthwindInterfaces project, under Customers folder, create a new folder name it Exercises.
- Add a new interface, name it IShowCustomerPerRegion.
- Set the new interface to be public.
- Add the Run with the same parameter definition as ShowCustomerPerRegion.(you will need to add using to Firefly.Box).
- build NorthwindBase.
- In ShowCustomerPerRegion add the interface next to the UIControllerBase.
- In ShowRegionsView use Create to call IShowCustomerPerRegion remember:
- Use the full NameSpace.
- Send the right parameter.
- Save changes to Git.
- Build and test.
Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com