public IActionResult DeleteQuote([FromBody] string quoteId) { try{ _quotesRepository.DeleteQuote(quoteId); return(Ok()); }catch (Exception e) { _logger.LogError($"Não foi possivel deletar quote: {e}"); return(BadRequest()); } }
public async Task <ActionResult <QuoteVM> > DeleteQuote(int id) { try { var quoteToDelete = await quoteRepository.GetQuote(id); if (quoteToDelete == null) { return(NotFound($"Quote with Id = {id} not found")); } return(await quoteRepository.DeleteQuote(id)); } catch (DbUpdateException Ex) { return(StatusCode(StatusCodes.Status500InternalServerError, Ex.InnerException.Message)); } }
public JsonResult Delete(Guid quoteId) { var operationResult = new OperationResult(); var quoteParts = _projectPartRepository.GetProjectParts().Where(x => x.QuoteId == quoteId).ToList(); if (quoteParts != null && quoteParts.Count() > 0) { foreach (var quotePart in quoteParts) { quotePart.QuoteId = null; _projectPartRepository.UpdateProjectPart(quotePart); } } operationResult = _quoteRepository.DeleteQuote(quoteId); var existingQuote = _quoteRepository.GetQuote(quoteId); if (existingQuote != null) { var existingRfq = _rfqRepository.GetRfq(existingQuote.QuoteId); if (existingRfq != null) { existingRfq.IsOpen = true; existingRfq.IsCanceled = false; existingRfq.IsHold = false; operationResult = _rfqRepository.UpdateRfq(existingRfq); } } return(Json(operationResult, JsonRequestBehavior.AllowGet)); }
public HttpStatusCode DeleteQuote(int id) { return(_quoteRepository.DeleteQuote(id)); }
public void DeleteQuote(string quoteId) => _quoteRepo.DeleteQuote(quoteId);
public IActionResult Delete(int id) { _repository.DeleteQuote(id); _repository.Save(); return(Ok()); }