public override ActionResult DialogDeleteConfirmation(DeletionDto deletionDto) { return(RedirectDialogDeleteConfirmation("DeleteConfirmationDialog", new CollectionDeletionDto() { Id = deletionDto.Id, MessageResourceKey = deletionDto.MessageResourceKey, AfterAction = deletionDto.AfterAction, DeleteAllPaintings = false, SetPaintingsToDefaultCollection = false })); }
public AfterDeleteParam(DeletionDto deletionDto, Message message, string action, string controller, object routeValues, string targetHtml) : base(action, controller, routeValues) { DeletionDto = deletionDto; Message = message; TargetHtml = targetHtml; }
public virtual void Delete(DeletionDto deletionDto) { U entityToDelete = _genericDao.FindTracking <U>(deletionDto.Id); ValidationBeforeDelete(entityToDelete); DoDelete(deletionDto, entityToDelete); }
public ActionResult DeleteConfirmed(DeletionDto deletionDto) { GetUnitOfWork().StartTransaction(); GetService().Delete(deletionDto); GetUnitOfWork().EndTransaction(); return(Json(JsonDialogResult.CreateSuccess(deletionDto.Id, null))); }
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); }
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); }
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))); }
public override void Delete(DeletionDto deletionDto) { GetUploadResourceService().Delete(Read(deletionDto.Id)); base.Delete(deletionDto); }
protected ActionResult RedirectDialogDeleteConfirmation(string view, DeletionDto deletionDto) { return(PartialView(view, deletionDto)); }
public virtual ActionResult DialogDeleteConfirmation(DeletionDto deletionDto) { return(RedirectDialogDeleteConfirmation("_ConfirmationDialog", deletionDto)); }
protected override void DoDelete(DeletionDto deletionDto, Painting painting) { DeleteParts(_unitOfWork, painting.Id); base.DoDelete(deletionDto, painting); }
protected override void DoDelete(DeletionDto deletionDto, User user) { DeleteParts(_unitOfWork, user.Id); base.DoDelete(deletionDto, user); }
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)); }
/// <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); }
//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)); }