public List <GameWithCampaignDto> CampaignMenuDelete(List <GameWithCampaignDto> gameList) { _gameService.PrintList(gameList); Console.WriteLine("Enter Campaign number that you want to delete:"); int campaignId = Convert.ToInt32(Console.ReadLine()); var campaignToBeDeleted = _campaignService.Get(gameList, campaignId); var deletedCampaign = _campaignService.Delete(campaignToBeDeleted); var deleteItem = new CampaignDto(); foreach (var gameItem in gameList) { foreach (var campaignItem in gameItem.campaignDtos) { if (campaignItem.Id == campaignId) { deleteItem = campaignItem; } } gameItem.campaignDtos.Remove(deleteItem); } return(gameList); }
public IActionResult Delete(Campaign campaign) { var result = _campaignService.Delete(campaign); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public async Task <IActionResult> Delete([FromRoute] string id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } await _campaignService.Delete(id); return(Ok()); }
public IActionResult Delete(string id) { var entity = _manager.GetByPrimaryKey(id); if (entity == null) { return(NoResult()); } _manager.Delete(entity); return(ResponseJson(entity)); }
public IActionResult DeleteConfirmed(int id) { Campaign campaign = FetchOrDefault(id); if (null == campaign) { return(NotFound()); } _service.Delete(campaign); return(RedirectToAction(nameof(Index))); }
public ActionResult Delete(int id) { try { _campaignService.Delete(_campaignService.GetById(id)); SuccessNotification("Kayıt Silindi"); return(RedirectToAction("CampaignIndex")); } catch { return(View()); } }
public IActionResult Delete(int id) { var campaign = _service.GetById(id); if (null == campaign) { return(NotFound()); } _service.Delete(campaign); return(NoContent()); }
public ModelHandlerResult Handle(int id) { var data = new DeleteCampaignModel(); var result = _CampaignService.Delete(new DeleteCampaignInputModel { ID_Login = _loggedUser.ID_Login, ID = id, }); return(new ModelHandlerResult() { Message = result.IsSuccess ? Resources.Dictionary.Global_Delete_SuccessNotification : null, Data = result.Data, Exception = result.Exception, ValidationMessages = result.ValidationMessages }); }
public ApiResponse Delete(int id) { var user = _userManager.GetUserId(HttpContext.User); return(_service.Delete(id, user)); }
public async Task <IActionResult> Delete(int id) { var result = await _campaignService.Delete(id); return(Ok(result)); }
public ActionResult DeleteConfirmed(Guid id) { campaignService.Delete(id); return(RedirectToAction("Index")); }