Table of Content
HAL Forum
procedure AddPerson (
var string Persons,string NewPerson)
Description:
Adds new user code to comma separated person string. The limit for the filled list is 60 characters.
Parameters:
Persons String that is filled with comma separated user code list.
NewPerson NewPerson code to be added
global
updating function Boolean MoveActivity2(Integer compnr,LongInt sernr,string oldperson,string newperson,Date newdate,Time newtime)
BEGIN
  Boolean movedf;
  Integer nwn;
  record ActVc Actr;
  record ActVc oldActr;
  string 255 tstr;
  LongInt actlend;

  if (compnr!=CurrentCompany) then begin
    MessageBox(2245,"");
    goto LMoveActivity2;
  end;
  Actr.SerNr = sernr;
  if (ReadFirstMain(Actr,1,true)) then begin
    if (Actr.OKFlag!=0) then begin
      MessageBox(23165,"");
      goto LMoveActivity2;
    end;
    RecordCopy(oldActr,Actr);
    if (oldperson==newperson) then begin
      actlend = DateDiff(Actr.EndDate,Actr.TransDate);
      Actr.TransDate = newdate;
      if (nonblanktime(newtime)) then begin
        Actr.StartTime = newtime;
      end;
      if (nonblankdate(Actr.EndDate)) then begin
        Actr.EndDate = newdate;
        Actr.EndDate = AddDay(Actr.EndDate,actlend);
      end;
      Actr.EndTime = AddTime3(Actr.StartTime,Actr.CostTime);
    end else begin
      tstr = Actr.MainPersons;
      NormalizePersons(tstr,oldperson,true);
      AddPerson(tstr,newperson);
      NormalizePersons(tstr,"",false);
      Actr.MainPersons = tstr;
    end;
    if (RecordUpdate(oldActr,Actr,false)==0) then begin
    end;    
    movedf = true;
  end;
LMoveActivity2:;  
  MoveActivity2 = movedf;
  RETURN;
END;
Related topics:
««