hello
I tried to plan a task on the scheduler I created the class library and I put the .dll file in the bin directory, but it does not work.
That's what I did
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DotNetNuke.Services.Scheduling;
using System.Data.SqlClient;
using System.Data;
using System.IO;
using System.Web;
using System.Xml.Serialization;
namespace Save_DataBase.Module
{
public class Xml_Save_DataBase : DotNetNuke.Services.Scheduling.SchedulingClient
{
public Xml_Save_DataBase(DotNetNuke.Services.Scheduling.SchedulingHistoryItem objScheduleHistoryItem)
: base()
{
this.ScheduleHistoryItem = objScheduleHistoryItem;
}
public override void DoWork()
{
try
{
this.Progressing();
Save_DataBase(); //my job
this.ScheduleHistoryItem.AddLogNote(" Save_DataBase Service Start. Success.");
this.ScheduleHistoryItem.Succeeded = true;
}
catch (Exception Ex)
{
this.ScheduleHistoryItem.Succeeded = false;
this.ScheduleHistoryItem.AddLogNote(" Save_DataBase Service Start. Failed. " + Ex.ToString());
this.Errored(ref Ex);
}
}
public void Save_DataBase ()
{
//my code
}
}
}
using System;
namespace DotNetNuke.Services.Scheduling
{
public class SchedulingClient
{
protected SchedulingHistoryItem ScheduleHistoryItem;
public virtual void DoWork()
{
}
public void Errored(ref Exception Ex)
{
}
public void Progressing()
{
}
}
}
using System;
namespace DotNetNuke.Services.Scheduling
{
public class SchedulingHistoryItem
{
internal void AddLogNote(string p)
{
throw new NotImplementedException();
}
public bool Succeeded { get; set; }
}
}
in Schedule Status:
3 |
Purge Schedule History |
8/13/2013 1:36:41 AM |
|
12470 |
ScheduleHistory |
STARTED_FROM_BEGIN_REQUEST |
-1 |
|
6 |
Search Engine Scheduler |
8/12/2013 10:35:09 PM |
|
1578 |
SearchEngine |
STARTED_FROM_BEGIN_REQUEST |
11 |
|
29 |
Save_DataBase |
8/12/2013 10:05:26 PM |
|
0 |
|
STARTED_FROM_BEGIN_REQUEST |
-1 |
|
10 |
Purge Module Cache |
8/12/2013 10:09:38 PM |
|
47 |
ModuleCache |
STARTED_FROM_BEGIN_REQUEST |
1 |
|
11 |
Messaging Dispatch |
8/12/2013 10:09:38 PM |
|
47 |
Messaging |
STARTED_FROM_BEGIN_REQUEST |
21 |