예제 #1
0
 public OrderView(IPresentersFactory presentersFactory,
                  ILocalizationManager localizationManager,
                  OrderViewModel orderViewModel)
     : this(localizationManager)
 {
     _presentersFactory = presentersFactory;
     _orderViewModel = orderViewModel;
 }
예제 #2
0
 public ReadOnlyOrderView(IPresentersFactory presentersFactory, 
                  ILocalizationManager localizationManager,
                  RoutePointViewModel routePointViewModel,
                  OrderViewModel orderViewModel)
     : this(localizationManager)
 {
     _presentersFactory = presentersFactory;
     _routePointViewModel = routePointViewModel;
     _orderViewModel = orderViewModel;
 }
예제 #3
0
        private void OrderViewLoad(object sender, EventArgs e)
        {
            if (_presenter == null) {
                if (_orderViewModel != null && _routePointViewModel != null)
                    _presenter = _presentersFactory.CreateOrderPresenter(this,
                                                                         _routePointViewModel,
                                                                         _orderViewModel);
                else {
                    if (_routePointViewModel != null)
                        _presenter = _presentersFactory.CreateOrderPresenter(this,
                                                                _routePointViewModel);
                    else
                        _presenter = _presentersFactory.CreateOrderPresenter(this, _orderViewModel);
                }

                _viewModel = _presenter.Initialize();

                _orderDateTextBox.Text = _viewModel.OrderDate.ToString(_localizationManager.Localization.GetLocalizedValue("dateformat"));
                _shippingDatePicker.Value = _viewModel.ShippingDate;
                _customerTextBox.Text = _viewModel.CustomerName;
                _shippingAddressTextBox.Text = _viewModel.ShippingAddressName;
                _priceListTextBox.Text = _viewModel.PriceListName;
                _warehouseTextBox.Text = _viewModel.WarehouseName;
                _amountValueLable.Text = _viewModel.Amount.ToString(_localizationManager.Localization.GetLocalizedValue("decimalformat"));
                _notesTextBox.Text = _viewModel.Note;

                orderItemListBox.ItemDataNeeded += ItemDataNeeded;
                orderItemListBox.ItemSelected += ItemSelected;
                orderItemListBox.SetListSize(_presenter.InitializeListSize());

                ViewContainer.RegisterLeftAction(new Save(_presenter));
                ViewContainer.RegisterRightAction(new Cancel(_presenter));
            }
        }
예제 #4
0
 public OrderPresenter CreateOrderPresenter(IOrderView orderView, OrderViewModel orderViewModel)
 {
     return new OrderPresenter(orderView, _unitOfWorkFactory, _repositoryFactory, _configurationManager, _navigator, _lookUpService,
                               orderViewModel);
 }
예제 #5
0
 public void GoToEditRoutePointsOrder(RoutePointViewModel routePointViewModel, OrderViewModel orderViewModel)
 {
     _container.SetView(new OrderView(_presentersFactory, _localizationManager, routePointViewModel, orderViewModel));
 }
예제 #6
0
 public void GoToEditOrder(OrderViewModel orderViewModel)
 {
     _container.SetView(new OrderView(_presentersFactory, _localizationManager, orderViewModel));
 }