private void LoadData() { PayPalPaymentsProSettings settings = new PayPalPaymentsProSettings(); settings.Merge(MyPage.MTApp.CurrentStore.Settings.PaymentSettingsGet(this.BlockId)); this.UsernameTextBox.Text = settings.PayPalUserName; if (settings.PayPalPassword.Length > 0) { this.PasswordTextBox.Text = "**********"; } //this.PasswordTextBox.Text = settings.PayPalPassword; this.SignatureTextBox.Text = settings.PayPalSignature; this.ModeRadioButtonList.SelectedValue = settings.PayPalMode; this.chkDebugMode.Checked = settings.DebugMode; //this.UsernameTextBox.Text = MyPage.CurrentStore.PaypalUserName; //this.PasswordTextBox.Text = MyPage.CurrentStore.PaypalPassword; //this.SignatureTextBox.Text = MyPage.CurrentStore.PaypalSignature; //this.ModeRadioButtonList.SelectedValue = MyPage.CurrentStore.PaypalMode; }
private void SaveData() { PayPalPaymentsProSettings settings = new PayPalPaymentsProSettings(); settings.Merge(MyPage.MTApp.CurrentStore.Settings.PaymentSettingsGet(this.BlockId)); settings.PayPalUserName = this.UsernameTextBox.Text; if (this.PasswordTextBox.Text != "**********") { settings.PayPalPassword = this.PasswordTextBox.Text; } settings.PayPalSignature = this.SignatureTextBox.Text; settings.PayPalMode = this.ModeRadioButtonList.SelectedValue; //MyPage.Services.CurrentStore.PaypalUserName = this.UsernameTextBox.Text; //MyPage.Services.CurrentStore.PaypalPassword = this.PasswordTextBox.Text; //MyPage.Services.CurrentStore.PaypalSignature = this.SignatureTextBox.Text; //MyPage.Services.CurrentStore.PaypalMode = this.ModeRadioButtonList.SelectedValue; settings.DebugMode = this.chkDebugMode.Checked; MyPage.MTApp.CurrentStore.Settings.PaymentSettingsSet(this.BlockId, settings); MyPage.MTApp.AccountServices.Stores.Update(MyPage.MTApp.CurrentStore); }