예제 #1
0
        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);
 }
예제 #3
0
        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));
            }
        }