Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Blockbuster software
Message
De
01/03/2007 06:36:13
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01199898
Message ID:
01199912
Vues:
24
This message has been marked as a message which has helped to the initial question of the thread.
>I have a software for blockbusters
>
>Suppose there are two films with the same name
>The customer has a button in the for to help him
>to create a new record without the work of typing all data again
>So a new record is created with new code, as below
>
>00101 - TERMINATOR
>00102 - TERMINADOR
>00103 - TERMINATOR
>00104 - TERMINATOR
>
>Now I have a customer who is complaining about my software
>
>He said the software should work as below
>
>00101 - TERMINADOR; quantity 3
>
>I don't agree with his logic but I have a doubt
>What do you guys think would be the normal logic for
>most blockbusters ?

Never having worked at a video store, and not having seen their screen displays, I wouldn't know, but I guess that if they like to see it a certain way then that's what they should see.

It would be simple to do:

Count for UPPER( Title) == "TERMINATOR" to lnTitTot.

and display that.

As for the catalogue key, 00101, I find that disturbing. Surely all instances of a particular film should have the same catalogue number, and not have a new no. generated for each created. Then the user could search for the video via title OR catalogue no. (to see how many are in stock, for example). ff the top of my head I'd see the dtabase design as something like:
FILM table
.
CatNo  Title          Rating  Genre   OutOnLoan... etc.
_____  ____________   ______  _______
00101  "TERMINATOR"   18      Action
00102  "TERMINATOR 2" ...
00103  "TERMINATOR 2"
.
The film is only stored once
.
INVENTORY Table
.
CatNo  Instance Rented
_____  ________ ______
00101       001 .T.
00101       002 .F.
00102       001 .T.
00102       002 .T.
00102       003 .F.
00102       004 .F.
.
Each instance of a film is stored in this 1-to-m look-up
.
CUSTOMER table
.
CustID CustName ...
______ _________________  
000001 Roque
000002 Rodriges
000003 ...
.
RENTAL table
.
CustID CatNo Instance DateRent Duration
______ _____ ________ ________ ________
000001 00101       01 ...
000002 00102       01 ...
000106 00102       02
.
The rental of any instance of a film is stored in this m-to-m look up
The compoiste key 
So the above count would be:

Select INVENTORY
Count for CatNo == 00101 and not Rented to lnTitTot.

When a new stock item (instance) of a film is created you merely store its cat no and increment the instance, in the INVENTORY table.

HTH

Terry
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform