public IActionResult Configure(STMModel model) { if (!ModelState.IsValid) { return(View()); } try { _stmSettings.EndpointAddress = model.EndpointAddress; _stmSettings.MinimumStockCount = model.MinimumStockCount; _settingService.SaveSetting(_stmSettings); } catch (Exception ex) { Exception inner = ex; while (inner.InnerException != null) { inner = inner.InnerException; } _logger.Error("Configure STM: " + inner.Message, ex); model.ErrorMessage += "<br />" + inner.Message; } return(View("~/Plugins/ExternalSuppliers.STM/Views/Configure.cshtml", model)); }
public async Task <IActionResult> Configure() { STMModel model = null; try { model = GetBaseModel(); } catch (Exception ex) { Exception inner = ex; while (inner.InnerException != null) { inner = inner.InnerException; } _logger.Error("Configure STM: " + inner.Message, ex); model.ErrorMessage += "<br />" + inner.Message; } return(await Task.Run(() => View("~/Plugins/ExternalSuppliers.STM/Views/Configure.cshtml", model))); }