Exemplo n.º 1
0
        public async Task <IActionResult> DetailsAsync(int projectId, int id)
        {
            var result1 = await issues.GetIssueForEditingAsync(id, User);

            if (result1.NotificationType == NotificationType.Success)
            {
                TempData["Model"] = JsonConvert.SerializeObject(result1.Value);
                return(RedirectToAction("Edit", new { projectId, id }));
            }

            var result2 = await issues.GetIssueAsync <IssueDetailsModel>(id, User);

            if (result2.NotificationType == NotificationType.Error)
            {
                this.AddNotification(result2.Message, result2.NotificationType);
                return(RedirectToAction("Index", "Projects"));
            }

            return(View(result2.Value));
        }