logical pc_TopicFromOldStyle :: Setup_ODC_PFunction (PropertyHandle *prophdl )
{
  PropertyHandle  *imp_parms   = prophdl->GPH("imp_parms");
  PropertyHandle  *retval      = prophdl->GPH("retval");
  PropertyHandle  *retval_name = GPH("retval_name");
  int32            indx0       = 0;
  logical          term        = NO;
BEGINSEQ
  if ( Setup_SDB_Resource(prophdl) )                 ERROR
  *GPH("action") = *prophdl->GPH("action");
  
  pc_TopicFromOldStyle  implementations(GPH("implementations"));
  while ( implementations.Get(indx0++) )
    if ( imp_parms->Get(implementations.ExtractKey()) )
      implementations.Setup_ODC_FunctImp(imp_parms);

  if ( *retval_name->GetString()     &&
        retval->Get(FIRST_INSTANCE)  &&
       *retval_name == *retval->GPH("sys_ident") )
  {
    PropertyHandle       var_ph(GetDBHandle(),"ODC_Variable",PI_Write);
    pc_TopicFromOldStyle variables(&var_ph);
    if ( variables.Get(*retval_name) )
      variables.Setup_SDB_Resource(retval);
  }

  Save();
RECOVER
  term = YES;
ENDSEQ
  return(term);
}
logical pc_TopicFromOldStyle :: Setup_SDB_Resource (PropertyHandle *prophdl )
{
  PropertyHandle   *resource_ref      = GPH("resource_ref");
  PropertyHandle   *description       = resource_ref->GPH("description");
  PropertyHandle   *srce_description  = NULL;
  int32             empty_num         = 0;
  int               repl_opt          = TestSysVariable("REPLACE_DESCRIPTIONS","YES") ? YES :
                                        TestSysVariable("REPLACE_DESCRIPTIONS","NO")  ? NO  : AUTO;
  logical           term              = NO;
BEGINSEQ
  if ( !(srce_description = Check(prophdl)) )        ERROR
    
  if ( !resource_ref->Get(FIRST_INSTANCE) )
    resource_ref->Add(Key((char *)&empty_num));
  
  if ( description->Get(FIRST_INSTANCE) )
  {
    if ( *description == *srce_description )         LEAVESEQ
    if ( repl_opt == NO ||
         (repl_opt == AUTO && !SDBError().GetDecision(992,GPH("sys_ident")->GetString(),"different despription topic does already exist in structure/implementation.\nOverwrite from old style desctiption? ")) )
                                                     LEAVESEQ
    description->Delete();
  }
  
  *description = *srce_description;
RECOVER
  term = YES;
ENDSEQ
  return(term);
}
logical sSDB_Attribute :: SetDefaultsForSpecialType (DatabaseHandle &dbhandle, char *propnames, char *typenames )
{
  PropertyHandle    *prophdl = GetPropertyHandle();
  return ( ((SDB_Attribute *)prophdl->Get().GetData())->
              Fill(dbhandle,propnames,typenames)         );


}
logical pc_TopicFromOldStyle :: Setup_ODC_FunctImp (PropertyHandle *prophdl )
{
  PropertyHandle  *description = prophdl->GPH("description");
  logical          term        = NO;
  description->Get(FIRST_INSTANCE);
  Setup_SDB_Resource(description);
  
  pc_TopicFromOldStyle  parameters(GPH("parameters"));
  parameters.Setup_collection(prophdl->GPH("parm_description"));
  return(term);
}
Exemplo n.º 5
0
char *pc_Action :: CalculateBetreffAusgangsNotiz (NString &nstring )
{
  PropertyHandle    *versicherungsnehmer = GPH("versicherungsnehmer");
  nstring  = "";
  nstring.Append("Transparent ");
  GetIdentString(nstring,YES,NO);
  nstring.Append(", ");
  
  versicherungsnehmer->Get(FIRST_INSTANCE);
  pc_Actor(versicherungsnehmer).GetIdentString(nstring,YES,NO);

  return(nstring);
}
logical sODS_Description :: SetupResRef ( )
{
  PropertyHandle         *ph = GPH("resource_ref");
  logical                 term = NO;
BEGINSEQ
  if ( !ph )                                         ERROR

  if ( ph->Get(FIRST_INSTANCE) )                     LEAVESEQ

  ph->Add(0);
  ph->GPH("description")->Provide(0);
RECOVER
  term = YES;
ENDSEQ
  return(term);
}
logical pc0_HausratVS :: ImportResult (PropertyHandle *source_ph, TP_ImportGlobals *imp_globals )
{
  pc0_Leistung    leistungenO(GPH("leistungenO"));
  pc0_Leistung    leistungenI(GPH("leistungenI"));
  pc0_Leistung    leistungenD(GPH("leistungenD"));
  PropertyHandle *versicherungsnehmer = GPH("versicherungsnehmer");
  logical         term                = NO;
BEGINSEQ
  if ( pc0Base_VS::ImportResult(source_ph,imp_globals) ) 
                                                    ERROR
                                                    
  *GPH("versicherungssumme") = *source_ph->GPH("Deckungssumme");
  *GPH("wohnobject_plz")     = *source_ph->GPH("Plz");
  *GPH("wohnobject_typ")     = source_ph->GPH("WohnobjectTyp_ID")->GetInt();

  leistungenO.Import("Unterversicherungsverzicht",source_ph->GPH("Unterversicherungsverzicht"),imp_globals);
  leistungenO.Import("ElementarSchaeden"         ,source_ph->GPH("ElementarSchaeden"),imp_globals);
  leistungenO.Import("Glaskeramik"               ,source_ph->GPH("Glaskeramik"),imp_globals);
  leistungenO.Import("Spezialrisiken"            ,source_ph->GPH("Spezialrisiken"),imp_globals);

  leistungenI.Import("Wohnflaeche"               ,source_ph->GPH("QmWohnflaeche"),imp_globals);
  leistungenI.Import("Glasflaeche"               ,source_ph->GPH("QmGlasflaeche"),imp_globals);
  leistungenI.Import("Wertsachen"                ,source_ph->GPH("Wertsachen"),imp_globals);
  leistungenI.Import("Wasseraustritt"            ,source_ph->GPH("Wasseraustritt"),imp_globals);
  leistungenI.Import("Implosion"                 ,source_ph->GPH("Implosion"),imp_globals);
  leistungenI.Import("Nutzwaermeschaeden"        ,source_ph->GPH("Nutzwaermeschaeden"),imp_globals);
  leistungenI.Import("Lagerkosten"               ,source_ph->GPH("Lagerkosten"),imp_globals);
  leistungenI.Import("GewerblicheSachen"         ,source_ph->GPH("GewerblicheSachen"),imp_globals);
  leistungenI.Import("Gartenmoebel"              ,source_ph->GPH("Gartenmoebel"),imp_globals);
  leistungenI.Import("DiebstahlAUSPkw"           ,source_ph->GPH("DiebstahlAUSPkw"),imp_globals);
  leistungenI.Import("Bankschliessfaecher"       ,source_ph->GPH("Bankschliessfaecher"),imp_globals);
  leistungenI.Import("Aussenversicherung"        ,source_ph->GPH("Aussenversicherung"),imp_globals);

  leistungenD.Import("Selbstbehalt"              ,source_ph->GPH("Selbstbehalt"),imp_globals);
  leistungenD.Import("Fahrraeder"                ,source_ph->GPH("Fahrraeder"),imp_globals);
  leistungenD.Import("Ueberspannung"             ,source_ph->GPH("Ueberspannung"),imp_globals);

  if ( versicherungsnehmer->Get(FIRST_INSTANCE) )
    pc0_Arbeit(versicherungsnehmer->GPH("job")).ImportOD(source_ph->GPH("OD"),imp_globals);
RECOVER
  term = YES;
ENDSEQ
  return(term);
}
logical sODC_Project :: GetProjectPath ( )
{
  PropertyHandle   *ph   = GetPropertyHandle();
  NString           nstring;
  logical           term = NO;
BEGINSEQ
  SetResult("");   
  
  if ( !ph->IsSelected() )                           ERROR
  if ( !ph->IsPositioned() )
    if ( !ph->Get().GetData() )                      ERROR

  pc_ODC_Project    project_pc(ph);
  SetResult(project_pc.GetProjectPath(nstring,Parm(1)));
RECOVER
  term = YES;
ENDSEQ
  return(term);
}
PropertyHandle *pc_ADK_Class :: ProvideDefaultControl (PropertyHandle *prophdl, logical &rhgrow, logical &rvgrow )
{
  PropertyHandle *fc        = GPH("controls");
  char           *meta_type = prophdl->GetCurrentType();
  char           *type      = prophdl->GPH("ddetype")->GetString();
  int32           size      = prophdl->GPH("ddesize")->GetInt();
  logical         term      = NO;
BEGINSEQ
  if ( !strcmp(meta_type,"SDB_Attribute") )
  {
    if ( !strcmp(type,"LOGICAL") || !strcmp(type,"bool") )
    {
      PropertyHandle phLOGICAL("LOGICAL");
      PropertyHandle ph_CheckBox("_CheckBox");
      if ( !Get(phLOGICAL) )                        ERROR
      if ( !fc->Get(ph_CheckBox) )                  ERROR
      rhgrow = NO;
      rvgrow = NO;
    }
    else if ( !strcmp(type,"DATE") )
Exemplo n.º 10
0
PropertyHandle *pc_ADK_Class :: ProvideDefaultCollectionControl (PropertyHandle *prophdl, logical &rhgrow, logical &rvgrow )
{
  PropertyHandle *fc        = GPH("controls");
  char           *fc_names;
  if (prophdl->GPH("ddedim")->GetInt() == 1) 
     fc_names =  "_Single";
   else "_Multiple";
  logical         term      = NO;
BEGINSEQ
  PropertyHandle phCOLLECTION("COLLECTION");
  PropertyHandle phfc_names(fc_names);
  if ( !Provide(phCOLLECTION) )                     ERROR
  if ( !fc->Get(phfc_names) )                       ERROR
  
  if ( prophdl->GPH("ddedim")->GetInt() == 1 )
    rvgrow = NO;

/*  
  PropertyHandle   astract_class(*this);
  PropertyHandle *abstract_fc = astract_class.GPH("controls");

  if ( !astract_class.Get(PropertyHandle("COLLECTION")) )
                                                     ERROR
  if ( !abstract_fc->Get(PropertyHandle(fc_names)) ) ERROR
    
  if ( !Provide(*prophdl->GPH("ddetype")) )          ERROR
  if ( !fc->Get(PropertyHandle(fc_names)) )
  {
    fc->Copy(*abstract_fc);                          SDBCERR
  }
*/

RECOVER
  fc   = NULL;
  term = YES;
ENDSEQ
  return(fc);
}
Exemplo n.º 11
0
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);
}