Hi all,
I am programming a windows application with multiple forms (MDI), wich is ment to be a combination of a CRM and an accounting application.
I have already implemented the datatiers (DAL and BLL). Now I am designing the forms, but I don't know how I should solve this task :
In my database I have 4 tables that should provide generic lists of possible values to multiple forms :
- list countries (ISO values) with ID, international number, abbriviation, name and internatial phone code, providing values to the zipcodes-table and narowing the possible zips in forms - e.g.:
1, 56, 'BE', 'Belgium', '+32'
2, 826, 'GB', 'United Kingdom', '+44'
- list of zipcodes with ID country ID, Zipcode, Place, providing the location Id in the adresses-table - e.g.:
1, 32, '3000', 'Leuven'
2, 826, 'EC1A 4JA', 'London'
- list of valuetables with ID, LanguageID, Label and Last used value - e.g.:
1, 3, 'genders', 2
2, 3, 'contact titles', 2
3, 3, 'professions', 0
4, 3, 'legal statute', 0
5, 3, 'kind of address', 0
- list of values for each valuetable with ID, valuetableID, LanguageID, Number, Label and Abbriviation - e.g.:
1, 1, 3, 1, 'male', ''
2, 1, 3, 2, 'female', ''
3, 2, 3, 1, 'Sir', 'Sr'
4, 2, 3, 2, 'Miss', 'Ms'
Tables 1, 2 and 4 should be available to all forms as generic lists to populate comboboxes to set or show the values in the form for the row shown in other tables with a displaymember and a valuemember.
In each form I will then set each combo, e.g. :
cbo_gender.datasource = GenericTable("Genders",user.Language)
cbo_gender.DisplayMember = "Label"
cbo_gender.ValueMember = "Number"
cbo_gender.SelectedIndex = IIf(IsNothing(Item.GenderID),-1,Item.GenderID)
Any idea how I should provide this generic lists in my application? I have no clue for the moment... Thanks in advance!