Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BillingModule"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="container">The container.</param>
        /// <param name="regionManager">The region manager.</param>
        /// <param name="currentUserContextService">The current user context service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        public BillingModule(
            IAccessControlManager accessControlManager,
            IUnityContainer container,
            IRegionManager regionManager,
            ICurrentUserContextService currentUserContextService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IEventAggregator eventAggregator)
        {
            _accessControlManager          = accessControlManager;
            _container                     = container;
            _regionManager                 = regionManager;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _eventAggregator               = eventAggregator;

            //This is temporary until the main navigation dropdown is fixed
            currentUserContextService.RegisterForContext(
                (u, b) =>
            {
                if (u != null)
                {
                    _agencyKey = u.Agency.Key;
                    HandleCheckBillingOffice();
                }
            },
                true);
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SendC32ViewModel"/> 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="popupService">The popup service.</param>
        /// <param name="currentUserContextService">The current user context service.</param>
        public SendC32ViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IEventAggregator eventAggregator,
            IPopupService popupService,
            ICurrentUserContextService currentUserContextService )
            : base(accessControlManager, commandFactory)
        {
            _userDialogService = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _eventAggregator = eventAggregator;
            _popupService = popupService;

            currentUserContextService.RegisterForContext ( ( cuc, b ) => _currentContext = cuc );

            // UI Commands
            SendC32Command = CommandFactoryHelper
                .CreateHelper ( this, commandFactory )
                .BuildDelegateCommand ( () => SendC32Command, ExecuteSendC32 );

            OpenAddressBookCommand = CommandFactoryHelper
                .CreateHelper ( this, commandFactory )
                .BuildDelegateCommand ( () => OpenAddressBookCommand, ExecuteOpenAddressBook );

            // Navigation Commands

            OpenSendC32ViewCommand = NavigationCommandManager.BuildCommand ( () => OpenSendC32ViewCommand, NavigateToOpenSendC32ViewCommand );

            _eventAggregator.GetEvent<DirectAddressRecipientSelectedEvent> ().Subscribe ( HandleDirectAddressRecipientSelectedEventHandler );
        }
Beispiel #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BillingModule"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="container">The container.</param>
        /// <param name="regionManager">The region manager.</param>
        /// <param name="currentUserContextService">The current user context service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        public BillingModule(
            IAccessControlManager accessControlManager,
            IUnityContainer container,
            IRegionManager regionManager,
            ICurrentUserContextService currentUserContextService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IEventAggregator eventAggregator )
        {
            _accessControlManager = accessControlManager;
            _container = container;
            _regionManager = regionManager;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _eventAggregator = eventAggregator;

            //This is temporary until the main navigation dropdown is fixed
            currentUserContextService.RegisterForContext (
                ( u, b ) =>
                    {
                        if ( u != null )
                        {
                            _agencyKey = u.Agency.Key;
                            HandleCheckBillingOffice ();
                        }
                    },
                true );
        }
Beispiel #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SendC32ViewModel"/> 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="popupService">The popup service.</param>
        /// <param name="currentUserContextService">The current user context service.</param>
        public SendC32ViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IEventAggregator eventAggregator,
            IPopupService popupService,
            ICurrentUserContextService currentUserContextService)
            : base(accessControlManager, commandFactory)
        {
            _userDialogService             = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _eventAggregator = eventAggregator;
            _popupService    = popupService;

            currentUserContextService.RegisterForContext((cuc, b) => _currentContext = cuc);

            // UI Commands
            SendC32Command = CommandFactoryHelper
                             .CreateHelper(this, commandFactory)
                             .BuildDelegateCommand(() => SendC32Command, ExecuteSendC32);

            OpenAddressBookCommand = CommandFactoryHelper
                                     .CreateHelper(this, commandFactory)
                                     .BuildDelegateCommand(() => OpenAddressBookCommand, ExecuteOpenAddressBook);

            // Navigation Commands

            OpenSendC32ViewCommand = NavigationCommandManager.BuildCommand(() => OpenSendC32ViewCommand, NavigateToOpenSendC32ViewCommand);

            _eventAggregator.GetEvent <DirectAddressRecipientSelectedEvent> ().Subscribe(HandleDirectAddressRecipientSelectedEventHandler);
        }
Beispiel #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PatientAccessService"/> class.
        /// </summary>
        /// <param name="currentUserContextService">The current user context service.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        public PatientAccessService(
            ICurrentUserContextService currentUserContextService,
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory)
        {
            _userDialogService             = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            currentUserContextService.RegisterForContext(CurrentUserContextChanged);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PatientAccessService"/> class.
        /// </summary>
        /// <param name="currentUserContextService">The current user context service.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        public PatientAccessService(
            ICurrentUserContextService currentUserContextService,
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory )
        {
            _userDialogService = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            currentUserContextService.RegisterForContext ( CurrentUserContextChanged );
        }
