public IHttpActionResult PutScheduleException(int id, ScheduleException scheduleException) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != scheduleException.Id) { return(BadRequest()); } db.Entry(scheduleException).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ScheduleExceptionExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetScheduleException(int id) { ScheduleException scheduleException = db.ScheduleExceptions.Find(id); if (scheduleException == null) { return(NotFound()); } return(Ok(scheduleException)); }
public IHttpActionResult PostScheduleException(ScheduleException scheduleException) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.ScheduleExceptions.Add(scheduleException); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = scheduleException.Id }, scheduleException)); }
public IHttpActionResult DeleteScheduleException(int id) { ScheduleException scheduleException = db.ScheduleExceptions.Find(id); if (scheduleException == null) { return(NotFound()); } db.ScheduleExceptions.Remove(scheduleException); db.SaveChanges(); return(Ok(scheduleException)); }
public virtual void Complete(bool success, bool recalculate = true , bool isException = false, Exception lastEx = null, DateTime?exceptionTime = null) { if (!success) { ErrorIncrement(); } if (isException) { ExecuteException = new ScheduleException() { Ex = lastEx, LastTime = exceptionTime } } ; if (recalculate) { Recalculate(); } Active = false; }
public virtual void Start() { ExecuteException = null; Active = true; }