예제 #1
0
        public IActionResult DeleteConfirmed(int id)
        {
            Portfolio portfolio = _portfolioService.GetById(id);

            _portfolioService.Delete(portfolio);
            _portfolioService.Commit();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 /* 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");
 }
예제 #3
0
 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"));
     }
 }
예제 #4
0
        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());
        }
예제 #5
0
        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"));
        }
예제 #6
0
        public async Task <IActionResult> Delete(int id)
        {
            await _portfolioService.Delete(id);

            return(NoContent());
        }