internal void RegistrySpentTime(string userId, string taskId, SpentTimeRegistry spentTime) { try { spentTime.TaskId = string.Empty; spentTime.CreationDate = DateTime.Now; spentTime.UserId = userId; spentTime.TaskId = taskId; _taskSpentRepository.Create(spentTime); } catch (Exception ex) { // write ex information in log throw; } }
public SpentTimeRegistry Create(SpentTimeRegistry taskSpentTime) { _TaskSpentCollection.InsertOne(taskSpentTime); return(taskSpentTime); }
public IActionResult RegistrySpentTime(string userId, string projectId, string taskId, SpentTimeRegistry time) { try { var task = _taskBll.GetTaksDetail(userId, projectId, taskId); if (task == null) { return(NotFound()); } else { _taskBll.RegistrySpentTime(userId, taskId, time); return(NoContent()); } } catch (Exception ex) { return(StatusCode(500)); } }