/// <summary>
        /// Initializes a new instance of the <see cref="NidaDrugQuestionnaireViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="commandFactory">The command factory.</param>
        public NidaDrugQuestionnaireViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IEventAggregator eventAggregator,
            ICommandFactory commandFactory)
            : base(userDialogService, asyncRequestDispatcherFactory, accessControlManager, eventAggregator, commandFactory)
        {
            _eventAggregator = eventAggregator;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService             = userDialogService;

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory);

            SaveCommand = commandFactoryHelper.BuildDelegateCommand <KeyedDataTransferObject> (
                () => SaveCommand,
                dto =>
            {
                var name = PropertyUtil.ExtractPropertyName(() => EditingDto);
                if (dto != null && EditingDto.GetType() != dto.GetType())
                {
                    name = EditingDto.GetType().GetProperties().First(pi => pi.PropertyType == dto.GetType()).Name;
                }
                return(name);
            },
                ExecuteSaveCommand,
                CanExecuteSaveCommand);

            var ruleExecutor = new NotifyPropertyChangedRuleExecutor <NidaDrugQuestionnaireViewModel, IDataTransferObject> ();

            ruleExecutor.AddRunAllRulesProperty(vm => vm.EditingDto);
            ruleExecutor.WatchSubject(this);
        }
        private void StartRuleWatch()
        {
            var ruleExecutor = new NotifyPropertyChangedRuleExecutor <EditMedicationViewModel, IDataTransferObject> ();

            ruleExecutor.AddRunAllRulesProperty(vm => vm.Medication);
            ruleExecutor.WatchSubject(this);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TedsAdmissionInterviewViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="commandFactory">The command factory.</param>
        public TedsAdmissionInterviewViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IEventAggregator eventAggregator,
            ICommandFactory commandFactory)
            : base(userDialogService, asyncRequestDispatcherFactory, accessControlManager, eventAggregator, commandFactory)
        {
            _userDialogService             = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            _primaryDetailedDrugCodeList   = new ObservableCollection <DetailedDrugCodeDto> ();
            _secondaryDetailedDrugCodeList = new ObservableCollection <DetailedDrugCodeDto> ();
            _tertiaryDetailedDrugCodeList  = new ObservableCollection <DetailedDrugCodeDto> ();

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory);

            RemoveSubstanceUsageCommand = commandFactoryHelper.BuildDelegateCommand <string> (
                () => RemoveSubstanceUsageCommand, ExecuteRemoveSubstanceUsage);

            var ruleExecutor = new NotifyPropertyChangedRuleExecutor <TedsAdmissionInterviewViewModel, IDataTransferObject>();

            ruleExecutor.AddRunAllRulesProperty(vm => vm.EditingDto);
            ruleExecutor.WatchSubject(this);
        }
Beispiel #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SaveMailAttachmentPatientDocumentViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="navigationService">The navigation service.</param>
        /// <param name="popupService">The popup service.</param>
        public SaveMailAttachmentPatientDocumentViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IEventAggregator eventAggregator,
            INavigationService navigationService,
            IPopupService popupService)
            : base(userDialogService, asyncRequestDispatcherFactory, accessControlManager, commandFactory)
        {
            _userDialogService             = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _eventAggregator   = eventAggregator;
            _navigationService = navigationService;
            _popupService      = popupService;

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory);

            CreatePatientImportDocumentCommand = commandFactoryHelper.BuildDelegateCommand(
                () => CreatePatientImportDocumentCommand, ExecuteCreatePatientImportDocumentCommand);

            var ruleExecutor = new NotifyPropertyChangedRuleExecutor <SaveMailAttachmentPatientDocumentViewModel, IDataTransferObject> ();

            ruleExecutor.AddRunAllRulesProperty(vm => vm.EditingDto);
            ruleExecutor.WatchSubject(this);
        }
Beispiel #5
0
        private void StartRuleWatch()
        {
            var ruleExecutor = new NotifyPropertyChangedRuleExecutor <ProgramOfferingEditorViewModel, IDataTransferObject> ();

            ruleExecutor.AddRunAllRulesProperty(vm => vm.EditingDto);
            ruleExecutor.IgnoreProperty(vm => vm.Programs);
            ruleExecutor.WatchSubject(this);
        }
Beispiel #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GpraInterviewViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="commandFactory">The command factory.</param>
        public GpraInterviewViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IEventAggregator eventAggregator,
            ICommandFactory commandFactory)
            : base(userDialogService, asyncRequestDispatcherFactory, accessControlManager, eventAggregator, commandFactory)
        {
            _userDialogService             = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            var ruleExecutor = new NotifyPropertyChangedRuleExecutor <GpraInterviewViewModel, IDataTransferObject> ();

            ruleExecutor.AddRunAllRulesProperty(vm => vm.EditingDto);
            ruleExecutor.WatchSubject(this);
        }
