public IActionResult DeleteAward(long id) { _logger.LogInformation($"{nameof(AwardController)} : {nameof(DeleteAward)} was called."); try { var award = _awardService.FindById(id); if (award == null) { return(StatusCode((int)HttpStatusCode.Gone)); } _awardService.Delete(award); _awardService.Save(); return(Ok()); } catch (DbException exception) { _logger.LogError(exception.Message); return(BadRequest(exception.Message)); } catch (Exception exception) { _logger.LogError(exception.Message); throw; } }
public ActionResult DeleteConfirmed(int id) { Award award = _awardService.Find(id); if (award == null) { return(BadRequest()); } _awardService.Delete(award); return(RedirectToAction("Manage")); }
public HttpResponseMessage Delete(int id) { var savedAward = _awardService.GetById(id); if (savedAward == null) { return(Request.CreateErrorResponse( HttpStatusCode.NotFound, new HttpError(_resourceManager.GetString("Common.DataNotFound")))); } return(SaveChanges(savedAward, x => _awardService.Delete(x), _resourceManager.GetString("Award.FailedToDelete"))); }
/* Yazilimci Odul Silme Islemi */ public IActionResult OdulSil(int Id) { int developerId = Convert.ToInt32(HttpContext.Session.GetString("SessionDeveloperId")); Award award = _awardService.GetAwardById(Id); if (award == null) { return RedirectToAction("Hata", "Uye"); } if (award.DeveloperId != developerId) { return RedirectToAction("Hata", "Uye"); } _awardService.Delete(award); TempData["AddSuccessMessage"] = "Ödül Silme Başarıyla Gerçekleştirildi."; return RedirectToAction("YazilimciProfil", "Uye"); }
public void DeleteAward(int id) { _awardService.Delete(id); }