Exemple #1
0
 public async Task <IActionResult> Report(TodoAppViewModel taskReported)
 {
     if (taskReported.Status != "Đã hoàn thành" && taskReported.Description == null)
     {
         ViewBag.ErrorMessage = "Please fill the Description !";
         string[] status = { "Đã hoàn thành", "Sắp hoàn thành", "Chưa hoàn thành" };
         ViewBag.Status = status;
         return(View(await _todoAppService.GetById(taskReported.Id)));
     }
     if (ResponseHasErrors(await _todoAppService.Report(taskReported)))
     {
         return(View(_todoAppService.GetById(taskReported.Id)));
     }
     return(RedirectToAction("Index"));
 }