Пример #1
0
        public ActionConfirmation SaveOrUpdate(WrmsSystem wrmsSystem)
        {
            if (wrmsSystem.IsValid())
            {
                ValidateWrmsSystem(wrmsSystem);
                _wrmsSystemRepository.SaveOrUpdate(wrmsSystem);

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

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

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