public bool CreateWebSettingsForCountry(WebSettingsCreateModel entity, Guid countryId) { WebSettings webSettings = new WebSettings() { Phone = entity.Phone, Email = entity.Email, FacebookSocialLink = entity.FacebookSocialLink, TwitterSocialLink = entity.TwitterSocialLink, VKSocialLink = entity.VKSocialLink, InstagramSocialLink = entity.InstagramSocialLink, GooglePlusSocialLink = entity.GooglePlusSocialLink, CountryId = countryId }; return(_repository.CreateWebSettingsForCountry(webSettings)); }
public IActionResult Create(WebSettingsCreateModel webSettings) { if (ModelState.IsValid) { try { bool statusResult = _webSettingsService.CreateWebSettingsForCountry(webSettings, CountryId); if (statusResult) { return(RedirectToAction(nameof(Details)).WithSuccess(LOCALIZATION_SUCCESS_DEFAULT)); } else { return(NotFound().WithError(LOCALIZATION_ERROR_NOT_FOUND)); } } catch (Exception ex) { _logger.LogError(ex, ex.Message); return(RedirectToAction(nameof(Details)).WithError(ex.Message)); } } return(View(webSettings)); }