Refresh form timer announcements Highlights text blink, flash
[ExtensionOf(FormStr(ESSWorkspace))]
final class BPESSWorkspaceForm_Extension
{
#define.waitTime(10*60*10)
public str notificationTxt;
public void run()
{
next run();
BPAnnouncementTypeXDSUserGroup userGroup;
BPEmployeeAnnouncemtTable announcementTable;
BPEmployeeAnouncementType announcementType;
UserGroupList groupList;
Counter countStr = 0;
while select announcementTable
where announcementTable.IsNotification == NoYes::Yes
&& announcementTable.ValidFromDate <= today()
&& announcementTable.ValidToDate >= today()
exists join announcementType
where announcementType.AnouncementType == announcementType.AnouncementType
notexists join userGroup
where userGroup.AnnouncementType == announcementType.AnouncementType
{
countStr++;
notificationTxt += int2Str(countStr)+". "+announcementTable.AnnouncementText +"\n" ;
}
while select announcementTable
where announcementTable.IsNotification == NoYes::Yes
&& announcementTable.ValidFromDate <= today()
&& announcementTable.ValidToDate >= today()
exists join announcementType
where announcementType.AnouncementType == announcementType.AnouncementType
join userGroup
where userGroup.AnnouncementType == announcementType.AnouncementType
join groupList
where groupList.groupId == userGroup.UserGroupId
&& groupList.userId == curUserId()
{
countStr++;
notificationTxt += int2Str(countStr)+". " +announcementTable.AnnouncementText +"\n" ;
}
this.setTimeOutex(identifierstr(refreshForm), conNull(),3000);
}
public void refreshForm(AsyncTaskResult _result)
{
if (!this.closed()) //otherwise will be executed even after form close.
{
if(announcementTxt.text())
{
announcementTxt.text("");
}
else
{
announcementTxt.colorScheme(FormColorScheme::RGB);
// announcementTxt.backgroundColor(WinAPI::RGB2int(225,225,125));
announcementTxt.foregroundColor(WinAPI::RGB2int(250,0,0));
announcementTxt.text(notificationTxt);
}
this.setTimeOutex(identifierstr(refreshForm), conNull(),3000);
}
}
}
Comments
Post a Comment