private void ChangeJobState(String token, JobStateEnum newJobState) { SetCoreServiceCredentialsBasedOnConfigValues(); var job = GetRunningJob(token); job.State = newJobState.ToString(); _coreService.UpdateObject(job); _coreService.SaveChanges(); Debug.WriteLine("Changed state of job with id '{0}' to '{1}'", job.Id, newJobState); }
private int CountJobState(JobStateEnum state) { return(this._conn.ExecuteScalar <int>(@"select count(*) from jobs where state = @state;", new { state })); }