Пример #1
0
 public void StopTask(TContextDto context, int currentTaskID)
 {
     try
     {
         var states = new TracktorStates(context, _db);
         states.Stop(currentTaskID);
     }
     catch (Exception ex)
     {
         throw new WebFaultException <string>(ex.Message, HttpStatusCode.BadRequest);
     }
 }
Пример #2
0
 public void StartTask(TContextDto context, int newTaskID)
 {
     try
     {
         var startTask = _db.TTasks.Single(t => t.TTaskID == newTaskID);
         if (startTask.TProject.TUserID != context.TUserID)
         {
             throw new Exception("Invalid Task ID.");
         }
         var states = new TracktorStates(context, _db);
         states.Start(newTaskID);
     }
     catch (Exception ex)
     {
         throw new WebFaultException <string>(ex.Message, HttpStatusCode.BadRequest);
     }
 }