public IActionResult DeleteConfirmed(int id) { Portfolio portfolio = _portfolioService.GetById(id); _portfolioService.Delete(portfolio); _portfolioService.Commit(); return(RedirectToAction("Index")); }
/* Yazilimci Portfolyo Silme Islemi */ public IActionResult PortfolyoSil(int Id) { int developerId = Convert.ToInt32(HttpContext.Session.GetString("SessionDeveloperId")); Portfolio portfolyo = _portfolioService.GetPortfolioById(Id); if (portfolyo == null) { return RedirectToAction("Hata", "Uye"); } if (portfolyo.DeveloperId != developerId) { return RedirectToAction("Hata", "Uye"); } _portfolioService.Delete(portfolyo); TempData["AddSuccessMessage"] = "Portfolyo Silme Başarıyla Gerçekleştirildi."; return RedirectToAction("YazilimciProfil", "Uye"); }
public ActionResult Delete(string isin) { try { var portfolio = _portfolioService.GetByISIN(isin); if (portfolio == null) { return(NotFound()); } _portfolioService.Delete(isin); return(NoContent()); } catch (Exception e) { return(StatusCode(500, "Internal server error")); } }
public async Task <IActionResult> Delete(int id) { if (id == 0) { return(BadRequest()); } var portfolio = await _service.GetById(id); if (portfolio == null) { return(NotFound()); } await _service.Delete(portfolio); return(NoContent()); }
public ActionResult Delete(int id) { var portfolio = portfolioService.GetById(id); if (portfolio == null) { this.NotifyError("Item not found."); return(RedirectToAction("List")); } var deleted = portfolioService.Delete(portfolio); if (deleted) { this.NotifySuccess("Successfully deleted."); } else { this.NotifyError("Item can not deleted!"); } return(RedirectToAction("List")); }
public async Task <IActionResult> Delete(int id) { await _portfolioService.Delete(id); return(NoContent()); }