public override ActionResult DialogDeleteConfirmation(DeletionDto deletionDto)
 {
     return(RedirectDialogDeleteConfirmation("DeleteConfirmationDialog", new CollectionDeletionDto()
     {
         Id = deletionDto.Id, MessageResourceKey = deletionDto.MessageResourceKey, AfterAction = deletionDto.AfterAction, DeleteAllPaintings = false, SetPaintingsToDefaultCollection = false
     }));
 }
Esempio n. 2
0
 public AfterDeleteParam(DeletionDto deletionDto, Message message, string action, string controller, object routeValues, string targetHtml)
     : base(action, controller, routeValues)
 {
     DeletionDto = deletionDto;
     Message     = message;
     TargetHtml  = targetHtml;
 }
Esempio n. 3
0
        public virtual void Delete(DeletionDto deletionDto)
        {
            U entityToDelete = _genericDao.FindTracking <U>(deletionDto.Id);

            ValidationBeforeDelete(entityToDelete);
            DoDelete(deletionDto, entityToDelete);
        }
Esempio n. 4
0
        public ActionResult DeleteConfirmed(DeletionDto deletionDto)
        {
            GetUnitOfWork().StartTransaction();
            GetService().Delete(deletionDto);
            GetUnitOfWork().EndTransaction();

            return(Json(JsonDialogResult.CreateSuccess(deletionDto.Id, null)));
        }
Esempio n. 5
0
        public override void Delete(DeletionDto deletionDto)
        {
            Resource resource = _genericDao.Find <Resource>(deletionDto.Id);
            Gallery  gallery  = _genericDao.Find <Gallery>(resource.UserDefinableId);

            SetNewCoverPhotoIfNecessarry(resource, gallery);
            base.Delete(deletionDto);
            RemoveGalleryIfNecessarry(resource, gallery);
        }
Esempio n. 6
0
        protected override void DoDelete(DeletionDto deletionDto, Gallery gallery)
        {
            List <Guid> resourceIds = gallery.Resources.Select(x => x.Id).ToList();

            resourceIds.ForEach(x => _photoCRUDService.Delete(new DeletionDto()
            {
                Id = x
            }));
            base.DoDelete(deletionDto, gallery);
        }
        protected override void DoDelete(DeletionDto deletionDto, Collection collection)
        {
            CollectionDeletionDto collectionDeletionDto = (CollectionDeletionDto)deletionDto;

            if (collectionDeletionDto.DeleteAllPaintings)
            {
                DeleteAllPaintingsForCollection(_unitOfWork, collection.Id);
            }
            else
            {
                SetDefaultCollectionToPaintingsInRemovedCollection(_unitOfWork, collection.Id);
            }
            base.DoDelete(deletionDto, collection);
        }
Esempio n. 8
0
 public ActionResult DeleteConfirmed(DeletionDto deletionDto)
 {
     return(DoDeleteConfirmed(AfterDeleteParam.Create(deletionDto, Message.CreateSuccessMessage(MessageKeyConstants.INFO_OBJECT_DELETED_SUCCESS_MESSAGE), WebConstants.VIEW_PAGED_LIST, WebConstants.CONTROLLER_EXHIBITION, null, HtmlConstants.PAGED_LIST_EXHIBITION)));
 }
Esempio n. 9
0
 public override void Delete(DeletionDto deletionDto)
 {
     GetUploadResourceService().Delete(Read(deletionDto.Id));
     base.Delete(deletionDto);
 }
Esempio n. 10
0
 protected ActionResult RedirectDialogDeleteConfirmation(string view, DeletionDto deletionDto)
 {
     return(PartialView(view, deletionDto));
 }
Esempio n. 11
0
 public virtual ActionResult DialogDeleteConfirmation(DeletionDto deletionDto)
 {
     return(RedirectDialogDeleteConfirmation("_ConfirmationDialog", deletionDto));
 }
Esempio n. 12
0
 protected override void DoDelete(DeletionDto deletionDto, Painting painting)
 {
     DeleteParts(_unitOfWork, painting.Id);
     base.DoDelete(deletionDto, painting);
 }
Esempio n. 13
0
 protected override void DoDelete(DeletionDto deletionDto, User user)
 {
     DeleteParts(_unitOfWork, user.Id);
     base.DoDelete(deletionDto, user);
 }
Esempio n. 14
0
 public static AfterDeleteParam Create(DeletionDto deletionDto, Message message, string action, string controller, object routeValues, string targetHtml)
 {
     return(new AfterDeleteParam(deletionDto, message, action, controller, routeValues, targetHtml));
 }
Esempio n. 15
0
 /// <summary>
 /// Does the delete the entity from the database.
 /// </summary>
 /// <param name="entity">The entity to delete</param>
 protected virtual void DoDelete(DeletionDto deletionDto, U entity)
 {
     _genericDao.Delete <U>(entity);
 }
 protected override void DoDelete(DeletionDto deletionDto, Exhibition exhibition)
 {
     DeleteParts(_unitOfWork, exhibition.Id);
     base.DoDelete(deletionDto, exhibition);
 }
Esempio n. 17
0
        //protected override void ValidationBeforePersist(MenuItemDto menuItemDto)
        //{
        //    //if (menuItemDto.ParentMenuItemId.HasValue)
        //    //{
        //    //    MenuItem parentMenuItem = _genericDao.FindTracking<MenuItem>(menuItemDto.ParentMenuItemId.Value);
        //    //    if (MenuItemAssociationType.SECTION_MENU.Equals(menuItemDto.AssociationType) && parentMenuItem.Level != 0)
        //    //    {
        //    //        throw new ValidationException(MessageKeyConstants.VALIDATION_SECTION_CAN_BE_PLACED_ONLY_UNDER_THE_MAIN_MENU_MESSAGE);
        //    //    }
        //    //    if (!MenuItemAssociationType.SECTION_MENU.Equals(menuItemDto.AssociationType) && parentMenuItem.Level == 0)
        //    //    {
        //    //        throw new ValidationException(MessageKeyConstants.VALIDATION_UNDER_THE_MAIN_MENU_THE_SECTION_MUST_BE_PLACED_MESSAGE);
        //    //    }
        //    //}
        //    //else
        //    //if()
        //    //{
        //    //    if (MenuItemAssociationType.SECTION_MENU.Equals(menuItemDto.AssociationType))
        //    //    {
        //    //        throw new ValidationException(MessageKeyConstants.VALIDATION_SECTION_CAN_BE_PLACED_ONLY_UNDER_THE_MAIN_MENU_MESSAGE);
        //    //    }
        //    //}
        //    List<MenuItemDto> sectionMenuItemsDto = _menuDao.GetMenuItems(MenuItemAssociationType.SECTION_MENU, menuItemDto.ParentMenuItemId);
        //    if (sectionMenuItemsDto.Count == 4)
        //    {
        //        throw new ValidationException(MessageKeyConstants.VALIDATION_ONLY_FOUR_SECTIONS_CAN_BE_UNDER_MAIN_MENU_MESSAGE);
        //    }

        //    base.ValidationBeforePersist(menuItemDto);
        //}

        protected override void DoDelete(DeletionDto deletionDto, MenuItem menuItem)
        {
            List <MenuItem> menuItemsToRemoved = DeleteAllIncludeChildren(menuItem);

            menuItemsToRemoved.ForEach(x => base.DoDelete(deletionDto, x));
        }