Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public IActionResult Delete(Campaign campaign)
        {
            var result = _campaignService.Delete(campaign);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Delete([FromRoute] string id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            await _campaignService.Delete(id);

            return(Ok());
        }
Exemplo n.º 4
0
        public IActionResult Delete(string id)
        {
            var entity = _manager.GetByPrimaryKey(id);

            if (entity == null)
            {
                return(NoResult());
            }
            _manager.Delete(entity);
            return(ResponseJson(entity));
        }
Exemplo n.º 5
0
        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());
     }
 }
Exemplo n.º 7
0
        public IActionResult Delete(int id)
        {
            var campaign = _service.GetById(id);

            if (null == campaign)
            {
                return(NotFound());
            }

            _service.Delete(campaign);

            return(NoContent());
        }
Exemplo n.º 8
0
        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
            });
        }
Exemplo n.º 9
0
        public ApiResponse Delete(int id)
        {
            var user = _userManager.GetUserId(HttpContext.User);

            return(_service.Delete(id, user));
        }
Exemplo n.º 10
0
        public async Task <IActionResult> Delete(int id)
        {
            var result = await _campaignService.Delete(id);

            return(Ok(result));
        }
Exemplo n.º 11
0
 public ActionResult DeleteConfirmed(Guid id)
 {
     campaignService.Delete(id);
     return(RedirectToAction("Index"));
 }