/// <summary> /// Binds the payment config. /// </summary> private void BindPaymentConfig() { //this.phAdditionalParameters.EnableViewState = false; if (this.phAdditionalParameters.Controls.Count > 0) { return; } if (_PaymentMethodDto != null && _PaymentMethodDto.PaymentMethod.Count > 0) { try { PaymentMethodDto.PaymentMethodRow paymentRow = _PaymentMethodDto.PaymentMethod[0]; // Load dynamic configuration form System.Web.UI.Control ctrl = null; String mainPath = string.Concat(_PaymentGatewayConfigurationBasePath, paymentRow.SystemKeyword, _PaymentGatewayConfigurationFileName); if (System.IO.File.Exists(Server.MapPath(mainPath))) { ctrl = base.LoadControl(mainPath); } else { ctrl = base.LoadControl(string.Concat(_PaymentGatewayConfigurationBasePath, "Generic", _PaymentGatewayConfigurationFileName)); } if (ctrl != null) { ctrl.ID = paymentRow.SystemKeyword; IGatewayControl tmpCtrl = (IGatewayControl)ctrl; tmpCtrl.LoadObject(_PaymentMethodDto); tmpCtrl.ValidationGroup = "vg" + paymentRow.SystemKeyword; this.phAdditionalParameters.Controls.Add(ctrl); ctrl.DataBind(); } } catch (Exception ex) { DisplayErrorMessage("Error during binding additional gateway parameters: " + ex.Message); return; } } }
/// <summary> /// Binds the shipping config. /// </summary> private void BindShippingConfig() { if (this.phAdditionalParameters.Controls.Count > 0) { return; } if (_ShippingMethodDto != null && _ShippingMethodDto.ShippingMethod.Count > 0) { try { ShippingMethodDto.ShippingMethodRow shippingRow = _ShippingMethodDto.ShippingMethod[0]; // Load dynamic configuration form System.Web.UI.Control ctrl = null; String mainPath = string.Concat(_ShippingGatewayConfigurationBasePath, shippingRow.ShippingOptionRow.SystemKeyword, _ShippingGatewayConfigurationFileName); if (System.IO.File.Exists(Server.MapPath(mainPath))) { ctrl = base.LoadControl(mainPath); } else { ctrl = base.LoadControl(string.Concat(_ShippingGatewayConfigurationBasePath, "Generic", _ShippingGatewayConfigurationFileName)); } if (ctrl != null) { ctrl.ID = shippingRow.ShippingOptionRow.SystemKeyword; IGatewayControl tmpCtrl = (IGatewayControl)ctrl; tmpCtrl.LoadObject(_ShippingMethodDto); tmpCtrl.ValidationGroup = "vg" + shippingRow.Name; this.phAdditionalParameters.Controls.Add(ctrl); ctrl.DataBind(); } } catch (Exception ex) { DisplayErrorMessage("Error during binding additional shipping method parameters: " + ex.Message); return; } } }