public async Task <bool> StartTimer()
        {
            if (UserTask.StartDateTime == DateTime.MinValue)
            {
                UserTask.StartDateTime = DateTime.Now;
            }

            await RecordUserTaskTime(true);

            UserTask.Status = UserTaskStatus.Active;

            NotifyStatusProperties();

            InitializeTimer();
            await _userTaskService.UpdateUserTask(UserTask);

            return(true);
        }
Example #2
0
        //public async Task<IActionResult> UserTaskUpdate(int userTaskId, int assignedToUserId, DateTime startDate, DateTime EndDate, int taskType, string description, string name, TimeSpan timeSpend)
        public async Task <IActionResult> UserTaskUpdate([FromBody] UpdateTaskRequest updateTaskRequest)
        {
            var result = await _userTaskServer.UpdateUserTask(updateTaskRequest);

            if (result == null)
            {
                return(NotFound());
            }

            var userTask = _mapper.Map <UserTaskResponse>(result);

            return(Ok(userTask));
        }
Example #3
0
        private async Task UpdateRequestedBy(UserTask userTask)
        {
            var requestedBy = await _clientContactService.GetContactBy(userTask.ClientID);

            if (requestedBy == null)
            {
                return;
            }

            var userTaskModel = UserTasksList.FirstOrDefault(c => c.UserTask.UserTaskID == userTask.UserTaskID);

            if (userTaskModel != null)
            {
                userTaskModel.UserTask.RequestedBy = requestedBy.Name;

                await _userTaskService.UpdateUserTask(userTaskModel.UserTask);
            }
        }