public async Task <IActionResult> UpdateProgress(ActionItemForUpdate actionItemForUpdate) { var result = await _actionItemService.UpdateProgress(actionItemForUpdate); if (result) { return(Ok()); } return(BadRequest("Failed to update the action item")); }
public async Task <bool> UpdateProgress(ActionItemForUpdate actionItemForUpdate) { var actionItem = await _db.ActionItem.FirstOrDefaultAsync(i => i.Id.ToString() == actionItemForUpdate.Id); if (actionItem != null) { actionItem.Progress = actionItemForUpdate.Progress; return(_db.SaveChanges() > 0); } return(false); }
public async Task <bool> UpdateProgress(ActionItemForUpdate actionItemForUpdate) { var result = await _unitOfWork.ActionItem.UpdateProgress(actionItemForUpdate); if (result == true && actionItemForUpdate.Assignees.Any()) { foreach (var assignee in actionItemForUpdate.Assignees) { await _azureBusService.SendEmailAsync(assignee.AssigneeId, "stateChange"); } } return(result); }