Beispiel #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AddSelfPaymentViewModel"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="currentUserContextService">The current user context service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="popupService">The popup service.</param>
        public AddSelfPaymentViewModel(
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            ICurrentUserContextService currentUserContextService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IPopupService popupService)
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService             = userDialogService;
            _popupService = popupService;
            currentUserContextService.RegisterForContext((cuc, b) => _currentStaffKey = cuc.Staff.Key);

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory);

            SaveCommand = commandFactoryHelper.BuildDelegateCommand(
                () => SaveCommand, () => SelfPayment, ExecuteSaveCommand);

            _ruleExecutor = new NotifyPropertyChangedRuleExecutor <AddSelfPaymentViewModel, IDataTransferObject>();
        }
Beispiel #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EditPayorCoverageViewModel"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="popupService">The popup service.</param>
        public EditPayorCoverageViewModel(
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IPopupService popupService)
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService             = userDialogService;
            _popupService = popupService;

            CreateCommand = NavigationCommandManager.BuildCommand(() => CreateCommand, OnNavigateToCreateCommand);
            EditCommand   = NavigationCommandManager.BuildCommand(() => EditCommand, OnNavigateToEditCommand);

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory);

            SaveCommand = commandFactoryHelper.BuildDelegateCommand(() => SaveCommand, ExecuteSaveCommand);

            _ruleExecutor = new NotifyPropertyChangedRuleExecutor <EditPayorCoverageViewModel, IDataTransferObject>();
        }
Beispiel #9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TedsDischargeInterviewViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="popupService">The popup service.</param>
        /// <param name="commandFactory">The command factory.</param>
        public TedsDischargeInterviewViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IEventAggregator eventAggregator,
            IPopupService popupService,
            ICommandFactory commandFactory)
            : base(userDialogService, asyncRequestDispatcherFactory, accessControlManager, eventAggregator, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService             = userDialogService;
            _popupService = popupService;

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory);

            ViewAdmissionCommand        = commandFactoryHelper.BuildDelegateCommand(() => ViewAdmissionCommand, ExecuteViewAdmissionCommand);
            RemoveSubstanceUsageCommand = commandFactoryHelper.BuildDelegateCommand <string>(
                () => RemoveSubstanceUsageCommand, ExecuteRemoveSubstanceUsage);

            var ruleExecutor = new NotifyPropertyChangedRuleExecutor <TedsDischargeInterviewViewModel, IDataTransferObject>();

            ruleExecutor.AddRunAllRulesProperty(vm => vm.EditingDto);
            ruleExecutor.WatchSubject(this);
        }
 private void StartRuleWatch()
 {
     var ruleExecutor = new NotifyPropertyChangedRuleExecutor<EditMedicationViewModel, IDataTransferObject> ();
     ruleExecutor.AddRunAllRulesProperty ( vm => vm.Medication );
     ruleExecutor.WatchSubject ( this );
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="AddSelfPaymentViewModel"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="currentUserContextService">The current user context service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="popupService">The popup service.</param>
        public AddSelfPaymentViewModel(
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            ICurrentUserContextService currentUserContextService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IPopupService popupService )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService = userDialogService;
            _popupService = popupService;
            currentUserContextService.RegisterForContext((cuc, b) => _currentStaffKey = cuc.Staff.Key);

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory);

            SaveCommand = commandFactoryHelper.BuildDelegateCommand(
                () => SaveCommand, () => SelfPayment, ExecuteSaveCommand);

            _ruleExecutor = new NotifyPropertyChangedRuleExecutor<AddSelfPaymentViewModel, IDataTransferObject>();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="EditPayorCoverageViewModel"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="popupService">The popup service.</param>
        public EditPayorCoverageViewModel(
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IPopupService popupService )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService = userDialogService;
            _popupService = popupService;

            CreateCommand = NavigationCommandManager.BuildCommand ( () => CreateCommand, OnNavigateToCreateCommand );
            EditCommand = NavigationCommandManager.BuildCommand ( () => EditCommand, OnNavigateToEditCommand );

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper ( this, commandFactory );

            SaveCommand = commandFactoryHelper.BuildDelegateCommand(() => SaveCommand, ExecuteSaveCommand);

            _ruleExecutor = new NotifyPropertyChangedRuleExecutor<EditPayorCoverageViewModel, IDataTransferObject>();
        }