private void FrmTaskListGuncelle_Load(object sender, EventArgs e) { var tasks = _taskService.GetirTumTablolarla(); List <TaskListDto> models = new List <TaskListDto>(); foreach (var item in tasks) { TaskListDto model = new TaskListDto(); model.Id = item.Id; model.Name = item.Name; model.Description = item.Description; model.Note = item.Note; model.FinishDate = item.FinishDate; model.PreDate = item.PreDate; model.TaskDate = item.TaskDate; model.UserId = item.UserId; model.DurumId = item.DurumId; model.UserName = item.User.Name; model.Durum = item.Durum.Name; models.Add(model); } dgwTaskList.DataSource = models; }
public IActionResult GiveDetail(int id) { TempData["active"] = TempDataInfo.TaskOrder; var result = _taskService.GetTaskWithReportProperty(id); TaskListDto model = _mapper.Map <TaskListDto>(result); return(View(model)); }
public async Task Assign(TaskListDto task, string emailAddress) { //Send a notification email await _emailSender.SendAsync( to : emailAddress, subject : $"hello {task.AssignedPersonName} You have a new task!", body : $"A new task is assigned for you: <b>{task.Title}</b>", isBodyHtml : true ); }
public string GetTaskLabel(TaskListDto task) { switch (task.State) { case BookStore.Tasks.Task.TaskState.Open: return("label-success"); default: return("label-default"); } }
public string GetTaskLabel(TaskListDto task) { switch (task.State) { case TaskState.Open: return("badge-success"); default: return("badge-info"); } }
public string GetTaskLabel(TaskListDto task) { switch (task.State) { case SimpleTaskApp.Tasks.TaskState.Open: return("label-success"); //case SimpleTaskApp.Tasks.TaskState.Completed: default: return("label-default"); } }
public IActionResult AssignTaskToUser(TaskAssignUserDto model) { TempData["active"] = TempDataInfo.TaskOrder; var user = _userManager.Users.FirstOrDefault(a => a.Id == model.AppUserId); var task = _taskService.GetTaskWithUrgencyProperty(model.TaskId); AppUserListDto userModel = _mapper.Map <AppUserListDto>(user); TaskListDto taskListDto = _mapper.Map <TaskListDto>(task); TaskAssignUserListDto taskUserViewModel = new TaskAssignUserListDto(); taskUserViewModel.AppUser = userModel; taskUserViewModel.Task = taskListDto; return(View(taskUserViewModel)); }
public async Task <ActionResult <TaskListDto> > CreateAsync([FromBody][Required] TaskListUpdateDto taskListUpdateDto, CancellationToken token) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } string userId = User.FindFirst(JwtRegisteredClaimNames.Sub).Value; TaskList addedList = await _taskListService.AddAsync(new TaskList { Name = taskListUpdateDto.Name, UserId = userId }, token); TaskListDto addedListDto = _mapper.MapToDto(addedList); return(CreatedAtAction(nameof(GetByIdAsync), new { id = addedListDto.Id }, addedListDto)); }
public async Task <TaskListDto> Update(TaskListDto input) { try { var task = _taskRepository.Get(input.Id); ObjectMapper.Map(input, task); var result = await _taskRepository.UpdateAsync(task); return(ObjectMapper.Map <TaskListDto>(result)); } catch (Exception e) { throw e; } }
public IActionResult AssignUser(int id, string searchKey, int page = 1) { TempData["active"] = TempDataInfo.TaskOrder; ViewBag.ActivePage = page; int totalPage = 0; var entity = _taskService.GetTaskWithUrgencyProperty(id); var kullaniciEntities = _appUserService.GetNotAdminAppUsers(out totalPage, searchKey, page); ViewBag.TotalPage = totalPage; ViewBag.SearchKey = searchKey; var appUserListModel = _mapper.Map <List <AppUserListDto> >(kullaniciEntities); ViewBag.Kullanicilar = appUserListModel; TaskListDto model = _mapper.Map <TaskListDto>(entity); return(View(model)); }
public async Task <ActionResult <TaskListDto> > GetByIdAsync([Range(1, int.MaxValue)] int id, CancellationToken token) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } TaskList taskList = await _taskListService.GetByIdAsync(id, token); if (taskList == null) { return(NotFound()); } TaskListDto dto = _mapper.MapToDto(taskList); return(Ok(dto)); }
public void UpdateDoneTask(TaskListDto param) { try { TaskList data = new TaskList { TaskListId = param.TaskListId, TaskId = param.TaskId, IsComplete = param.IsComplete }; _taskRepo.UpdateDone(data); } catch (Exception ex) { throw new Exception(ex.Message); } }
public string GetTaskLabel(TaskListDto task) { var label = string.Empty; switch (task.State) { case TaskState.Open: label = "label-success"; break; case TaskState.Completed: label = "label-default"; break; default: label = "label-default"; break; } return(label); }