public ActionResult Configure(ConfigureModel model) { try { _stripePaymentSettings.ConnectAccountId = model.AccountId; //save settings _settingService.SaveSetting(_stripePaymentSettings); //now clear settings cache _settingService.ClearCache(); var account = _paymentStripeService.GetAccount(model.AccountId); if (!account.PayoutsEnabled) { ErrorNotification(_localizationService.GetResource("Account.Register.Unsuccessful")); } else { SuccessNotification(_localizationService.GetResource("Admin.Plugins.Saved")); } } catch (Exception ex) { _logger.Error("Error posting Payments.Stripe configuration", ex); ErrorNotification(ex.Message, true); } return(View("~/Plugins/Payments.Stripe/Views/Configure.cshtml", model)); }
public ActionResult ProductTab(int id) { ConfigureModel model = new ConfigureModel(); model.Id = id; var product = _productService.GetProductById(id); if (product != null) { if (product.ProductSpecificationAttributes.Any()) { var prodSpecAttriOptions = product.ProductSpecificationAttributes.Select(x => x.SpecificationAttributeOption); if (prodSpecAttriOptions.Any()) { var specAttr = prodSpecAttriOptions.Where(x => x.SpecificationAttribute.Name == "Artist").FirstOrDefault(); if (specAttr != null) { model.ArtistName = specAttr.Name; } } } } return(View("~/Plugins/Products.SpecificationAttributes/Views/SpecificationAttributes/ProductTab.cshtml", model)); }
private void LoadConnectionDropdownList() { var connectionList = ConfigureModel.GetDefaultConnectionList().Select(p => p.ConnectionName).ToList(); connectionList.Insert(0, "New...."); cbtemplate.DataSource = connectionList; }
private void LoadConnectionDropdownList() { var connectionList = ConfigureModel.GetDefaultConnectionList() .Select(p => p.ConnectionName).ToList(); cbtemplate.DataSource = connectionList; cbtemplate.SelectedIndex = -1; }
private void ConnectionMgmt_Load(object sender, EventArgs e) { var connectionList = ConfigureModel.GetDefaultConnectionList() .Select(p => p.ConnectionName).ToList(); connectionList.Insert(0, "New...."); cbtemplate.DataSource = connectionList; }
private void selectdConnection() { if (this.cbtemplate.SelectedIndex > -1) { _currentEntity = ConfigureModel.Find(cbtemplate.SelectedValue.ToString()); tbConnectInfo.Text = _currentEntity.ConnectionString; } }
public IPersistable Save(ConfigureModel toSave) { using (var transaction = _transactionFactory.StartTransaction()) { _queryRunner.CreateOrUpdateProviderConfiguration(transaction, toSave); transaction.Commit(); } return(toSave); }
public ActionResult Configure(ConfigureModel model) { _settings.ApiToken = model.ApiToken; _settingService.SaveSetting(_settings); SuccessNotification("Settings saved.."); return(View("~/Plugins/NhaXeAPI/Views/Configure.cshtml", model)); }
internal string Respond(Stream requestBody, ConfigureModel persistable, string provider) { var requestXml = new StreamReader(requestBody).ReadToEnd(); //Hack to Log Xml as Exception. new LogEvent(requestXml).Raise(); Console.WriteLine(requestXml); return(_messageHandlerFactory.GetHandler(requestXml, provider).HandleResponse(requestXml, persistable)); }
public ActionResult Configure() { var model = new ConfigureModel() { ApiToken = _settings.ApiToken }; return(View("~/Plugins/NhaXeAPI/Views/Configure.cshtml", model)); }
public string HandleResponse(string request, ConfigureModel configuration) { configuration.Sleep(); if (configuration.ThrowStackTrace) { throw new Exception("You are FooBared"); } if (configuration.ThrowFaultException) { return(_equifaxEquifaxMockResponseFactory .ResponseOfType(EquifaxResponseType.FaultException) .Build()); } if (configuration.ThrowValidationFaultException) { return(_equifaxEquifaxMockResponseFactory .ResponseOfType(EquifaxResponseType.ValidationFaultException) .Build()); } if (configuration.NoTrace) { return(_equifaxEquifaxMockResponseFactory .ResponseOfType(EquifaxResponseType.NoTrace) .Build()); } if (configuration.NoMatch) { return(_equifaxEquifaxMockResponseFactory .ResponseOfType(EquifaxResponseType.NoMatch) .Build()); } if (configuration.SingleMatch) { return(_equifaxEquifaxMockResponseFactory .SetRequest(request) .ResponseOfType(EquifaxResponseType.SingleMatch) .OverrideDefaultApplicant() .OverrideScores(configuration) .Build()); } if (configuration.MultipleMatch) { return(_equifaxEquifaxMockResponseFactory .ResponseOfType(EquifaxResponseType.MultipleMatch) .Build()); } throw new Exception("No option has been configured in the stub. Please select an option and try again."); }
public IEquifaxMockResponseFactory OverrideScores(ConfigureModel config) { Template = Template .Replace("{RNILF04Positive}", config.RNILF04Score < 0 ? "false" : "true") .Replace("{RNILF04Value}", Math.Abs(config.RNILF04Score).ToString()) .Replace("{FTILF04Positive}", config.FTILF04Score < 0 ? "false" : "true") .Replace("{FTILF04Value}", Math.Abs(config.FTILF04Score).ToString()) .Replace("{RNILF01Positive}", config.RNILF01Score < 0 ? "false" : "true") .Replace("{RNILF01Value}", Math.Abs(config.RNILF01Score).ToString()) .Replace("{INOSF04Positive}", config.INOSF04Score < 0 ? "false" : "true") .Replace("{INOSF04Value}", Math.Abs(config.INOSF04Score).ToString()); return(this); }
public ConfigureModel PrepareConfigurationModel(StripeAccount account) { var model = new ConfigureModel(); //https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_BlJVOMfIvvIZirpsUMpS1IzZB3z4QuiC&scope=read_write&[email protected]("Test", "ConnectedAccount", null, this.Request.Url.Scheme) model.RedirectUri = "https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_BlJVOMfIvvIZirpsUMpS1IzZB3z4QuiC&scope=read_write&redirect_uri=" + _webHelper.GetStoreLocation(false) + "Plugins/PaymentStripe/StripeOAuth"; if (account != null) { model.AccountId = account.Id; model.PaymentsEnabled = account.PayoutsEnabled; } return(model); }
public ActionResult Configure(ConfigureModel model) { _settings.ApiToken = model.ApiToken; _settings.CodeName = model.CodeName; _settings.KeyPass = model.KeyPass; _settings.ClientIP = model.ClientIP; _settings.NhanVienId = model.NhanVienId; _settings.THOI_GIAN_GHE_DAT_CHO = model.THOI_GIAN_GHE_DAT_CHO; _settings.isChoPhepHuy = model.isChoPhepHuy; _settings.isChoPhepChuyenVe = model.isChoPhepChuyenVe; _settingService.SaveSetting(_settings); SuccessNotification("Settings saved.."); return(View("~/Plugins/NhaXeAPI/Views/Configure.cshtml", model)); }
private void Save() { if (_currentEntity != null) { ConfigureModel Model = new ConfigureModel(); if (cbtemplate.SelectedIndex == -1) { _currentEntity.ConnectionName = this.tbConnectionname.Text; Connections.Add(_currentEntity); } Model.Save(Connections, Configure.DEFAULT_CONNECTION_CONFIG_NAME); ConfigureModel.ClearCache(); this.Close(); } }
public ActionResult Configure() { var model = new ConfigureModel() { ApiToken = _settings.ApiToken, CodeName = _settings.CodeName, KeyPass = _settings.KeyPass, ClientIP = _settings.ClientIP, NhanVienId = _settings.NhanVienId, THOI_GIAN_GHE_DAT_CHO = _settings.THOI_GIAN_GHE_DAT_CHO, isChoPhepHuy = _settings.isChoPhepHuy, isChoPhepChuyenVe = _settings.isChoPhepChuyenVe }; return(View("~/Plugins/NhaXeAPI/Views/Configure.cshtml", model)); }
private void toolbtnupdate_Click(object sender, EventArgs e) { var table = Project.Tables .FirstOrDefault(p => p.Table_Name == lbTableList.SelectedValue.ToString()); var _config = ConfigureModel.Find(Project.ConnectionName); var updatefrm = new Updateschema(table, _config); updatefrm.Notify += Updatefrm_Notify; updatefrm.ShowDialog(); if (tableschemaContext != null) { int currentindex = this.lbTableList.SelectedIndex; tableschemaContext.ResetBindings(false); LoadTableList(tbKeyword.Text); this.lbTableList.SelectedIndex = currentindex; } }
private async void btnupdate_Click(object sender, EventArgs e) { ProjectModel model = new ProjectModel(); if (!cbIsoriginal.Checked) { _config = ConfigureModel.Find(cbtemplate.SelectedValue.ToString()); } model.Notify += Model_Notify; await Task.Run(() => { this.Invoke(new Action(() => { btnupdate.Enabled = false; })); model.UpdateSchema(_table, rbselect2.Checked, cbIsoriginal.Checked, _config, this.Invoke); }); btnupdate.Enabled = true; }
private void Save() { ConfigureModel Model = new ConfigureModel(); if (cbtemplate.SelectedIndex == 0)//add { if (Connections.All(p => p.ConnectionName != this.tbConnectionname.Text)) { var newData = new ConnectionEntity(); newData.ConnectionName = this.tbConnectionname.Text; newData.ServerName = this.tbservername.Text; newData.WindowsAuthentication = cbAuthmode.SelectedIndex == 0; newData.UserId = tbusername.Text; newData.Password = tbpwd.Text; Connections.Add(newData); Model.Save(Connections, Configure.DEFAULT_CONNECTION_CONFIG_NAME); ConfigureModel.ClearCache(); } else { MessageBox.Show("This connection name has exists.", "Warning"); } } else //edit { var data = Connections.FirstOrDefault(p => p.ConnectionName == cbtemplate.SelectedValue.ToString()); if (data != null) { data.ConnectionName = this.tbConnectionname.Text; data.ServerName = this.tbservername.Text; data.WindowsAuthentication = cbAuthmode.SelectedIndex == 0; data.UserId = tbusername.Text; data.Password = tbpwd.Text; Model.Save(Connections, Configure.DEFAULT_CONNECTION_CONFIG_NAME); } else { MessageBox.Show("oops! ", "Warning"); } } }
private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { var editor = (this.ActiveMdiChild as editor); if (editor != null) { var entity = ConfigureModel.Find(editor.Project.ConnectionName); using (DbContext context = new DbContext(entity)) { ProjectModel model = new ProjectModel(); var _columns = context.GetColumns(editor.Project.Tables.Select(p => p.Table_Name).ToArray()); foreach (var item in editor.Project.Tables) { var columns = _columns.Where(p => p.Table == item.Table_Name); item.Object_id = columns.First().Object_id; foreach (var column in item.Columns) { var co = _columns.FirstOrDefault(p => p.Column == column.Column); column.Column_id = co.Column_id; } } } } }
public void CreateOrUpdateProviderConfiguration(IDbTransaction transaction, ConfigureModel configureModel) { var upsertConfiguration = _dapperQueryFactory.UpsertConfiguration(transaction, configureModel); _queryRunner.Query(upsertConfiguration); }
public string HandleResponse(string request, ConfigureModel configuration) { return(_equifaxEquifaxMockResponseFactory.ResponseOfType(EquifaxResponseType.PasswordReset).Build()); }
public ActionResult Configure() { ConfigureModel model = new ConfigureModel(); return(View("~/Plugins/Products.SpecificationAttributes/Views/SpecificationAttributes/Configure.cshtml", model)); }
public ICommandDefinition <int> UpsertConfiguration(IDbTransaction dbTransaction, ConfigureModel provider) { var p = new DynamicParameters(); p.Add("Environment", provider.ForEnvironment); p.Add("Provider", provider.Provider); p.Add("TimeOut", provider.TimeOutMilliSeconds); p.Add("Exception", provider.ThrowFaultException); p.Add("StackTrace", provider.ThrowStackTrace); p.Add("NoTrace", provider.NoTrace); p.Add("NoMatch", provider.NoMatch); p.Add("SingleMatch", provider.SingleMatch); p.Add("MultipleMatch", provider.MultipleMatch); p.Add("RNILF04Score", provider.RNILF04Score); p.Add("FTILF04Score", provider.FTILF04Score); p.Add("RNILF01Score", provider.RNILF01Score); p.Add("INOSF04Score", provider.INOSF04Score); return(new CommandDefinition <int>("UpsertConfig", p, dbTransaction, CommandType.StoredProcedure)); }
public connectmgmt() { InitializeComponent(); cbtemplate.SelectedIndex = 0; Connections = ConfigureModel.GetDefaultConnectionList().ToList(); }