home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / DATABASE / DPG.ZIP / VRENT.DPG < prev    next >
Text File  |  1992-04-23  |  4KB  |  225 lines

  1. files
  2.  
  3. video
  4. {
  5.     str 20 category
  6.     int 2 copies
  7.     int 2 in_stock
  8.     float 2 2 rent
  9.     date release_date
  10. }
  11. index title 20
  12.  
  13. customer
  14. {
  15.     str 20 full_name
  16.     str 20 address_1
  17.     str 20 address_2
  18.     str 20 address_3
  19. }
  20. index account_name 20
  21.  
  22. transaction
  23. {
  24.     str 20 title
  25.     date transaction_date
  26.     str 1 type
  27. }
  28. on { customer }
  29.  
  30. procedures
  31.  
  32. wait
  33. {
  34.     printstr 30 20 "Press any key to continue"
  35.     cursor 56 20
  36.     pause
  37. }
  38.  
  39. show_video
  40. {
  41.     printstr 10 6 "Category"
  42.     printstr 10 7 "Copies"
  43.     printstr 10 8 "Copies in Stock"
  44.     printstr 10 9 "Rental Charge"
  45.     printstr 10 10 "Release Date"
  46.  
  47.     printstr 30 5 video.title
  48.     printstr 30 6 video.category
  49.     printint 30 7 video.copies
  50.     printint 30 8 video.in_stock
  51.     printfloat 30 9 video.rent
  52.     printdate 30 10 video.release_date
  53. }
  54.  
  55. alter_video
  56. {
  57.     show_video
  58. :CATEGORY
  59.     edit video.category 30 6 { return esc=END down }
  60. :COPIES
  61.     edit video.copies 30 7 { return esc=END up=CATEGORY down }
  62. :IN_STOCK
  63.     edit video.in_stock 30 8 { return esc=END up=COPIES down }
  64. :RENT
  65.     edit video.rent 30 9 { return esc=END up=IN_STOCK down }
  66. :RELEASE_DATE
  67.     edit video.release_date 30 10 { return esc up=RENT }
  68. :END
  69.     write video
  70. }
  71.  
  72. add_video "Videos!Add a Video"
  73. {
  74.     printstr 10 5 "Title"
  75.     create 30 5 video { return esc=CANCEL }
  76.     alter_video
  77.     return
  78. :CANCEL
  79.     delete video
  80. }
  81.  
  82. edit_video "Videos!Edit a Video"
  83. {
  84.     printstr 10 5 "Title"
  85.     select video 30 5 { return esc=CANCEL }
  86.     alter_video
  87. :CANCEL
  88. }
  89.  
  90. display_video "Videos!Display a Video"
  91. {
  92.     printstr 10 5 "Title"
  93.     select video 30 5 { return esc=CANCEL }
  94.     show_video
  95.     wait
  96. :CANCEL
  97. }
  98.  
  99. remove_video "Videos!Remove a Video"
  100. str 1 sure
  101. {
  102.     printstr 10 5 "Title"
  103.     select video 30 5 { return esc=CANCEL }
  104.     show_video
  105.     printstr 30 20 "Are you sure? (Y/N) "
  106.     cursor 50 20
  107.     getkey sure
  108.     if !strcmp sure "Y"
  109.         delete video
  110. :CANCEL
  111. }
  112.  
  113. show_customer
  114. {
  115.     printstr 10 6 "Full Name"
  116.     printstr 10 7 "Address"
  117.  
  118.     printstr 30 5 customer.account_name
  119.     printstr 30 6 customer.full_name
  120.     printstr 30 7 customer.address_1
  121.     printstr 30 8 customer.address_2
  122.     printstr 30 9 customer.address_3
  123. }
  124.  
  125. alter_customer
  126. {
  127.     show_customer
  128. :FULL_NAME
  129.     edit customer.full_name 30 6 { return esc=END down }
  130. :ADDRESS_1
  131.     edit customer.address_1 30 7 { return esc=END up=FULL_NAME down }
  132. :ADDRESS_2
  133.     edit customer.address_2 30 8 { return esc=END up=ADDRESS_1 down }
  134. :ADDRESS_3
  135.     edit customer.address_3 30 9 { return esc up=ADDRESS_2 }
  136. :END
  137.     write customer
  138. }
  139.  
  140. add_customer "Customers!Add a Customer"
  141. {
  142.     printstr 10 5 "Account Name"
  143.     create 30 5 customer { return esc=CANCEL }
  144.     alter_customer
  145.     return
  146. :CANCEL
  147.     delete customer
  148. }
  149.  
  150. edit_customer "Customers!Edit a Customer"
  151. {
  152.     printstr 10 5 "Account Name"
  153.     select customer 30 5 { return esc=CANCEL }
  154.     alter_customer
  155. :CANCEL
  156. }
  157.  
  158. display_customer "Customers!Display a Customer"
  159. {
  160.     printstr 10 5 "Account Name"
  161.     select customer 30 5 { return esc=CANCEL }
  162.     show_customer
  163.     wait
  164. :CANCEL
  165. }
  166.  
  167. remove_customer "Customers!Remove a Customer"
  168. str 1 sure
  169. {
  170.     printstr 10 5 "Account Name"
  171.     select customer 30 5 { return esc=CANCEL }
  172.     show_customer
  173.     printstr 30 20 "Are you sure? (Y/N) "
  174.     cursor 50 20
  175.     getkey sure
  176.     if !strcmp sure "Y"
  177.         delete customer
  178. :CANCEL
  179. }
  180.  
  181. enter_transactions_show
  182. {
  183.     printstr 0 (-1) transaction.title
  184.     printdate 30 (-1) transaction.transaction_date
  185.     printstr 50 (-1) transaction.type
  186. }
  187.  
  188. enter_transactions_edit
  189. {
  190.     switch fieldno { TITLE LOAN_DATE TYPE }
  191. :TITLE
  192.     edit transaction.title 0 (-1) { return esc up down right pgup pgdn home end ins del }
  193.     return
  194. :LOAN_DATE
  195.     edit transaction.transaction_date 30 (-1) { return esc up down left right pgup pgdn home end ins del }
  196.     return
  197. :TYPE
  198.     edit transaction.type 50 (-1) { return esc up down left pgup pgdn home end ins del }
  199.     return
  200. }
  201.  
  202. enter_transactions "Transactions!Enter Transactions"
  203. {
  204.     printstr 10 5 "Account Name"
  205.     select customer 30 5 { return esc=CANCEL }
  206.     show_customer
  207.     printstr 0 11 "Film Title"
  208.     printstr 30 11 "Transaction Date"
  209.     printstr 50 11 "Type (L/R)"
  210.     scroll transaction customer 3 enter_transactions_show enter_transactions_edit 0 13 80 12
  211. :CANCEL
  212. }
  213.  
  214. display_transactions "Transactions!Display Transactions"
  215. {
  216.     printstr 10 5 "Account Name"
  217.     select customer 30 5 { return esc=CANCEL }
  218.     show_customer
  219.     printstr 0 11 "Film Title"
  220.     printstr 30 11 "Transaction Date"
  221.     printstr 50 11 "Type (L/R)"
  222.     scroll transaction customer 3 enter_transactions_show 0 0 13 80 12
  223. :CANCEL
  224. }
  225.