Beispiel #7
0
        //TODO: DI IUserContextProvider

        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="UserContextControllerBase"/> class.
        /// </summary>
        /// <param name="currentUserContextService">The current user context service.</param>
        protected UserContextControllerBase(ICurrentUserContextService currentUserContextService)
        {
            currentUserContextService.RegisterForContext(
                (c, b) =>
            {
                if (c != null)
                {
                    StaffContext    = c.Staff;
                    AgencyContext   = c.Agency;
                    LocationContext = c.Location;

                    ViewBag.StaffContext    = StaffContext;
                    ViewBag.AgencyContext   = AgencyContext;
                    ViewBag.LocationContext = LocationContext;
                }
            },
                true);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="UserContextControllerBase"/> class.
        /// </summary>
        /// <param name="currentUserContextService">The current user context service.</param>
        protected UserContextControllerBase( ICurrentUserContextService currentUserContextService )
        {
            currentUserContextService.RegisterForContext (
                ( c, b ) =>
                    {
                        if ( c != null )
                        {
                            StaffContext = c.Staff;
                            AgencyContext = c.Agency;
                            LocationContext = c.Location;

                            ViewBag.StaffContext = StaffContext;
                            ViewBag.AgencyContext = AgencyContext;
                            ViewBag.LocationContext = LocationContext;
                        }
                    },
                true );
        }
        /// <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 #10
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>();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateBillingOfficeViewModel"/> 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="navigationService">The navigation service.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="popupService">The popup service.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        public CreateBillingOfficeViewModel(
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            ICurrentUserContextService currentUserContextService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            INavigationService navigationService,
            IUserDialogService userDialogService,
            IPopupService popupService,
            IEventAggregator eventAggregator )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _navigationService = navigationService;
            _userDialogService = userDialogService;
            _popupService = popupService;
            _eventAggregator = eventAggregator;
            currentUserContextService.RegisterForContext ( ( u, b ) => { _currentStaff = u.Staff; } );

            var commandFactoryHelper = CreateCommandFactoryHelper ( commandFactory );
            CreateCommand = commandFactoryHelper.BuildDelegateCommand ( () => CreateCommand, ExecuteCreateCommand );
        }
Beispiel #12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateBillingOfficeViewModel"/> 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="navigationService">The navigation service.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="popupService">The popup service.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        public CreateBillingOfficeViewModel(
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            ICurrentUserContextService currentUserContextService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            INavigationService navigationService,
            IUserDialogService userDialogService,
            IPopupService popupService,
            IEventAggregator eventAggregator)
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _navigationService             = navigationService;
            _userDialogService             = userDialogService;
            _popupService    = popupService;
            _eventAggregator = eventAggregator;
            currentUserContextService.RegisterForContext((u, b) => { _currentStaff = u.Staff; });

            var commandFactoryHelper = CreateCommandFactoryHelper(commandFactory);

            CreateCommand = commandFactoryHelper.BuildDelegateCommand(() => CreateCommand, ExecuteCreateCommand);
        }
        public LoginInformationViewModel(
            IAccessControlManager accessControlManager,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            ICurrentUserContextService currentUserContextService,
            IEventAggregator eventAggregator,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService = userDialogService;
            _currentUserContextService = currentUserContextService;

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

            SelectedLocationChangedCommand = commandFactoryHelper.BuildDelegateCommand<LocationDisplayNameDto> (
                () => SelectedLocationChangedCommand, ExecuteSelectedLocationChangedCommand );

            eventAggregator.GetEvent<StaffChangedEvent> ().Subscribe ( OnStaffChanged, ThreadOption.PublisherThread, false, FilterStaffChanged );

            ApplyContextChanges = true;
            ContextChanged += OnContextChanged;
            UpdateProperties ();
        }
        public LoginInformationViewModel(
            IAccessControlManager accessControlManager,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            ICurrentUserContextService currentUserContextService,
            IEventAggregator eventAggregator,
            ICommandFactory commandFactory)
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService             = userDialogService;
            _currentUserContextService     = currentUserContextService;

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

            SelectedLocationChangedCommand = commandFactoryHelper.BuildDelegateCommand <LocationDisplayNameDto> (
                () => SelectedLocationChangedCommand, ExecuteSelectedLocationChangedCommand);

            eventAggregator.GetEvent <StaffChangedEvent> ().Subscribe(OnStaffChanged, ThreadOption.PublisherThread, false, FilterStaffChanged);

            ApplyContextChanges = true;
            ContextChanged     += OnContextChanged;
            UpdateProperties();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PatientDashboardController"/> class.
 /// </summary>
 /// <param name="currentUserContextService">The current user context service.</param>
 /// <param name="requestDispatcherFactory">The request dispatcher factory.</param>
 public PatientDashboardController(ICurrentUserContextService currentUserContextService, IRequestDispatcherFactory requestDispatcherFactory)
     : base(currentUserContextService)
 {
     _requestDispatcherFactory = requestDispatcherFactory;
 }
Beispiel #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HomeController"/> class.
 /// </summary>
 /// <param name="currentUserContextService">The current user context service.</param>
 /// <param name="requestDispatcherFactory">The request dispatcher factory.</param>
 public HomeController(ICurrentUserContextService currentUserContextService, IRequestDispatcherFactory requestDispatcherFactory)
     : base(currentUserContextService)
 {
     _requestDispatcherFactory = requestDispatcherFactory;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PatientDashboardController"/> class.
 /// </summary>
 /// <param name="currentUserContextService">The current user context service.</param>
 /// <param name="requestDispatcherFactory">The request dispatcher factory.</param>
 public PatientDashboardController( ICurrentUserContextService currentUserContextService, IRequestDispatcherFactory requestDispatcherFactory )
     : base(currentUserContextService)
 {
     _requestDispatcherFactory = requestDispatcherFactory;
 }
Beispiel #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HomeController"/> class.
 /// </summary>
 /// <param name="currentUserContextService">The current user context service.</param>
 /// <param name="requestDispatcherFactory">The request dispatcher factory.</param>
 public HomeController( ICurrentUserContextService currentUserContextService, IRequestDispatcherFactory requestDispatcherFactory )
     : base(currentUserContextService)
 {
     _requestDispatcherFactory = requestDispatcherFactory;
 }