コード例 #1
0
        public CustomerCardViewModel(IUnityContainer container,
                            IRegionManager regionManager,
                            IEventAggregator eventAggregator)
        {
            _container = container;
            _eventAggregator = eventAggregator;
            _regionManager = regionManager;

            this.NotificationRequest = new InteractionRequest<INotification>();

            _clientLayer = new ClientLayer();
            CurrentCustomer = new Customer();
            _customerTypes = new ObservableCollection<CustomerType>(_clientLayer.GetAllCustomerTypes());
            //CurrentCustomerType = _currentCustomer.CustomerType;
        }
コード例 #2
0
 private void EditCustomerDetails()
 {
     _currentCustomer = _collectionView.CurrentItem as Customer;
     if (_currentCustomer != null)
     {
         ShowCustomersDetails(false);
     }
 }
コード例 #3
0
 private void CreateCustomer(Customer customer)
 {
     ShowCustomersDetails(true);
 }
コード例 #4
0
 private void SelectedCustomerChanged(object sender, EventArgs e)
 {
     //для динамического просмотра
     _currentCustomer = _collectionView.CurrentItem as Customer;
     if (_currentCustomer != null)
     {
         _eventAggregator.GetEvent<CustomerSelectedEvent>().Publish(_currentCustomer.Id);
     }
 }
コード例 #5
0
 public void OnNavigatedTo(NavigationContext navigationContext)
 {
     _currentCustomer = (Customer)navigationContext.Parameters["CurrentCustomer"];
     string status = (string)navigationContext.Parameters["StatusCustomer"];
     if (_currentCustomer != null && status != "CancelCustomer")
     {
         if (status == "NewCustomer") _customers.Add(_currentCustomer);
         Customers.MoveCurrentTo(_currentCustomer);
         Customers.Refresh();
     }
 }
コード例 #6
0
 public void OnNavigatedTo(NavigationContext navigationContext)
 {
     string status = (string)navigationContext.Parameters["StatusCustomer"];
     if (status == "NewCustomer")
     {
         CurrentCustomer = new Customer();
         CurrentCustomerType = null;
     }
     else if (status == "EditCustomer")
     {
         CurrentCustomer = (Customer)navigationContext.Parameters["CurrentCustomer"];
         CurrentCustomerType = CurrentCustomer.CustomerType;
     }
     RemoveDetailsView();
 }
コード例 #7
0
 private void CancelCustomerDetails()
 {
     
     NavigationParameters navigationParameters = new NavigationParameters();
     navigationParameters.Add("CurrentCustomer", _currentCustomer);
     _regionManager.RequestNavigate(RegionNames.DetailRegion, ViewNames.CustomerDetailsView, navigationParameters);
     _currentCustomer = null;
     navigationParameters.Add("StatusCustomer", "CancelCustomer");
     _regionManager.RequestNavigate(RegionNames.MainRegion, ViewNames.CustomerListView, navigationParameters);
     
     //_regionManager.RequestNavigate(RegionNames.MainRegion, new Uri(ViewNames.CustomerListView, UriKind.Relative), navigationParameters);
 }
コード例 #8
0
 public void OnNavigatedTo(NavigationContext navigationContext)
 {
     CurrentCustomer = (Customer)navigationContext.Parameters["CurrentCustomer"];
 }
コード例 #9
0
 private void CustomerSelected(int id)
 {
     CurrentCustomer = _clientLayer.GetCustomerById(id);
 }