public ActionResult UpdateTaskStatus(Guid? taskId, bool status) { var commandServiceClient = _clientFactory.GetCommandServiceClient(); if (taskId != null && status) { var command = new Quartet.Entities.Commands.MarkTaskComplete { TaskId = (Guid)taskId }; commandServiceClient.Execute(command); return Json(new { TaskId = command.TaskId, CommandResult = new CommandResult() }); } if (taskId != null) { var command = new Quartet.Entities.Commands.MarkTaskIncomplete { TaskId = (Guid)taskId }; commandServiceClient.Execute(command); return Json(new { TaskId = command.TaskId, CommandResult = new CommandResult() }); } return Json(new { TaskId = Guid.Empty, CommandResult = null as CommandResult }); }
public ActionResult UpdateMassTaskStatus(Guid?[] tasks) { foreach (var task in tasks) { var commandServiceClient = _clientFactory.GetCommandServiceClient(); if (task != null) { var command = new Quartet.Entities.Commands.MarkTaskComplete { TaskId = (Guid)task }; commandServiceClient.Execute(command); } } var successResult = new { Result = "Success", Message = Resources.GetString("REMINDERLIST_MASSUPDATESUCCESS"), }; var resultJson = JsonConvert.SerializeObject(successResult); return Json(resultJson, JsonRequestBehavior.AllowGet); }