Esempio n. 1
0
        public RepairAddViewModel(
            IArchitecturesManager architecturesManager,
            IRestorationsManager restorationsManager,
            IRepairsManager repairsManager)
        {
            _architecturesManager = architecturesManager;
            _restorationsManager  = restorationsManager;
            _repairsManager       = repairsManager;

            _customNavigationService = ServiceLocator.Current.GetInstance <ICustomNavigationService>("RepairInternal");

            _repair = _customNavigationService.CurrentPageParams as RepairModel;

            _isAddingMode = _repair == null;

            SaveCommand = _isAddingMode
                ? new RelayCommand(AddRepair)
                : new RelayCommand(UpdateRepair);

            ActionText = _isAddingMode ? "Добавление" : "Редактирование";
            ButtonText = _isAddingMode ? "Добавить" : "Сохранить изменения";

            InitData();
            SetupFields();
        }
Esempio n. 2
0
        public RestorationMainViewModel(IRestorationsManager restorationsManager)
        {
            _restorationsManager = restorationsManager;

            _customNavigationService = ServiceLocator.Current.GetInstance <ICustomNavigationService>("RepairInternal");

            LoadData();
        }
Esempio n. 3
0
 static DbInitializer()
 {
     _architectsManager    = ServiceLocator.Current.GetInstance <IArchitectManager>();
     _architecturesManager = ServiceLocator.Current.GetInstance <IArchitecturesManager>();
     _repairsManager       = ServiceLocator.Current.GetInstance <IRepairsManager>();
     _restorationsManager  = ServiceLocator.Current.GetInstance <IRestorationsManager>();
     _sourcesManager       = ServiceLocator.Current.GetInstance <ISourcesManager>();
     _stylesManager        = ServiceLocator.Current.GetInstance <IStylesManager>();
 }
        public RepairAutomatisationViewModel(
            IArchitecturesManager architecturesManager,
            IRestorationsManager restorationsManager,
            IRepairsManager repairsManager)
        {
            _architecturesManager = architecturesManager;
            _restorationsManager  = restorationsManager;
            _repairsManager       = repairsManager;

            _customNavigationService = ServiceLocator.Current.GetInstance <ICustomNavigationService>("RepairInternal");

            LoadData();

            CalcAutomatisationCommand = new RelayCommand(CalcAutomatisation);
        }
Esempio n. 5
0
        public RestorationUpdateViewModel(IRestorationsManager restorationManager)
        {
            _restorationManager = restorationManager;

            _customNavigationService = ServiceLocator.Current.GetInstance <ICustomNavigationService>("RepairInternal");

            _restoration = _customNavigationService.CurrentPageParams as RestorationModel;

            SaveChangesCommand = new RelayCommand(async() => await UpdateRestoration());

            ActionText = "Редактирование";
            ButtonText = "Сохранить изменения";

            InitData();
            SetupFields();
        }