public CustomSettings UpdateExchanges(SettingsViewModel settings) { try { var newSettings = new CustomSettings(); var model = _requests.GetAssets(settings.LastExchange); _fileManager.WriteAssetsToExcel(_directoryManager.AsstesUpdateLocation, model); newSettings.Btc = model.Btc; newSettings.Exchange = model.ExchangeName; newSettings.LowerBorder = settings.LowerBorder; newSettings.UpperBorder = settings.UpperBorder; newSettings.UpperWidth = settings.UpperWidth; newSettings.LowerWidth = settings.LowerWidth; var json = _fileManager.ConvertCustomSettings(newSettings); _directoryManager.UpdateCustomSettings(json); return(newSettings); } catch (Exception e) { throw new Exception(e.Message); } }