/// <summary>
 /// Handles the Click event of the btnSave control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try {
     if (payPalProConfigurationSettings == null) {
       payPalProConfigurationSettings = new ProviderSettings(typeof(PayPalProPaymentProvider).Name, typeof(PayPalProPaymentProvider).AssemblyQualifiedName);
       paymentServiceSettings.ProviderSettingsCollection.Add(payPalProConfigurationSettings);
     }
     payPalProConfigurationSettings.Parameters.Clear();
     //IMPORTANT: These need to be added in the order they are expected by the constructor used by
     //Activator.CreateInstance in PaymentService
     payPalProConfigurationSettings.Parameters.Add(PayPalProPaymentProvider.API_USERNAME, txtApiUserName.Text.Trim());
     payPalProConfigurationSettings.Parameters.Add(PayPalProPaymentProvider.API_PASSWORD, txtApiPassword.Text.Trim());
     payPalProConfigurationSettings.Parameters.Add(PayPalProPaymentProvider.SIGNATURE, txtSignature.Text.Trim());
     //payPalProConfigurationSettings.Parameters.Add(PayPalProPaymentProvider.BUSINESS_EMAIL, string.Empty);
     payPalProConfigurationSettings.Parameters.Add(PayPalProPaymentProvider.ISLIVE, chkIsLive.Checked.ToString());
     int id = base.Save(paymentServiceSettings, WebUtility.GetUserName());
     if (id > 0) {
       MasterPage.MessageCenter.DisplaySuccessMessage(LocalizationUtility.GetText("lblPaymentConfigurationSaved"));
     }
     else {
       MasterPage.MessageCenter.DisplayFailureMessage(LocalizationUtility.GetText("lblPaymentConfigurationNotSaved"));
     }
       }
       catch(Exception ex) {
     Logger.Error(typeof(paypalproconfiguration).Name + ".btnSave_Click", ex);
     base.MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
       }
 }
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try {
     if (authorizeNetConfigurationSettings == null) {
       authorizeNetConfigurationSettings = new ProviderSettings(typeof(AuthorizeNetPaymentProvider).Name, typeof(AuthorizeNetPaymentProvider).AssemblyQualifiedName);
       paymentServiceSettings.ProviderSettingsCollection.Add(authorizeNetConfigurationSettings);
     }
     authorizeNetConfigurationSettings.Parameters.Clear();
     //IMPORTANT: These need to be added in the order they are expected by the constructor used by
     //Activator.CreateInstance in PaymentService
     authorizeNetConfigurationSettings.Parameters.Add(AuthorizeNetPaymentProvider.API_USERNAME, txtApiUserName.Text.Trim());
     authorizeNetConfigurationSettings.Parameters.Add(AuthorizeNetPaymentProvider.API_TRANSACTION_KEY, txtApiTransactionKey.Text.Trim());
     authorizeNetConfigurationSettings.Parameters.Add(AuthorizeNetPaymentProvider.IS_IN_TEST_MODE, chkIsInTestMode.Checked.ToString());
     authorizeNetConfigurationSettings.Parameters.Add(AuthorizeNetPaymentProvider.ISLIVE, chkIsLive.Checked.ToString());
     int id = base.Save(paymentServiceSettings, WebUtility.GetUserName());
     if (id > 0) {
       MasterPage.MessageCenter.DisplaySuccessMessage("Payment Configuration Saved");
     }
     else {
       MasterPage.MessageCenter.DisplayFailureMessage("Payment Configuration Not Saved");
     }
       }
       catch (Exception ex) {
     base.MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
       }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     try {
     SetAuthorizeNetConfigurationProperties();
     paymentServiceSettings = PaymentService.FetchConfiguredPaymentProviders();
     if(paymentServiceSettings != null) {
       foreach(ProviderSettings providerSettings in paymentServiceSettings.ProviderSettingsCollection) {
     if(providerSettings.Name == typeof(AuthorizeNetPaymentProvider).Name) {
       authorizeNetConfigurationSettings = providerSettings;
     }
       }
       if (authorizeNetConfigurationSettings != null) {
     txtApiUserName.Text = authorizeNetConfigurationSettings.Parameters[AuthorizeNetPaymentProvider.API_USERNAME];
     txtApiTransactionKey.Text = authorizeNetConfigurationSettings.Parameters[AuthorizeNetPaymentProvider.API_TRANSACTION_KEY];
     bool isInTestMode = true;
     bool isParsed = bool.TryParse(authorizeNetConfigurationSettings.Parameters[AuthorizeNetPaymentProvider.IS_IN_TEST_MODE], out isInTestMode);
     chkIsInTestMode.Checked = isInTestMode;
     bool isLive = false;
     isParsed = bool.TryParse(authorizeNetConfigurationSettings.Parameters[AuthorizeNetPaymentProvider.ISLIVE], out isLive);
     chkIsLive.Checked = isLive;
       }
     }
     else {
       paymentServiceSettings = new PaymentServiceSettings();
     }
       }
       catch(Exception ex) {
     base.MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
       }
 }
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try {
     bool isProductionMode = rbProductionMode.Checked;
     bool isApiMode = rbAPICredentials.Checked;
     //MasterPage.MessageCenter.DisplayInformationMessage("Is Production Mode: " + isProductionMode.ToString() + "<br/>Is Api Mode: " + isApiMode.ToString());
     //paymentServiceSettings = PaymentService.FetchConfiguredPaymentProviders();
     if (payPalProConfigurationSettings == null) {
       payPalProConfigurationSettings = new ProviderSettings(typeof(PayPalProPaymentProvider).Name, typeof(PayPalProPaymentProvider).AssemblyQualifiedName);
       paymentServiceSettings.ProviderSettingsCollection.Add(payPalProConfigurationSettings);
     }
     payPalProConfigurationSettings.Parameters.Clear();
     //IMPORTANT: These need to be added in the order they are expected by the constructor used by
     //Activator.CreateInstance in PaymentService
     payPalProConfigurationSettings.Parameters.Add(PayPalProPaymentProvider.API_USERNAME, txtApiUserName.Text.Trim());
     payPalProConfigurationSettings.Parameters.Add(PayPalProPaymentProvider.API_PASSWORD, txtApiPassword.Text.Trim());
     payPalProConfigurationSettings.Parameters.Add(PayPalProPaymentProvider.SIGNATURE, txtSignature.Text.Trim());
     string businessEmail = isApiMode ? string.Empty : txtEmailAddress.Text.Trim();
     payPalProConfigurationSettings.Parameters.Add(PayPalProPaymentProvider.BUSINESS_EMAIL, businessEmail);
     payPalProConfigurationSettings.Parameters.Add(PayPalProPaymentProvider.ISLIVE, isProductionMode.ToString());
     int id = base.Save(paymentServiceSettings, WebUtility.GetUserName());
     if (id > 0) {
       MasterPage.MessageCenter.DisplaySuccessMessage(LocalizationUtility.GetText("lblPaymentConfigurationSaved"));
     }
     else {
       MasterPage.MessageCenter.DisplayFailureMessage(LocalizationUtility.GetText("lblPaymentConfigurationNotSaved"));
     }
       }
       catch (Exception ex) {
     Logger.Error(typeof(paypalacceleratedboarding).Name + ".btnSave_Click", ex);
     base.MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
       }
 }
 /// <summary>
 /// Handles the Click event of the btnSave control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try {
     if(simpleWeightConfigurationSettings == null) {
       simpleWeightConfigurationSettings = new ProviderSettings(typeof(SimpleWeightShippingProvider).Name, typeof(SimpleWeightShippingProvider).AssemblyQualifiedName);
       shippingServiceSettings.ProviderSettingsCollection.Add(simpleWeightConfigurationSettings);
     }
     int id = base.Save(shippingServiceSettings, WebUtility.GetUserName());
     if(id > 0) {
       MasterPage.MessageCenter.DisplaySuccessMessage(LocalizationUtility.GetText("lblShippingConfigurationSaved"));
     }
     else {
       MasterPage.MessageCenter.DisplayFailureMessage(LocalizationUtility.GetText("lblShippingConfigurationNotSaved"));
     }
       }
       catch(Exception ex) {
     Logger.Error(typeof(simpleweightconfiguration).Name + ".btnSave_Click", ex);
     base.MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
       }
 }
 /// <summary>
 /// Handles the Load event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void Page_Load(object sender, EventArgs e)
 {
     try {
     SetNullPaymentConfigurationProperties();
     paymentServiceSettings = PaymentService.FetchConfiguredPaymentProviders();
     if(paymentServiceSettings != null) {
       foreach(ProviderSettings providerSettings in paymentServiceSettings.ProviderSettingsCollection) {
     if(providerSettings.Name == typeof(NullPaymentProvider).Name) {
       nullPaymentConfigurationSettings = providerSettings;
     }
       }
     }
     else {
       paymentServiceSettings = new PaymentServiceSettings();
     }
       }
       catch(Exception ex) {
     Logger.Error(typeof(nullpaymentconfiguration).Name + ".Page_Load", ex);
     base.MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
       }
 }
 /// <summary>
 /// Handles the Click event of the btnSave control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try {
     if(nullPaymentConfigurationSettings == null) {
       nullPaymentConfigurationSettings = new ProviderSettings(typeof(NullPaymentProvider).Name, typeof(NullPaymentProvider).AssemblyQualifiedName);
       paymentServiceSettings.ProviderSettingsCollection.Add(nullPaymentConfigurationSettings);
     }
     nullPaymentConfigurationSettings.Parameters.Clear();
     int id = base.Save(paymentServiceSettings, WebUtility.GetUserName());
     if(id > 0) {
       MasterPage.MessageCenter.DisplaySuccessMessage(LocalizationUtility.GetText("lblPaymentConfigurationSaved"));
     }
     else {
       MasterPage.MessageCenter.DisplayFailureMessage(LocalizationUtility.GetText("lblPaymentConfigurationNotSaved"));
     }
       }
       catch(Exception ex) {
     Logger.Error(typeof(nullpaymentconfiguration).Name + ".btnSave_Click", ex);
     base.MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
       }
 }
 /// <summary>
 /// Handles the Click event of the btnSave control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try {
     PaymentServiceSettings paymentServiceSettings = new PaymentServiceSettings();
     ProviderSettings settings = new ProviderSettings();
     settings.Name = typeof(PayPalProPaymentProvider).Name;
     settings.Type = typeof(PayPalProPaymentProvider).AssemblyQualifiedName;
     settings.Parameters.Add("ApiUserName", "username");
     settings.Parameters.Add("ApiPassword", "password");
     settings.Parameters.Add("Signature", "signature");
     settings.Parameters.Add("IsLive", "false");
     paymentServiceSettings.ProviderSettingsCollection.Add(settings);
     DatabaseConfigurationProvider config = new DatabaseConfigurationProvider();
     config.SaveConfiguration(PaymentServiceSettings.SECTION_NAME, paymentServiceSettings, WebUtility.GetUserName());
     SiteSettingCache.RemoveSiteSettingsFromCache();
       }
       catch (Exception ex) {
     Logger.Error(typeof(paymentserviceconfiguration).Name + ".Page_Load", ex);
     Master.MessageCenter.DisplayCriticalMessage(ex.Message);
       }
 }
 /// <summary>
 /// Handles the Click event of the btnSave control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try {
     if(payPalStandardConfigurationSettings == null) {
       payPalStandardConfigurationSettings = new ProviderSettings(typeof(PayPalStandardPaymentProvider).Name, typeof(PayPalStandardPaymentProvider).AssemblyQualifiedName);
       paymentServiceSettings.ProviderSettingsCollection.Add(payPalStandardConfigurationSettings);
     }
     payPalStandardConfigurationSettings.Parameters.Clear();
     payPalStandardConfigurationSettings.Parameters.Add(PayPalStandardPaymentProvider.ISLIVE, chkIsLive.Checked.ToString());
     payPalStandardConfigurationSettings.Parameters.Add(PayPalStandardPaymentProvider.BUSINESS_EMAIL, txtBusinessEmail.Text.Trim());
     payPalStandardConfigurationSettings.Parameters.Add(PayPalStandardPaymentProvider.PDTID, txtPdtId.Text.Trim());
     int id = base.Save(paymentServiceSettings, WebUtility.GetUserName());
     if(id > 0) {
       MasterPage.MessageCenter.DisplaySuccessMessage(LocalizationUtility.GetText("lblPaymentConfigurationSaved"));
     }
     else {
       MasterPage.MessageCenter.DisplayFailureMessage(LocalizationUtility.GetText("lblPaymentConfigurationNotSaved"));
     }
       }
       catch(Exception ex) {
     Logger.Error(typeof(paypalstandardconfiguration).Name + ".btnSave_Click", ex);
     base.MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
       }
 }
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try {
     if (vatTaxConfigurationSettings == null) {
       vatTaxConfigurationSettings = new ProviderSettings(typeof(VatTaxProvider).Name, typeof(VatTaxProvider).AssemblyQualifiedName);
       taxServiceSettings.ProviderSettingsCollection.Add(vatTaxConfigurationSettings);
     }
     vatTaxConfigurationSettings.Parameters.Clear();
     //IMPORTANT: These need to be added in the order they are expected by the constructor used by
     //Activator.CreateInstance in PaymentService
     //vatTaxConfigurationSettings.Parameters.Add(RegionCodeTaxProvider.DEFAULT_RATE, txtDefaultRate.Text.Trim());
     int id = base.Save(taxServiceSettings, WebUtility.GetUserName());
     if (id > 0) {
       MasterPage.MessageCenter.DisplaySuccessMessage(LocalizationUtility.GetText("lblTaxConfigurationSaved"));
     }
     else {
       MasterPage.MessageCenter.DisplayFailureMessage(LocalizationUtility.GetText("lblTaxConfigurationNotSaved"));
     }
       }
       catch (Exception ex) {
     Logger.Error(typeof(vattaxconfiguration).Name + ".btnSave_Click", ex);
     base.MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
       }
 }
 /// <summary>
 /// Handles the Load event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
 protected void Page_Load(object sender, EventArgs e)
 {
     try {
     SetPayPalStandardConfigurationProperties();
     paymentServiceSettings = PaymentService.FetchConfiguredPaymentProviders();
     if(paymentServiceSettings != null) {
       foreach(ProviderSettings providerSettings in paymentServiceSettings.ProviderSettingsCollection) {
     if(providerSettings.Name == typeof(PayPalStandardPaymentProvider).Name) {
       payPalStandardConfigurationSettings = providerSettings;
     }
       }
       if(payPalStandardConfigurationSettings != null) {
     bool isLive = false;
     bool isParsed = bool.TryParse(payPalStandardConfigurationSettings.Parameters[PayPalStandardPaymentProvider.ISLIVE], out isLive);
     chkIsLive.Checked = isLive;
     txtBusinessEmail.Text = payPalStandardConfigurationSettings.Parameters[PayPalStandardPaymentProvider.BUSINESS_EMAIL];
     txtPdtId.Text = payPalStandardConfigurationSettings.Parameters[PayPalStandardPaymentProvider.PDTID];
       }
     }
     else {
       paymentServiceSettings = new PaymentServiceSettings();
     }
       }
       catch(Exception ex) {
     Logger.Error(typeof(paypalstandardconfiguration).Name + ".Page_Load", ex);
     base.MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
       }
 }
 /// <summary>
 /// Handles the Load event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
 protected void Page_Load(object sender, EventArgs e)
 {
     try {
     SetPayPalProConfigurationProperties();
     paymentServiceSettings = PaymentService.FetchConfiguredPaymentProviders();
     if(paymentServiceSettings != null) {
       foreach(ProviderSettings providerSettings in paymentServiceSettings.ProviderSettingsCollection) {
     if(providerSettings.Name == typeof(PayPalProPaymentProvider).Name) {
       payPalProConfigurationSettings = providerSettings;
       break;
     }
       }
       if(payPalProConfigurationSettings != null) {
     txtApiUserName.Text = payPalProConfigurationSettings.Parameters[PayPalProPaymentProvider.API_USERNAME];
     txtApiPassword.Text = payPalProConfigurationSettings.Parameters[PayPalProPaymentProvider.API_PASSWORD];
     txtSignature.Text = payPalProConfigurationSettings.Parameters[PayPalProPaymentProvider.SIGNATURE];
     bool isLive = false;
     bool isParsed = bool.TryParse(payPalProConfigurationSettings.Parameters[PayPalProPaymentProvider.ISLIVE], out isLive);
     chkIsLive.Checked = isLive;
       }
     }
     else {
       paymentServiceSettings = new PaymentServiceSettings();
     }
       }
       catch(Exception ex) {
     Logger.Error(typeof(paypalproconfiguration).Name + ".Page_Load", ex);
     base.MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
       }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     try {
     SetVatConfigurationProperties();
     taxServiceSettings = TaxService.FetchConfiguredTaxProviders();
     if (taxServiceSettings != null) {
       foreach (ProviderSettings providerSettings in taxServiceSettings.ProviderSettingsCollection) {
     if (providerSettings.Name == typeof(VatTaxProvider).Name) {
       vatTaxConfigurationSettings = providerSettings;
     }
       }
       //if (vatTaxConfigurationSettings != null) {
       //  txtDefaultRate.Text = vatTaxConfigurationSettings.Parameters[VatTaxProvider.DEFAULT_RATE];
       //}
     }
     else {
       taxServiceSettings = new TaxServiceSettings();
     }
     view = Utility.GetParameter("view");
     switch (view) {
       case "c":
     pnlVatTaxConfiguration.Visible = true;
     pnlVatTaxData.Visible = false;
     break;
       case "d":
     LoadVatTaxRates();
     pnlVatTaxData.Visible = true;
     pnlVatTaxConfiguration.Visible = false;
     break;
       default:
     pnlVatTaxConfiguration.Visible = true;
     pnlVatTaxData.Visible = false;
     break;
     }
       }
       catch (Exception ex) {
     Logger.Error(typeof(vattaxconfiguration).Name + ".Page_Load", ex);
     base.MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
       }
 }
 /// <summary>
 /// Handles the Load event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
 protected void Page_Load(object sender, EventArgs e)
 {
     try {
     SetSimpleWeightConfigurationProperties();
     shippingServiceSettings = ShippingService.FetchConfiguredShippingProviders();
     if(shippingServiceSettings != null) {
       foreach(ProviderSettings providerSettings in shippingServiceSettings.ProviderSettingsCollection) {
     if(providerSettings.Name == typeof(SimpleWeightShippingProvider).Name) {
       simpleWeightConfigurationSettings = providerSettings;
     }
       }
     }
     else {
       shippingServiceSettings = new ShippingServiceSettings();
     }
     view = Utility.GetParameter("view");
     switch(view) {
       case "c":
     pnlConfiguration.Visible = true;
     pnlData.Visible = false;
     break;
       case "d":
     LoadSimpleShippingWeightRates();
     pnlData.Visible = true;
     pnlConfiguration.Visible = false;
     break;
       default:
     pnlConfiguration.Visible = true;
     pnlData.Visible = false;
     break;
     }
       }
       catch(Exception ex) {
     Logger.Error(typeof(simpleweightconfiguration).Name + ".Page_Load", ex);
     base.MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
       }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            paymentServiceSettings = PaymentService.FetchConfiguredPaymentProviders();
              if (paymentServiceSettings != null) {
            foreach (ProviderSettings providerSettings in paymentServiceSettings.ProviderSettingsCollection) {
              if (providerSettings.Name == typeof(PayPalProPaymentProvider).Name) {
            payPalProConfigurationSettings = providerSettings;
            break;
              }
            }
            if (!Page.IsPostBack) {
              if (payPalProConfigurationSettings != null) {
            bool isLive = false;
            bool isParsed = bool.TryParse(payPalProConfigurationSettings.Parameters[PayPalProPaymentProvider.ISLIVE],
                                          out isLive);
            if (isLive) {
              rbProductionMode.Checked = true;
            }
            else {
              rbSandboxMode.Checked = true;
            }

            if (!string.IsNullOrEmpty(payPalProConfigurationSettings.Parameters[PayPalProPaymentProvider.BUSINESS_EMAIL])) {
              txtEmailAddress.Text = payPalProConfigurationSettings.Parameters[PayPalProPaymentProvider.BUSINESS_EMAIL];
              txtApiUserName.Text = txtApiPassword.Text = txtSignature.Text = string.Empty;
              txtEmailAddress.Enabled = rfvEmailAddress.Enabled = true;
              pnlPayPalApiCredentials.Enabled = false;
              txtApiUserName.Enabled = txtApiPassword.Enabled = txtSignature.Enabled = false;
              rfvApiUserName.Enabled = rfvApiPassword.Enabled = rfvApiSignature.Enabled = false;
              rbEmailAddress.Checked = true;
            }
            else {
              txtApiUserName.Text = payPalProConfigurationSettings.Parameters[PayPalProPaymentProvider.API_USERNAME];
              txtApiPassword.Text = payPalProConfigurationSettings.Parameters[PayPalProPaymentProvider.API_PASSWORD];
              txtSignature.Text = payPalProConfigurationSettings.Parameters[PayPalProPaymentProvider.SIGNATURE];
              txtEmailAddress.Text = string.Empty;
              txtEmailAddress.Enabled = rfvEmailAddress.Enabled = false;
              pnlPayPalApiCredentials.Enabled = true;
              txtApiUserName.Enabled = txtApiPassword.Enabled = txtSignature.Enabled = true;
              rfvApiUserName.Enabled = rfvApiPassword.Enabled = rfvApiSignature.Enabled = true;
              rbAPICredentials.Checked = true;
            }
              }
            }
              }
              else {
            paymentServiceSettings = new PaymentServiceSettings();
            if (!Page.IsPostBack) {
              rbProductionMode.Checked = true;
              rbEmailAddress.Checked = true;
            }
              }
        }