Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need design suggestions
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00492048
Message ID:
00492328
Vues:
12
>>Hi everybody,
>>
>>I think, this question is pretty basic, but I hadn't experience with it so far.
>>
>>I want to create three tables:
>>CustomerSpecific:
>>    CustomerID ImportantLender WhatKindOfReport etc.
>>       |
>>    Regions table
>>    CustomerID RegionID RegionName etc
>>           |
>>           RegionsSpecific
>>           RegionID Town TownName
>>
>>The user should be able to pick a customer from customer table (with probably additional functionality to add new customers), then fill some specific info about customer criteria - one record in the first table, then he/she should be able to create region groups, e.g. assign a name for each group and associate towns with each region group (ever using Mover ListBox or multiselect Grid - I haven't decided yet).
>>
>>Now my question is:
>>How should I organize Add/Edit functionality for this design? Is it possible to do using views? Does the proposed table model seem rational?
>>
>>Could you please give me some advices here?
>>
>>Thanks in advance.
>

>For the first time you do that you can use something like:
>
Select Regions.RegionID as RegionID, Cities.Town, Cities.TownName;
>   from Cities;
>   where Cities.Selected;
>   into cursor myCursor
>Of course you need a selected field then in your multiselect grid.
>Tot create the edit view where you see the original items selected and where you can select others you may try this:
>
Select Cities.Town, Cities.TownName, .f. as selected;
>   from Cities;
>   where Cities.Town not in;
>   (select RegionSpecific.Town from RegionSpecific);
>   union;
>   Select RegionSpecific.town,RegionSpecific.TownName,.T.;
>   from RegionSpecific;
>   order by Town
>Maybe this works.
>PS. This code is not tested yet and possible it can be optimized

Hi Ko,

Actually, my question was about form design and how should I organize the type of interface I have in mind. Suppose, I create a view. Now, how should I allow new configuration? E.g. 1) Select customer and fill related info, then create Region entries (IOW, CustomerID should be automatically assigned to the selected customer, if it's changed, it should be changed in regions table also). Finally, each region should allow to select towns, and RegionCode in TownSpecific table should be automatically set correctly. This is my problem. Is it feassable with a view or should I use three tables instead?

Thanks.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform