public ActionConfirmation SaveOrUpdate(ChannelsSlide channelsSlide) { if (channelsSlide.IsValid()) { channelsSlideRepository.SaveOrUpdate(channelsSlide); ActionConfirmation saveOrUpdateConfirmation = ActionConfirmation.CreateSuccessConfirmation( "The channelsSlide was successfully saved."); saveOrUpdateConfirmation.Value = channelsSlide; return(saveOrUpdateConfirmation); } else { channelsSlideRepository.DbContext.RollbackTransaction(); return(ActionConfirmation.CreateFailureConfirmation( "The channelsSlide could not be saved due to missing or invalid information.")); } }
public ActionConfirmation UpdateWith(ChannelsSlide channelsSlideFromForm, int idOfChannelsSlideToUpdate) { ChannelsSlide channelsSlideToUpdate = channelsSlideRepository.Get(idOfChannelsSlideToUpdate); TransferFormValuesTo(channelsSlideToUpdate, channelsSlideFromForm); if (channelsSlideToUpdate.IsValid()) { ActionConfirmation updateConfirmation = ActionConfirmation.CreateSuccessConfirmation( "The channelsSlide was successfully updated."); updateConfirmation.Value = channelsSlideToUpdate; return(updateConfirmation); } else { channelsSlideRepository.DbContext.RollbackTransaction(); return(ActionConfirmation.CreateFailureConfirmation( "The channelsSlide could not be saved due to missing or invalid information.")); } }