public void InitMVP() { view = new MockDetails(); controller = new MockOrdersController(); productService = new MockProductService(); orderDetailsConverter = new OrderDetailsConverter(productService); presenter = new OrderDetailsPresenter(controller, productService, orderDetailsConverter); presenter.View = view; }
/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.Load"/> event. /// </summary> /// <param name="e">The <see cref="T:System.EventArgs"/> object that contains the event data.</param> protected override void OnLoad(EventArgs e) { Debug.ArgumentNotNull(e, "e"); base.OnLoad(e); this.GetOrder(); // INFO: do not remove this "magic" call, otherwise the following line will not work. OrderDetailsView view = new OrderDetailsView { Order = this.GetOrder() }; this.presenter = new OrderDetailsPresenter(view) { OrderSecurity = Ecommerce.Context.Entity.Resolve<MerchantOrderSecurity>(), OrderStateListValidator = Ecommerce.Context.Entity.Resolve<OrderStateListValidator>() }; this.presenter.Initialize(); this.Page.Items["OrderDetailsView"] = view; }
/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.Load"/> event. /// </summary> /// <param name="e">The <see cref="T:System.EventArgs"/> object that contains the event data.</param> protected override void OnLoad(EventArgs e) { Debug.ArgumentNotNull(e, "e"); base.OnLoad(e); this.GetOrder(); // INFO: do not remove this "magic" call, otherwise the following line will not work. OrderDetailsView view = new OrderDetailsView { Order = this.GetOrder() }; this.presenter = new OrderDetailsPresenter(view) { OrderSecurity = Ecommerce.Context.Entity.Resolve <MerchantOrderSecurity>(), OrderStateListValidator = Ecommerce.Context.Entity.Resolve <OrderStateListValidator>() }; this.presenter.Initialize(); this.Page.Items["OrderDetailsView"] = view; }
public OrderDetailsView() { InitializeComponent(); presenter = new OrderDetailsPresenter(this); }