Esempio n. 1
0
        public DeleteOutput <long> Delete(DeleteInput <long> input)
        {
            Game gameEntityForDelete = GameRepository.Get(input.EntityId);

            if (gameEntityForDelete == null)
            {
                throw new CityQuestItemNotFoundException(CityQuestConsts.CityQuestItemNotFoundExceptionMessageBody, "\"Game\"");
            }

            if (!GamePolicy.CanDeleteEntity(gameEntityForDelete))
            {
                throw new CityQuestPolicyException(CityQuestConsts.CQPolicyExceptionDeleteDenied, "\"Game\"");
            }

            DeleteGameImage(gameEntityForDelete.GameImageName);

            GameRepository.Delete(gameEntityForDelete);

            UowManager.Current.Completed += (sender, e) =>
            {
                GameChangesNotifier.RaiseOnGameDeleted(new GameDeletedMessage(input.EntityId));
            };

            return(new DeleteOutput <long>()
            {
                DeletedEntityId = input.EntityId
            });
        }
Esempio n. 2
0
        public async Task <IActionResult> Delete(Guid basketId)
        {
            var request = new DeleteInput(basketId);

            await deleteBasketInput.Process(request);

            return(deletePresenter.ViewModel);
        }
Esempio n. 3
0
        public ActionResult Delete(DeleteInput input, string returnUrl)
        {
            if (string.IsNullOrWhiteSpace(returnUrl))
            {
                returnUrl = Url.Action("Videos");
            }

            service.Delete(input.Id);

            return(Redirect(returnUrl));
        }
        public void Delete([FromUri] DeleteInput input)
        {
            var appoinetment = _appointmentRepository.FirstOrDefault(t => t.Id == input.Id);

            if (appoinetment != null)
            {
                var userCliam = _userService.UserClaim();
                appoinetment.IsDeleted    = !appoinetment.IsDeleted;
                appoinetment.UpdateTime   = Clock.Now;
                appoinetment.UpdateUserId = userCliam.UserId;
                _appointmentRepository.UpdateAsync(appoinetment);
            }
        }
Esempio n. 5
0
        public async Task DeleteFeedback(DeleteInput input)
        {
            foreach (var id in input.Ids)
            {
                var comment = _feedbackRepository.FirstOrDefault(x => x.Id == id);
                if (comment == null)
                {
                    throw new UserFriendlyException("未找到该评论");
                }

                await _feedbackRepository.DeleteAsync(comment);
            }
        }
Esempio n. 6
0
        public DeleteOutput <long> Delete(DeleteInput <long> input)
        {
            try
            {
                UserRepository.Delete(input.EntityId);
            }
            catch (Exception ex)
            {
                Logger.Error(String.Format(
                                 "Error when deleting user with id = {0}! (exception message: \"{3}\")", input.EntityId, ex.Message));
                throw new UserFriendlyException("Error during the action!",
                                                "Can not delete this user. Please, contact your system administrator or system support.");
            }

            return(new DeleteOutput <long>()
            {
                DeletedEntityId = input.EntityId
            });
        }
Esempio n. 7
0
        public DeleteOutput <long> Delete(DeleteInput <long> input)
        {
            Team teamEntityForDelete = TeamRepository.Get(input.EntityId);

            if (teamEntityForDelete == null)
            {
                throw new CityQuestItemNotFoundException(CityQuestConsts.CityQuestItemNotFoundExceptionMessageBody, "\"Team\"");
            }

            if (!TeamPolicy.CanDeleteEntity(teamEntityForDelete))
            {
                throw new CityQuestPolicyException(CityQuestConsts.CQPolicyExceptionDeleteDenied, "\"Team\"");
            }

            TeamRepository.Delete(teamEntityForDelete);

            return(new DeleteOutput <long>()
            {
                DeletedEntityId = input.EntityId
            });
        }
Esempio n. 8
0
        public DeleteOutput <long> Delete(DeleteInput <long> input)
        {
            Location locationEntityForDelete = LocationRepository.Get(input.EntityId);

            if (locationEntityForDelete == null)
            {
                throw new CityQuestItemNotFoundException(CityQuestConsts.CityQuestItemNotFoundExceptionMessageBody, "\"Location\"");
            }

            if (!LocationPolicy.CanDeleteEntity(locationEntityForDelete))
            {
                throw new CityQuestPolicyException(CityQuestConsts.CQPolicyExceptionDeleteDenied, "\"Location\"");
            }

            LocationRepository.Delete(locationEntityForDelete);

            return(new DeleteOutput <long>()
            {
                DeletedEntityId = input.EntityId
            });
        }
Esempio n. 9
0
        public DeleteOutput <long> Delete(DeleteInput <long> input)
        {
            throw new NotSupportedException("This method is implemented but it is not safely to use it.");

            GameTaskType gameTaskTypeEntityForDelete = GameTaskTypeRepository.Get(input.EntityId);

            if (gameTaskTypeEntityForDelete == null)
            {
                throw new CityQuestItemNotFoundException(CityQuestConsts.CityQuestItemNotFoundExceptionMessageBody, "\"GameTaskType\"");
            }

            if (!GameTaskTypePolicy.CanDeleteEntity(gameTaskTypeEntityForDelete))
            {
                throw new CityQuestPolicyException(CityQuestConsts.CQPolicyExceptionDeleteDenied, "\"GameTaskType\"");
            }

            GameTaskTypeRepository.Delete(gameTaskTypeEntityForDelete);

            return(new DeleteOutput <long>()
            {
                DeletedEntityId = input.EntityId
            });
        }
Esempio n. 10
0
 /// <summary>
 /// Apaga um candidato
 /// </summary>
 /// <param name="input">Id do candidato</param>
 public async Task Delete(DeleteInput input)
 {
     await _candidatoManager.Delete(input.Id);
 }
Esempio n. 11
0
 public async Task DeleteCategory(DeleteInput<Guid> input)
 {
     Logger.Info("Deleting category for input : " + input);
     await _categoryRepository.DeleteAsync(input.Id);
 }
Esempio n. 12
0
public async Task DeletePost(DeleteInput<Guid> input)
{
    Logger.Info("Deleting post for Id : " + input);
    await this._postRepository.DeleteAsync(input.Id);
}
Esempio n. 13
0
 public async Task <long> GeoDeleteAsync(DeleteInput input)
 {
     return(await IGeoServer.GeoDeleteAsync(input));
 }