Exemplo n.º 1
0
logical sNotiz :: DBStored ( )
{
  PropertyHandle   *ph      = GetPropertyHandle();
  logical           del_opt = UNDEF;
BEGINSEQ
  if ( !ph->IsServer() )                            LEAVESEQ
  if ( !UserState1() )                              LEAVESEQ
  SetUserState1(NO);
  
  del_opt = ph->GPH("wiedervorlage")->IsEmpty();
  
  PropertyHandle   notizen_wv(ph->GetDBHandle(),"NotizWiedervorlage",PI_Write);
                                                    SDBCERR
  if ( notizen_wv.Get(ph->ExtractKey()) )
  {
    if ( !del_opt )                                 LEAVESEQ
    notizen_wv.Delete();
  }
  else
  {
    if ( del_opt )                                  LEAVESEQ
    notizen_wv.AddReference(*ph);
  }
RECOVER

ENDSEQ
  return(NO);
}
logical sODC_Project :: SetupReferences ( )
{
  PropertyHandle   *ph   = GetPropertyHandle();
  logical           term = NO;
BEGINSEQ
  if ( !ph->IsServer() )                             LEAVESEQ
  if ( ph->NoWrite() )                               ERROR
    
  pc_ODC_Project    project_pc(ph);
  project_pc.SetupReferences();

  ph->Save();                                        SDBCERR

RECOVER
  term = YES;
ENDSEQ
  return(term);
}
logical sODC_Project :: GetLinkCommand ( )
{
  PropertyHandle   *ph   = GetPropertyHandle();
  NString           nstring;
  logical           term = NO;
BEGINSEQ
  if ( !ph->IsServer() )                             LEAVESEQ

  SetResult("");

  if ( !ph->IsSelected() )                           ERROR
  if ( !ph->IsPositioned() )
    if ( !ph->Get().GetData() )                      ERROR
    
  pc_ODC_Project    project_pc(ph);
  SetResult(project_pc.GetLinkCommand(nstring,NO));
RECOVER
  term = YES;
ENDSEQ
  return(term);
}
logical sODC_Project :: InitializeExternalResources ( )
{
  PropertyHandle   *ph         = GetPropertyHandle();
  char             *folder_opt = Parm(1);
  NString           nstring;
  logical           term       = NO;
BEGINSEQ
  if ( !ph->IsServer() )                             LEAVESEQ

  SetResult("");

  if ( !ph->IsSelected() )                           ERROR
  if ( !ph->IsPositioned() )
    if ( !ph->Get().GetData() )                      ERROR
    
  pc_ODC_Project    project_pc(ph);
  project_pc.InitializeExternalResources(&nstring,folder_opt && *folder_opt == 'Y' ? YES : NO);
  SetResult(nstring);

RECOVER
  term = YES;
ENDSEQ
  return(term);
}
Exemplo n.º 5
0
logical sNotiz :: DBModify ( )
{
  PropertyHandle   *ph = GetPropertyHandle();

BEGINSEQ
  if ( UserState2() )                                LEAVESEQ
  if ( !ph->IsServer() )                             LEAVESEQ
  if ( !strcmp(ph->GetPropertyPath(),"NotizWiedervorlage") )   
                                                    LEAVESEQ
  PropertyHandle  old_wv(ph->GetStructDef(),"wiedervorlage",GetOldInstance());
  PropertyHandle  old_typ(ph->GetStructDef(),"typ",GetOldInstance());
  PropertyHandle *wiedervorlage = ph->GPH("wiedervorlage");
  PropertyHandle *typ = ph->GPH("typ");
  
  if ( *typ != old_typ )
    InitWV();

  if (  *wiedervorlage != old_wv &&
         (wiedervorlage->IsEmpty() || old_wv.IsEmpty()) ) 
    SetUserState1(YES);

ENDSEQ
  return(NO);
}