示例#1
0
        public IActionResult Configure(BonvitaModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            try
            {
                _bonvitaSettings.FtpHost     = model.FtpHost;
                _bonvitaSettings.User        = model.User;
                _bonvitaSettings.Pass        = model.Pass;
                _bonvitaSettings.CSVFileName = model.CSVFileName;

                _settingService.SaveSetting(_bonvitaSettings);
            }
            catch (Exception ex)
            {
                Exception inner = ex;
                while (inner.InnerException != null)
                {
                    inner = inner.InnerException;
                }
                _logger.Error("Configure Bonvita: " + inner.Message, ex);
                model.ErrorMessage += "<br />" + inner.Message;
            }
            return(View("~/Plugins/ExternalSuppliers.Bonvita/Views/Configure.cshtml", model));
        }
示例#2
0
        public async Task <IActionResult> Configure()
        {
            BonvitaModel model = null;

            try
            {
                model = GetBaseModel();
            }
            catch (Exception ex)
            {
                Exception inner = ex;
                while (inner.InnerException != null)
                {
                    inner = inner.InnerException;
                }
                _logger.Error("Configure Bonvita: " + inner.Message, ex);
                model.ErrorMessage += "<br />" + inner.Message;
            }

            return(await Task.Run(() => View("~/Plugins/ExternalSuppliers.Bonvita/Views/Configure.cshtml", model)));
        }