コード例 #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 SwitchTask(TContextDto context, int currentTaskID, 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.Stop(currentTaskID);
         states.Start(newTaskID);
     }
     catch (Exception ex)
     {
         throw new WebFaultException <string>(ex.Message, HttpStatusCode.BadRequest);
     }
 }