Страница 2 из 2

Транзакция в форме

Добавлено: 18 Ноябрь 2015, 15:09
kreator
В форме в Embeds объекта Windows Manager метода Kill с приоритетом 5600 можно написать текст (не выдумываю, реальный кусок):

Код: Выделить всё

ThisWindow.Kill PROCEDURE

ReturnValue          BYTE,AUTO

! Start of "WindowManager Method Data Section"
! [Priority 5000]

! End of "WindowManager Method Data Section"
  CODE
  ! Start of "WindowManager Method Executable Code Section"
  ! [Priority 2300]
  
  ! UNBIND variables
  ! [Priority 4800]
  
  ! Parent Call
  ReturnValue = PARENT.Kill()
  ! [Priority 5050]
  
  ! Short-stop if kill called already
  IF ReturnValue THEN RETURN ReturnValue.
  IF SELF.FilesOpened
  ! [Priority 5600]
  if (self.Request=InsertRecord and self.Response=RequestCancelled) or (self.Request=DeleteRecord and self.Response=RequestCompleted)
    Counter# = 0
    FINT{prop:SQL} = 'select count(*) '                                                 & |
                     'from defect d '                                                   & |
                     'where d.id_ums=' & DEF:ID_UMS & ' and d.nomdok=' & LOC:NewDoc
    next(FINT)
    if ~errorcode()
      Counter# = FINT.RVAL  
    end
    if ~Counter#
      FINT{prop:SQL} = 'delete from kts k '             & |
                       'where k.id_kts=' & LOC:NewDoc
      SQLERR(FINT{prop:SQL})
    end    
    FINT{prop:SQL} = 'delete from fileesk f '           & |
                     'where f.id_tabl=' & LOC:NewDoc
    SQLERR(FINT{prop:SQL})
  end  
Мне кажется этого достаточно.