Beispiel #1
0
        public async Task <IActionResult> Edit(Guid id)
        {
            ChangeRequestDetailModel request = await Mediator.Send(new GetChangeRequestDetailsQuery { Id = id });

            if (request != null)
            {
                ViewBag.IsAuthenticatedOnCloud = await Mediator.Send(new CheckUserTokenQuery());

                ViewBag.Projects = GetProjectSelectList();

                var updateCommand = new UpdateChangeRequestCommand
                {
                    Id                  = request.Id,
                    Name                = request.Name,
                    Description         = request.Description,
                    ProjectId           = request.ProjectId,
                    ProjectName         = request.ProjectName,
                    Priority            = request.Priority,
                    Status              = request.Status,
                    ChangeRequestNumber = request.Number,
                    ProjectNumber       = request.ProjectNumber
                };

                return(PartialView("_Edit", updateCommand));
            }

            return(BadRequest());
        }
Beispiel #2
0
        public async Task <IActionResult> Edit(UpdateChangeRequestCommand command)
        {
            if (command.File != null)
            {
                await UploadFile(command.ProjectNumber, command.ChangeRequestNumber, command.File);
            }

            if (await Mediator.Send(command) != null)
            {
                return(Ok());
            }

            return(BadRequest());
        }