Table of Content
HAL Forum
function LongInt DemoDays (
)
Description:
Returns the number of demo days left before HansaWorld Demo goes to Restricted mode
event DefineWindows
begin
  real x,h,h1,h2,h3,h4,h5,h6,h7,v,v2,l,vs,vm,vm2,f,t;
  string 200 regcode,regname,sernr;
  Boolean isreg,haskey;
  
  SetLangMode(LangEnglish,"ENG",0);
  
  isreg = IsIntEnabActive(regcode,regname,haskey,sernr);
  
  if (DemoDays>0) then begin
    if (isreg) then begin
      if (haskey) then begin
        WindowBegin("Registration Information",DemoMsgWClass,CGother,RcType);
      end else begin
        WindowBegin("Database about to go to Restricted mode",DemoMsgWClass,CGother,RcType);
      end;
    end else begin
      WindowBegin("Please take a moment to Register your copy of HansaWorld CRM",DemoMsgWClass,CGother,RcType);
    end;
  end else begin
    WindowBegin("Database is in Restricted mode",DemoMsgWClass,CGother,RcType);
  end;
  DynamicWindow;
  SetWRect(20,80,620,360);
  h = 30; v = 50; vs = 24; l = 180;
  
  if (DemoDays>0) then begin
    if (haskey) then begin
      StaticText(h,v=20,"The enabler will renew itself automatically. Current key is valid for " & DemoDays & " days (" & AddDay(CurrentDate,DemoDays) & ")",false);
    end else begin
      if (DemoDays>20) then begin
        StaticText(h,v=20,"This database will go into Restricted mode in " & DemoDays & " days (" & AddDay(CurrentDate,DemoDays) & ")",false);
      end else begin
        StaticText(h,v=20,"Please get an enabler as soon as possble. This database will go into Restricted mode in " & DemoDays & " days",false);
      end;
    end;
  end else begin
    StaticText(h,v=20,"This database is in Restricted mode",false);
  end;
  
  if (isreg) then begin
    HalPushButton(h,v+=vs,h + l,v + vs,"GetInternetEnabler","Get a new enabler");
    StaticText(h + l + 30,v + 14,"(Will give you a new enabler that is valid for 3 months)",false);
  end;
  
  if (nonblank(regcode)) then begin
    HalPushButton(h,v+=vs,h + l,v + vs,"ReRegisterInHWStep1","Update Registration");
    if (nonblank(regname)) then begin
      StaticText(h + l + 30,v + 14,"(Registered as " & regname & ")",false);
    end else begin
      StaticText(h + l + 30,v + 14,"(No name...)",false);
    end;
  end else begin
    HalPushButton(h,v+=vs,h + l,v + vs,"RegisterInHWStep1","Register this Product");
    StaticText(h + l + 30,v + 14,"(Not registered)",false);
  end;
  
  if (nonblank(regcode)) then begin
    HalPushButton(h,v+=vs,h + l,v + vs,"OpenInternetEnablers","Configure Internet Enabler");
    if (isreg) then begin
      StaticText(h + l + 30,v + 14,"(Already configured)",false);
    end else begin
      StaticText(h + l + 30,v + 14,"(Not configured yet)",false);
    end;
  end;
  
  if (isreg) then begin
    HalPushButton(h,v+=vs,h + l,v + vs,"EnterSerialNumber","Enter Serial Number");
    if (nonblank(sernr)) then begin
      StaticText(h + l + 30,v + 14,"(Registered Serial Number: " & sernr & ")",false);
    end else begin
      StaticText(h + l + 30,v + 14,"(Registers the Serial Number of your copy of HansaWorld CRM)",false);
    end;
    PushButton(h,v+=vs,h + l,v + vs,ToolPayForRegistered,"PAY");
    StaticText(h + l + 30,v + 14,"(Opens a secure website where you can pay for this product)",false);
  end;

  EndWindow;
  
  return;
end;
Related topics:
««