Пример #1
0
        public OperationResult Update(SiteNameModel siteNameModel)
        {
            try
            {
                Core core        = _coreHelper.GetCore();
                var  siteNameDto = core.Advanced_SiteItemRead(siteNameModel.Id);

                if (!siteNameDto.Equals(null))
                {
                    core.Advanced_SiteItemUpdate(siteNameDto.SiteUId, siteNameModel.SiteName);
                    return(new OperationResult(true));
                }
                return(new OperationResult(false));
            }
            catch (Exception)
            {
                return(new OperationResult(false, $"Site with id {siteNameModel.Id} could not be updated!"));
            }
        }
        public OperationResult Update(SiteNameModel siteNameModel)
        {
            try
            {
                Core core        = _coreHelper.GetCore();
                var  siteNameDto = core.Advanced_SiteItemRead(siteNameModel.Id);

                if (!siteNameDto.Equals(null))
                {
                    core.Advanced_SiteItemUpdate(siteNameDto.SiteUId, siteNameModel.SiteName);
                    return(new OperationResult(true));
                }
                return(new OperationResult(false));
            }
            catch (Exception)
            {
                return(new OperationResult(false, LocaleHelper.GetString("SiteParamCouldNotBeUpdated", siteNameModel.Id)));
            }
        }