} // Index // Получение детальной информации об элементе public async Task <IActionResult> Details(int id, bool ajaxLoad, string connectionId, string previousUrl) { try { var proposal = await _proposalRepository.GetProposal(id); if (proposal == null) { throw new Exception(); } var viewModel = new DetailsViewModel( proposal, await _proposalImageRepository.GetProposalImagesPath(id), await _requisitionRepository.GetRequisitions(proposal.Machine)); if (!ajaxLoad) { return(View(viewModel)); } return(PartialView(viewModel)); } catch { _message = Messages.downloadErrorMessage; } // try-catch await _hub.Clients.Client(connectionId).SendAsync("Error", _message); if (previousUrl == null) { return(RedirectToAction("Index", new { ajaxLoad = true })); } return(Redirect(previousUrl + "?ajaxLoad=true")); } // Details
public async Task <ProposalGetRes> GetProposal([FromBody] ProposalGetReq request) { var response = new ProposalGetRes(); try { if (!string.IsNullOrEmpty(request.QRFID) && request != null) { //response = await _itineraryRepository.GetItinerary(request); //response.ResponseStatus.Status = "Success"; ProposalGetRes result = _proposalRepository.GetProposal(request); response.ResponseStatus.Status = "Success"; response.ResponseStatus.ErrorMessage = result != null ? "" : "No Records Found."; response = result; } else { response.ResponseStatus.Status = "Failure"; response.ResponseStatus.ErrorMessage = "QRFId can not be Null/Zero."; } } catch (Exception ex) { response.ResponseStatus.Status = "Failure"; response.ResponseStatus.ErrorMessage = "An Error Occurs :- " + ex.Message; } return(response); }
public async Task <ProposalDTO> GetProposal(string idProposal) { try { var proposal = await _proposalRepository.GetProposal(idProposal); return(proposal); } catch (Exception ex) { throw ex; } }
public Proposal GetProposal(Guid id) { var proposal = _proposalRepository.GetProposal(id); return(proposal); }