/// <summary>
 /// Set current OrderViewModel if _sendData is set to False and Editor
 /// is ready to get data from other source
 /// </summary>
 private void SetCurrentOrder(IOrderViewModel viewModel)
 {
     if (!_sendData)
     {
         OrderViewModel = viewModel;
     }
 }
        public void CadastroTest()
        {
            IOrderViewModel targetSale     = _container.Resolve <IOrderViewModel>("VM_PedidoVenda");
            IOrderViewModel targetPurchase = _container.Resolve <IOrderViewModel>("VM_PedidoCompra");

            AssertVMOrder(targetSale);
            AssertVMOrder(targetPurchase);

            Cadastro cadastro = targetSale.Cadastro;

            targetSale.Cadastro = new Cadastro();
            Assert.IsNotNull(targetSale.Cadastro);
            Assert.AreNotEqual <Cadastro>(targetSale.Cadastro, cadastro);

            cadastro = targetPurchase.Cadastro;
            targetPurchase.Cadastro = new Cadastro();
            Assert.IsNotNull(targetPurchase.Cadastro);
            Assert.AreNotEqual <Cadastro>(targetPurchase.Cadastro, cadastro);
        }
        public CashierListItemsPresenter(CashierListItemsView view, IOrderViewModel orderViewModel, IUnityContainer container)
        {
            if (view == null)
            {
                throw new ArgumentNullException("view");
            }
            if (orderViewModel == null)
            {
                throw new ArgumentNullException("orderViewModel");
            }
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }

            this._orderViewModel = orderViewModel;
            this._container      = container;
            this._view           = view;
            this._view.SetPresenter(this);
        }
Exemplo n.º 4
0
        public CashierPresenter(ICashierView view, IUnityContainer container)
        {
            if (view == null)
            {
                throw new ArgumentNullException("view");
            }
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }
            this.SubmitCommand = new DelegateCommand <object>(this.Submit, this.CanSubmit);
            this.CancelCommand = new DelegateCommand <object>(this.Cancel);

            this._view = view;
            this._view.SetPresenter(this);
            this._container = container;

            IOrderFactory orderFactory = this._container.Resolve <IOrderFactory>();

            this._orderViewModel = new OrderViewModel(container, orderFactory.CreateOrder(OrderType.SalesOrder));
            this._container.RegisterInstance <IOrderViewModel>(this._orderViewModel, new ExternallyControlledLifetimeManager());
        }
Exemplo n.º 5
0
        public CashierItemsPresenter(ICashierItemsView view, IOrderViewModel orderViewModel, IUnityContainer container)
        {
            if (view == null)
            {
                throw new ArgumentNullException("view");
            }
            if (orderViewModel == null)
            {
                throw new ArgumentNullException("orderViewModel");
            }
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }

            this.SearchProductCommand = new DelegateCommand <object>(this.SearchProduct);

            this._orderViewModel = orderViewModel;
            this._container      = container;
            this._view           = view;
            this._view.SetPresenter(this);
        }
Exemplo n.º 6
0
 public void SetOrderWindowReference(IOrderViewModel orderViewModel)
 {
     _orderWindow = orderViewModel;
 }
Exemplo n.º 7
0
 public void AddNewOrder()
 {
     _dialogOrderWindow = _orderViewModelFactory.GetOrderViewModel();
     ActivateItem(_dialogOrderWindow);
 }
Exemplo n.º 8
0
 public void SetTargetMessage(IOrderViewModel orderViewModel)
 {
     _orderNotyficator.SetTarget(orderViewModel);
 }
Exemplo n.º 9
0
 public void SetOrderWindowReference(OrderViewModel orderViewModel)
 {
     _orderViewModel = orderViewModel;
 }
Exemplo n.º 10
0
 public EditOrderEvent(IOrderViewModel currentOrder)
 {
     CurrentOrder = currentOrder;
 }
Exemplo n.º 11
0
 public void SetTargetMessage(IOrderViewModel orderViewModel)
 {
     _orderNotyficator.SetTarget(orderViewModel);
 }
Exemplo n.º 12
0
 public void SetTarget(IOrderViewModel orderViewModel)
 {
     _orderViewModel = orderViewModel;
 }
Exemplo n.º 13
0
 public OrderView(IOrderViewModel orderViewModel)
 {
     InitializeComponent();
     DataContext = orderViewModel;
 }
Exemplo n.º 14
0
 private void AssertVMOrder(IOrderViewModel orderViewModel)
 {
     Assert.IsNotNull(orderViewModel);
     Assert.IsNotNull(orderViewModel.Cadastro);
 }