Exemplo n.º 1
0
        //public event EventHandler<ProjectListEventArgs> OnGetProjectsByCustomerCompleted;

        public TaskTreeViewModel(ICustomerRepository customerRepository, IDataService dataService, IUserRepository userRepository, TaskManagementFilters fetchFilters)
        {
            _customerRepository             = customerRepository;
            _customerRepository.DataLoaded += _customerRepository_DataLoaded;
            _dataService    = dataService;
            _userRepository = userRepository;
            _fetchFilters   = fetchFilters;
            //BindCustomerViewModels();
            //IsBusy = !_customerRepository.IsDataLoaded;
            Customers             = new ObservableCollection <TreeCustomerViewModel>();
            IsLoadOnDemandEnabled = true;
            WireUpEvents();

            InternalCommands.TaskEditCompleted.RegisterCommand(new DelegateCommand <Task>(TaskEditCompleted));
            InternalCommands.ProjectEditCompleted.RegisterCommand(new DelegateCommand <Project>(ProjectEditCompleted));
            InternalCommands.TaskAddCompleted.RegisterCommand(new DelegateCommand <Task>(TaskAddCompleted));
            InternalCommands.TaskDeleteCompleted.RegisterCommand(new DelegateCommand <int?>(TaskDeleteCompleted));
            InternalCommands.ProjectDeleteCompleted.RegisterCommand(new DelegateCommand <int?>(ProjectDeleteCompleted));
            InternalCommands.ProjectAddCompleted.RegisterCommand(new DelegateCommand <Project>(ProjectAddCompleted));
            InternalCommands.CustomerDeleteCompleted.RegisterCommand(new DelegateCommand <int?>(CustomerDeleteCompleted));
            InternalCommands.CustomerEditCompleted.RegisterCommand(new DelegateCommand <Customer>(CustomerEditCompleted));
            InternalCommands.CustomerAddCompleted.RegisterCommand(new DelegateCommand <Customer>(CustomerAddCompleted));
            InternalCommands.TaskSearchCompleted.RegisterCommand(new DelegateCommand <IEntity>(TaskSearchCompleted));
            //InternalCommands.CustomerInvoiceGroupComplete.RegisterCommand(new DelegateCommand<Customer>(CustomerInvoiceGroupCompleted));

            //OnItemLoadOnDemand = new DelegateCommand<RadTreeViewItem>(ItemLoadOnDemand);
        }
Exemplo n.º 2
0
 public TreeCustomerViewModel(IDataService dataService, Customer customer, ICustomerRepository customerRepository, IUserRepository userRepository, TaskManagementFilters fetchFilters)
     : base(null, customer)
 {
     _dataService        = dataService;
     _customerRepository = customerRepository;
     _userRepository     = userRepository;
     _fetchFilters       = fetchFilters;
 }
        public TaskAdministrationMasterViewModel(IDataService dataService, TaskManagementFilters fetchFilters)
        {
            _dataService  = dataService;
            _fetchFilters = fetchFilters;

            RefreshCommand        = new DelegateCommand <object>(ExecuteRefresh);
            CreateCustomerCommand = new DelegateCommand <object>(ExecuteCreateCustomer);
            SearchViewModel       = new SearchViewModel(_dataService);
        }
Exemplo n.º 4
0
        public CustomerRepository(IDataService dataService, IExceptionHandlerService exceptionHandlerService, TaskManagementFilters fetchFilters)
        {
            Customers                = new ObservableCollection <Customer>();
            _dataService             = dataService;
            _exceptionHandlerService = exceptionHandlerService;
            _fetchFilters            = fetchFilters;

            ApplicationCommands.RefreshData.RegisterCommand(new DelegateCommand <object>(ExecuteRefresh));
        }