Ejemplo n.º 1
0
        public JsonResult CreateTask(Task task)
        {
            task.LocationLeft = 12;
            task.LocationTop = 190;
            task.OwnerId = (Guid) staticMembershipService.GetUser().ProviderUserKey;
            task = repository.SaveNewTask(task);

            return Json(task);
        }
Ejemplo n.º 2
0
 public OperationStatus UpdateStatus(Task task)
 {
     var status = new OperationStatus { Success = true };
     var selectedTask = context.Tasks.First(x => x.TaskId == task.TaskId);
     selectedTask.LocationLeft = task.LocationLeft;
     selectedTask.LocationTop = task.LocationTop;
     selectedTask.TaskStatus = task.TaskStatus;
     try
     {
         context.SaveChanges();
     }
     catch(Exception ex)
     {
         status.Success = false;
         status.ErrorMessege = ex.ToString();
     }
     return status;
 }
 public void UpdateStatus_Will_Call_Repository_UpdateStatus()
 {
     var task = new Task();
     controller.UpdateTaskStatus(task);
     mockService.Verify(x => x.UpdateStatus(It.IsAny<Task>()), Times.Once());
 }
Ejemplo n.º 4
0
 public JsonResult UpdateTaskStatus(Task task)
 {
     repository.UpdateStatus(task);
     return Json(new OperationStatus());
 }
Ejemplo n.º 5
0
 public Task SaveNewTask(Task task)
 {
     context.Tasks.Add(task);
     context.SaveChanges();
     return task;
 }