Skip to content

Commit 8c4b6a5

Browse files
committed
scheudler
1 parent 6b8b3e6 commit 8c4b6a5

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

Componants/LocalUtils.cs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,25 +88,32 @@ public static void SchedulerActionGDPR(int portalId)
8888
LogSystem("OS_GDPR - Scheduler: " + DateTime.Now.ToString());
8989
var objCtrl = new NBrightBuyController();
9090
var info = objCtrl.GetByGuidKey(portalId, -1, "OS_GDPRDATA", "OS_GDPRDATA");
91-
var strlastrun = info.GetXmlProperty("genxml/textbox/lastrun");
92-
var debugmode = info.GetXmlPropertyBool("genxml/checkbox/debugmode");
93-
if (Utils.IsDate(strlastrun))
91+
if (info != null)
9492
{
95-
var lastrun = Convert.ToDateTime(strlastrun);
96-
// run between 2am - 3am, once a day.
97-
if ((lastrun < DateTime.Now.Date && DateTime.Now > DateTime.Now.Date.AddHours(2)))
93+
var strlastrun = info.GetXmlProperty("genxml/textbox/lastrun");
94+
var debugmode = info.GetXmlPropertyBool("genxml/checkbox/debugmode");
95+
if (Utils.IsDate(strlastrun))
9896
{
99-
LogSystem("OS_GDPR --------------- START Scheduler ---------------");
100-
ActionGDPR(portalId);
97+
var lastrun = Convert.ToDateTime(strlastrun);
98+
// run between 2am - 3am, once a day.
99+
if ((lastrun < DateTime.Now.Date && DateTime.Now > DateTime.Now.Date.AddHours(2)))
100+
{
101+
LogSystem("OS_GDPR --------------- START Scheduler ---------------");
102+
ActionGDPR(portalId);
103+
}
104+
else
105+
{
106+
LogSystem("OS_GDPR - Scheduler: Invalid Date Time (2am - 3am required)");
107+
}
101108
}
102109
else
103110
{
104-
LogSystem("OS_GDPR - Scheduler: Invalid Date Time (2am - 3am required)");
111+
LogSystem("OS_GDPR - Scheduler: Invalid Last Run Date.");
105112
}
106113
}
107114
else
108115
{
109-
LogSystem("OS_GDPR - Scheduler: Invalid Last Run Date.");
116+
LogSystem("OS_GDPR - NO DATA SETTINGS");
110117
}
111118
}
112119

Installation/pluginconfig.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<checkboxlist>
1919
<securityroles update="save">
2020
<chk value="True" data="Administrators">Administrators</chk>
21-
<chk value="False" data="Manager">Manager</chk>
21+
<chk value="True" data="Manager">Manager</chk>
2222
<chk value="False" data="Editor">Editor</chk>
2323
<chk value="False" data="ClientEditor">ClientEditor</chk>
2424
</securityroles>
@@ -33,7 +33,7 @@
3333
<namespaceclass>OpenStore.Providers.OS_GDPR.Scheduler</namespaceclass>
3434
</textbox>
3535
<checkbox>
36-
<active>False</active>
36+
<active>True</active>
3737
<default>False</default>
3838
</checkbox>
3939
<dropdownlist>

0 commit comments

Comments
 (0)