public ActionResult Delete(int id, Contrato collection) { bool rpta = ContratoSer.Delete(collection.ContratoId); ViewBag.ClienteSer = ClienteSer.FindAll(); ViewBag.InmobiliarioSer = InmobiliarioSer.FindAll(); if (rpta) { return(RedirectToAction("Index")); } return(View()); }
public ActionResult Delete(Guid id) { try { _contratoService.Delete(id); return(Ok()); } catch (Exception e) { string errors = e.Message; return(ValidationProblem(new ValidationProblemDetails() { Type = "Cannot delete", Detail = errors })); } }
public ActionResult Delete(int id) { return(Ok( conSer.Delete(id) )); }