public BackgroundTask ScheduleTask(BackgroundTaskTypeEnum type, DateTime scheduled, Guid?districtRef, string data, string domain) { if (!CanScheduleTask(type)) { throw new ChalkableSecurityException(); } var task = new BackgroundTask { Created = DateTime.UtcNow, Data = data, Id = Guid.NewGuid(), Scheduled = scheduled, DistrictRef = districtRef, State = BackgroundTaskStateEnum.Created, Type = type, Domain = domain }; DoUpdate(u => new BackgroundTaskDataAccess(u).Insert(task)); return(task); }
private bool CanScheduleTask(BackgroundTaskTypeEnum type) { return(BaseSecurity.IsSysAdmin(Context) || type == BackgroundTaskTypeEnum.GenerateReport); }
public BackgroundTask ScheduleTask(BackgroundTaskTypeEnum type, DateTime scheduled, Guid?districtRef, string data, string domain) { throw new NotImplementedException(); }
public AllDistrictsProducer(string configSectionName, BackgroundTaskTypeEnum type) : base(configSectionName) { this.type = type; }