Пример #1
0
        public ActionConfirmation SaveOrUpdate(RSSFeed rSSFeed)
        {
            if (rSSFeed.IsValid())
            {
                rSSFeedRepository.SaveOrUpdate(rSSFeed);

                ActionConfirmation saveOrUpdateConfirmation = ActionConfirmation.CreateSuccessConfirmation(
                    "The rSSFeed was successfully saved.");
                saveOrUpdateConfirmation.Value = rSSFeed;

                return(saveOrUpdateConfirmation);
            }
            else
            {
                rSSFeedRepository.DbContext.RollbackTransaction();

                return(ActionConfirmation.CreateFailureConfirmation(
                           "The rSSFeed could not be saved due to missing or invalid information."));
            }
        }
Пример #2
0
        public ActionConfirmation UpdateWith(RSSFeed rSSFeedFromForm, int idOfRSSFeedToUpdate)
        {
            RSSFeed rSSFeedToUpdate =
                rSSFeedRepository.Get(idOfRSSFeedToUpdate);

            TransferFormValuesTo(rSSFeedToUpdate, rSSFeedFromForm);

            if (rSSFeedToUpdate.IsValid())
            {
                ActionConfirmation updateConfirmation = ActionConfirmation.CreateSuccessConfirmation(
                    "The rSSFeed was successfully updated.");
                updateConfirmation.Value = rSSFeedToUpdate;

                return(updateConfirmation);
            }
            else
            {
                rSSFeedRepository.DbContext.RollbackTransaction();

                return(ActionConfirmation.CreateFailureConfirmation(
                           "The rSSFeed could not be saved due to missing or invalid information."));
            }
        }