Exemplo n.º 1
0
        public ActionResult Delete(Guid id)
        {
            var model = new DeleteConfirmationSmartModel()
            {
                Id      = id,
                Message = "Вы действительно хотите удалить подписку?"
            };

            return(ViewDialog(model));
        }
Exemplo n.º 2
0
        public ActionResult Delete(DeleteConfirmationSmartModel model)
        {
            try
            {
                // TODO Удаление подписок нужно делать через Диспетчер

                var repository   = CurrentAccountDbContext.GetSubscriptionRepository();
                var subscription = repository.GetById(model.Id);
                CheckEditingPermissions(subscription);

                var subscriptionService = new SubscriptionService(DbContext);
                subscriptionService.Remove(CurrentUser.AccountId, subscription);

                CurrentAccountDbContext.SaveChanges();
                return(GetSuccessJsonResponse());
            }
            catch (Exception exception)
            {
                MvcApplication.HandleException(exception);
                return(GetErrorJsonResponse(exception));
            }
        }
Exemplo n.º 3
0
 protected ActionResult ViewDialog(DeleteConfirmationSmartModel model)
 {
     return(PartialView("Dialogs/DeleteConfirmationSmart", model));
 }