Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Am I breaking the rules?
Message
De
01/12/2003 10:18:50
 
 
À
27/11/2003 02:54:11
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00853966
Message ID:
00854675
Vues:
12
>Hi,
>In my app, item price is determined by couple of criteria, such as
>
>1. is it promotion item?
>2. is it sold to member?
>
>and etc
>
>I want the "correct" price shown immediately after user select from combobox. Am i break the 3-tier rules if I issue REPLACE price WITH xxxx in combobox.interactivechage? Any other better place to do these, in bizobj, .. ?
>

Why are you attempting to change the price at that point? It seems like you should have some kind of lookup function that would determine the correct price to display. Membership is a customer property, while promotional seems to be item specific, so I'd code it like the following:
oItem.GetPrice(ItemNumber, IsMember)
     tPrice = v_Item.Price
     IF This.IsOnPromotion(ItemNumber)
          tPrice = tPrice * PromotionDiscount
     ENDIF
     IF IsMember
          tPrice = tPrice * MembershipDiscount
     ENDIF
     RETURN tPrice
REPLACEing it there isn't a violation of n-tier. You're changing the UI layer representation, any real change will have to be passed back to the data store to be saved.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform