public ActionConfirmation SaveOrUpdate(SlideFolder slideFolder) { if (slideFolder.IsValid()) { slideFolderRepository.SaveOrUpdate(slideFolder); ActionConfirmation saveOrUpdateConfirmation = ActionConfirmation.CreateSuccessConfirmation( "The slideFolder was successfully saved."); saveOrUpdateConfirmation.Value = slideFolder; return(saveOrUpdateConfirmation); } else { slideFolderRepository.DbContext.RollbackTransaction(); return(ActionConfirmation.CreateFailureConfirmation( "The slideFolder could not be saved due to missing or invalid information.")); } }
public ActionConfirmation UpdateWith(SlideFolder slideFolderFromForm, int idOfSlideFolderToUpdate) { SlideFolder slideFolderToUpdate = slideFolderRepository.Get(idOfSlideFolderToUpdate); TransferFormValuesTo(slideFolderToUpdate, slideFolderFromForm); if (slideFolderToUpdate.IsValid()) { ActionConfirmation updateConfirmation = ActionConfirmation.CreateSuccessConfirmation( "The slideFolder was successfully updated."); updateConfirmation.Value = slideFolderToUpdate; return(updateConfirmation); } else { slideFolderRepository.DbContext.RollbackTransaction(); return(ActionConfirmation.CreateFailureConfirmation( "The slideFolder could not be saved due to missing or invalid information.")); } }