home *** CD-ROM | disk | FTP | other *** search
/ Taifun Collection / Taifun_Collection_Vol_1.iso / richter / 8659 / 8659.mhs / RICHTER.DTP / KFZ / KFZ8.SC < prev    next >
Text File  |  1991-12-22  |  3KB  |  132 lines

  1. ; Kfz8
  2.  
  3.  
  4.  
  5. AppLib = "Kfz3"
  6. if (not isfile(AppLib + ".lib")) then
  7.   Createlib AppLib
  8. endif
  9.  
  10.  
  11. proc Kfz8S1()
  12. private opResult, tbl, rt, EscEnter, rechseh
  13.  
  14.   Play "Kfzq1"    ; put query on workspace
  15.   if (ApplicErrorRetVal) then
  16.     ClearAll
  17.     return FALSE
  18.   endif
  19.  
  20.  
  21.   Readlib "Kfzutl" EnterVal
  22. ; holt einen Wert für die Variable rechseh
  23.       rechseh = EnterVal("Auftragsnummer für Rechnung sehen: ", "S", "", 0)
  24.   Release Procs EnterVal
  25.   if (EscEnter) then
  26.     ClearAll
  27.     return FALSE
  28.   endif
  29.  
  30.   Readlib "Kfzutl" QueryDoIt
  31.   rt = QueryDoIt()
  32.   Release Procs QueryDoIt
  33.  
  34.   if (not rt) then
  35.     return FALSE
  36.   endif
  37.  
  38.   Readlib "Kfzutl"  ReportTable
  39.  
  40.   opResult = ReportTable("Antwort", "Reart", "1", "Screen", "")
  41.  
  42.   Release Procs ReportTable
  43.  
  44.   return opResult
  45. endproc
  46.  
  47. Writelib AppLib Kfz8S1
  48. Release Procs Kfz8S1
  49.  
  50. proc Kfz8S2()
  51. private opResult, tbl, rt, EscEnter, koseh
  52.  
  53.   Play "Kfzq2"    ; put query on workspace
  54.   if (ApplicErrorRetVal) then
  55.     ClearAll
  56.     return FALSE
  57.   endif
  58.  
  59.  
  60.   Readlib "Kfzutl" EnterVal
  61. ; holt einen Wert für die Variable koseh
  62.       koseh = EnterVal("Auftragsnummer für Kostenvoranschlag sehen: ", "S", "", 0)
  63.   Release Procs EnterVal
  64.   if (EscEnter) then
  65.     ClearAll
  66.     return FALSE
  67.   endif
  68.  
  69.   Readlib "Kfzutl" QueryDoIt
  70.   rt = QueryDoIt()
  71.   Release Procs QueryDoIt
  72.  
  73.   if (not rt) then
  74.     return FALSE
  75.   endif
  76.  
  77.   Readlib "Kfzutl"  ReportTable
  78.  
  79.   opResult = ReportTable("Antwort", "Reart", "2", "Screen", "")
  80.  
  81.   Release Procs ReportTable
  82.  
  83.   return opResult
  84. endproc
  85.  
  86. Writelib AppLib Kfz8S2
  87. Release Procs Kfz8S2
  88.  
  89. proc Kfz8Menu()
  90. private x, escape
  91.  
  92.   x = "Rechnung sehen"
  93.   while (TRUE)
  94.     Clear
  95.  
  96.     ShowMenu
  97.         "Rechnung sehen": "Rechnung sehen Option",
  98.         "Kostenvoran. sehen": "Kostenvoran. sehen Option"
  99.       Default x
  100.       To x
  101.  
  102.     switch
  103.       case x = "Rechnung sehen":
  104.         ReadLib "Kfz3" Kfz8S1
  105.         escape = Kfz8S1()
  106.         escape = not escape
  107.         Release Procs Kfz8S1
  108.  
  109.       case x = "Kostenvoran. sehen":
  110.         ReadLib "Kfz3" Kfz8S2
  111.         escape = Kfz8S2()
  112.         escape = not escape
  113.         Release Procs Kfz8S2
  114.  
  115.       case x = "Esc":
  116.         return FALSE
  117.     endswitch
  118.  
  119.     ; Wert von ErrorProc zurücksetzen 
  120.     ErrorProc = "ApplicErrorProc"
  121.     ApplicErrorRetVal = FALSE
  122.  
  123.     if (not escape) then
  124.       return TRUE
  125.     endif
  126.   endwhile
  127. endproc
  128.  
  129. Writelib AppLib Kfz8Menu
  130. Release Procs Kfz8Menu
  131.  
  132.