Beispiel #1
0
        public async Task <IActionResult> AcceptProposal([FromRoute] Guid organizationId, [FromRoute] Guid proposalId)
        {
            var p = await _proposalService
                    .AcceptFixedPriceProposal(_accountManager, proposalId);

            return(Ok(p));
        }
Beispiel #2
0
        public async Task <IActionResult> AcceptProposal(string id)
        {
            ProposalResult proposalResult = new ProposalResult();

            if (ModelState.IsValid)
            {
                Guid.TryParse(id, out Guid ProposalGuid);
                proposalResult = await _proposalService.AcceptFixedPriceProposal(ProposalGuid);
            }

            string message = string.Empty;

            if (proposalResult.Succeeded)
            {
                message = "Success! Proposal accepted successfully";
            }
            else
            {
                message = !string.IsNullOrEmpty(proposalResult.ErrorMessage?.Trim()) ? "Error! " + proposalResult.ErrorMessage : "Error! Proposal not accepted";
            }

            TempData["ProposalAcceptStatus"] = message;
            return(RedirectToAction("Detail", new { id }));
        }