Friday, March 23, 2012

New version of nHibernateCF with new demo project released

During the development of nHibernateCF, I took notice that is nice and important to have a more complex demo project which shows the capabilities of nHibernateCF.

I decided to create a project named ‘DeliverySystem’. It contains a couple of data objects and forms which demonstrates how can nHibernateCF can used on Windows CE/Windows Mobile powered devices.

During the development of the demo project, I saw some bugs in nHibernateCF which I fixed.

Fixed bugs:

  • Bags will be updated updated correctly without doubling the elements which a still in the bag.
  • Criterias can be used for bags

Furthermore, I tried to gave all methods, enumerations, etc. an Intellisense documentation so that is easier for developers to use nHibernateCF in their projects.

I also added a new project to the nHibernateCF solution called ‘Tools’. At the moment it contains just user controls. One control displays all logging information which nHibernateCF generated, the other displays all exceptions which nHibernateCF may have.


Projects ‘DeliverySystem’ and ‘DeliverySystemData’

I decided to split the demo project in two separate projects. The ‘DeliverySystem’-project is the main project which contains all the forms and nHibernateCF-stuff.


Project ‘DeliverySystem’

The ‘DeliverySystem’-demo-application is just a kind of simple application for mobile salesman/woman. It is not a stylish application, just a tech demo which demonstrates the capabilities of nHibernateCF. I will show here for the moment all screen which the application contains. It is a kind of short manual how the application should be used. You’ll find all the method calls in the source code of the demo-application and in one of the following blog entries, I’ll talk about them.



At the first time, when the application started, the database will be created and you have create a new user.



For the usage of the application, a couple data is required. If not all required data is available, this screen will be displayed. If a type of data is available, the button in this screen will be disabled. In the Program menu is another possibility to add or edit these data.



At the first button, you can add and/or edit some information for the both(or more) genders.
The first form shows a list with all available genders.
With the right menu you can add a new gender.

The look-and-feel of the kind, how the application manipulates the genders (only in the demo-application) is more often used in the demo-application like when you manipulate salutation, article groups or articles.



The add/edit form is just a simple dialog box with some controls to display or enter some data.




In the next step you have to add a couple of salutations, like one or two for each gender.


In this screen you need to select a gender for the current salutation, you can add a text for the salutation in a letter, a short and a long description.



There you can select the gender for the salutation.



After you have done that, you have one or more salutations.




The next step is to add a couple of groups for different types of articles you might have.


015 016

The last of the first four important steps in to add some articles. In the demo-application you can give them a name and two description, a short and a long one. At least you can select one or more groups of articles to which the current article should count.


Up to now you can use the demo-application. The next steps are to add the customers and orders.


This is the new(or normal) login screen after the first start of the demo-application.


This is the new(or normal) start screen after the login.
To edit or add the basic data you’ll find the possibilities in the ‘Program’ menu.



  The customer in the demo-application contains just a few properties. A salutation (with gender), first- and lastname, one or more addresses. In most cases in the demo-application, all list controls have a context menu which allows you different operations.


An address in the demo-application has just a few properties, too. You can enter in the screen a street name, a house number, an additional house number, a postal code and the name of town where the customer lifes.

After clicking on the ‘Customers’ button on the start screen, you’ll get a well-known list. In this case it is the list of all available customers. After the first start the list should be empty. With clicking on the ‘New’ button in the lower left corner of the screen, you can add a new customer.



In this list, all available customers will be displayed. Select the customer of your choice and click on ‘Select’

With this screen, you’ll able to enter all data for the new order. Edit the date of the order, select addresses for delivery and invoice and add some articles from your list of articles.

If you have added one or more customers, it will be the time to add an order to a customer. With clicking on the ‘Orders’ button at the start screen, you’ll get another well known list screen. At this point, it is a list with all available customers to which you can add a new order. Select a customer an click on the ‘Select’ button in the lower left corner of the screen.



The addresses in this list are all from the list of addresses of the selected customer.

To add one or more articles to the order, just use the context menu to do that. There will be open a new screen in which you can search for the article/s of your choice.



After you filled all controls, the order screen should look like this one. Press in the ‘Save’ button on the lower left corner of the screen to save the order.


There is another screen in the demo application which you can reach from the ‘Program’ menu on the start screen. This screen contains all the status information from nHibernateCF.


On the left tab there all logging information which nHibernateCF generates during the run time and on the right tab there all exceptions listed which nHibernateCF might have.

Project ‘DeliverySystemData’

The ‘DeliverySystemData’-demo –application contains the data objects and some additional helper methods which die ‘DeliverySystem’-demo-application needs. As an example, I’ll only name a method to make a specified address as default address for a customer in a list of addresses.