Ejemplo n.º 1
0
        public void Should_Show_Assist_ContactsMagnifier()
        {
            // arrange
            IInteractionRequestController service             = _unityContainer.Resolve <IInteractionRequestController>();
            AssistMockViewModel           assistMockViewModel = new AssistMockViewModel(_eventManager.Object,
                                                                                        _configurationService.Object,
                                                                                        _dataServices.Object,
                                                                                        _dialogService.Object,
                                                                                        _regionManager.Object,
                                                                                        service);

            Assert.NotNull(assistMockViewModel.LaunchContact);

            IList <ContactsDto> contactsDto = new List <ContactsDto>()
            {
                new ContactsDto()
                {
                    ContactId = "100", ContactName = "Alex"
                },
                new ContactsDto()
                {
                    ContactId = "200", ContactName = "Madrid"
                }
            };

            assistMockViewModel.LaunchBranches.Execute(contactsDto);

            ContactsDto contactDto = assistMockViewModel.SelectedContact;

            // assert
            Assert.True(contactsDto.Contains(contactDto));
        }
Ejemplo n.º 2
0
        public void Should_Show_Assist_ProvinceMagnifier()
        {
            // arrange
            IInteractionRequestController controller          = _unityContainer.Resolve <IInteractionRequestController>();
            AssistMockViewModel           assistMockViewModel = new AssistMockViewModel(_eventManager.Object,
                                                                                        _configurationService.Object,
                                                                                        _dataServices.Object,
                                                                                        _dialogService.Object,
                                                                                        _regionManager.Object,
                                                                                        controller);

            Assert.NotNull(assistMockViewModel.SelectedProvince);
            IList <ProvinciaDto> provinciaDto = new List <ProvinciaDto>()
            {
                new ProvinciaDto()
                {
                    Code = "192", Name = "Barcelona"
                },
                new ProvinciaDto()
                {
                    Code = "200", Name = "Madrid"
                }
            };

            // act
            assistMockViewModel.LaunchBranches.Execute(provinciaDto);
            ProvinciaDto provinceDto = assistMockViewModel.SelectedProvince;

            // assert
            Assert.True(provinciaDto.Contains(provinceDto));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Office Info view model.
        /// </summary>
        /// <param name="eventManager">Event manager</param>
        /// <param name="configurationService">Configuration service</param>
        /// <param name="dataServices">Data services</param>
        /// <param name="dialogService">Dialog services</param>
        /// <param name="container">Unity Manager</param>
        /// <param name="manager">Region Manager</param>
        /// <param name="requestController">Request controller</param>

        public OfficeInfoViewModel(IEventManager eventManager, IConfigurationService configurationService,
                                   IDataServices dataServices,
                                   IDialogService dialogService,
                                   IUnityContainer container,
                                   IRegionManager manager,
                                   IInteractionRequestController requestController) : base(eventManager, configurationService, dataServices, dialogService, manager, requestController)
        {
            _assistDataService = dataServices.GetAssistDataServices();
            _officeDataService = dataServices.GetOfficeDataServices();
            _newOfficeCommand  = new DelegateCommand(OnNewOffice);
            _newOfficeSave     = new DelegateCommand(OnSaveOffice);
            _provinciaDto      = new System.Collections.ObjectModel.ObservableCollection <ProvinciaDto>();
            _openDays          = new System.Collections.ObjectModel.ObservableCollection <DailyTime>();
            _currentHolidays   = new Dictionary <DateTime, HolidayDto>();
            _currentPartOfDay  = null;

            AssistMapper       = _assistDataService.Mapper;
            AssistCommand      = new DelegateCommand <object>(OnAssistCommand);
            ItemChangedCommand = new DelegateCommand <object>(OnChangedField);
            AssistExecuted    += OfficeAssistResult;
            DataObject         = new OfficeDtos();
            DateTime dt = DateTime.Now;

            ProvinciaDto           = _provinciaDto;
            CurrentYear            = dt.Year.ToString();
            ViewModelUri           = new Uri("karve://office/viewmodel?id=" + Guid.ToString());
            TimePickerSaveCommand  = new DelegateCommand <object>(OnPickerSaveCommand);
            TimePickerResetCommand = new DelegateCommand <object>(OnPickerResetCommand);
            SelectedDaysCommand    = new DelegateCommand <object>(OnSelectedDaysCommand);
            PartOfDaySelection     = new DelegateCommand <object>(OnPartOfDaySelection);
            EventManager.RegisterObserverSubsystem(MasterModuleConstants.OfficeSubSytemName, this);
            ActiveSubSystem();
        }
Ejemplo n.º 4
0
        /// <summary>
        ///  ClientsInfoViewModel constructor.
        /// </summary>
        /// <param name="eventManager">Event manager</param>
        /// <param name="configurationService">Configuration service</param>
        /// <param name="dataServices">Data Service</param>
        /// <param name="manager">Region Manager</param>
        public ClientsInfoViewModel(IEventManager eventManager,
                                    IConfigurationService configurationService,
                                    IDataServices dataServices,
                                    IDialogService dialogService,
                                    IRegionManager manager,
                                    IInteractionRequestController controller) : base(eventManager, configurationService, dataServices, dialogService, manager, controller)
        {
            base.ConfigureAssist();

            ConfigurationService = configurationService;
            MailBoxHandler      += MessageHandler;
            IsVisible            = Visibility.Collapsed;
            EventManager.RegisterObserverSubsystem(MasterModuleConstants.ClientSubSystemName, this);
            InitVmCommands();
            ClientInfoRightRegionName = CreateNameRegion("RightRegion");
            DriverZoneRegionName      = CreateNameRegion("DriverZoneRegion");
            StateVisible           = true;
            _onBranchesPrimaryKey += ClientOnBranchesPrimaryKey;
            _onContactsPrimaryKey += ClientOnContactsPrimaryKey;
            _clientDataServices    = dataServices.GetClientDataServices();
            _clientData            = _clientDataServices.GetNewDo("0");
            eventHandler          += OnDriverUpdate;
            DefaultPageSize        = 50;
            ViewModelUri           = new Uri("karve://client/viewmodel?id=" + Guid.ToString());
            ActiveSubSystem();
            _initialized = false;
        }
        /// <summary>
        ///  Constructor.
        /// </summary>
        /// <param name="services">Data service for data retrieving</param>
        /// <param name="controller">Interaction controller for showing popup</param>
        /// <param name="dialogService">Error message dialog controller</param>
        /// <param name="unityContainer"></param>
        /// <param name="eventManager"></param>
        /// <param name="navigation"></param>
        /// <param name="configurationService"></param>
        /// <param name="regionManager"></param>
        public BookingIncidentInfoViewModel(IDataServices services, IInteractionRequestController controller,
                                            IDialogService dialogService,
                                            IUnityContainer unityContainer,
                                            IEventManager eventManager,
                                            IKarveNavigator navigation,
                                            IConfigurationService configurationService,
                                            IRegionManager regionManager) : base(services, controller, dialogService, eventManager, regionManager, configurationService)
        {
            AssistCommand      = new DelegateCommand <object>(OnAssistCommand);
            ItemChangedCommand = new DelegateCommand <object>(OnChangedField);

            SubSystem = DataSubSystem.BookingSubsystem;

            ViewModelUri            = new Uri("karve://booking/incident/show/viewmodel?id=" + Guid.ToString());
            _unityContainer         = unityContainer;
            _navigator              = navigation;
            _userSettings           = configurationService.UserSettings;
            _deleteCommand          = new DelegateCommand <object>(DeleteViewCommand);
            _saveCommand            = new DelegateCommand <object>(SaveViewCommand);
            _newCommand             = new DelegateCommand <object>(NewViewCommand);
            _dataIncidentService    = services.GetBookingIncidentDataService();
            _assistDataService      = services.GetAssistDataServices();
            _unityContainer         = unityContainer;
            CompositeCommandOnly    = true;
            VehicleColumns          = "Code,Brand,Model,Matricula,VehicleGroup,Situation,Office,Places,CubeMeters,Activity,Owner";
            ClientsConductorColumns = "Code,Name,Nif,Phone,Movil,Email,Card,ReplacementCar,Zip,City,CreditCardType,NumberCreditCard, PaymentForm,AccountableAccount,Sector,Zona,Origin,Office,Falta,BirthDate,DrivingLicence";
            AssistMapper            = _assistDataService.Mapper;
            EventManager.RegisterObserverSubsystem(BookingModule.GroupBookingIncident, this);
            EventManager.RegisterObserverSubsystem(BookingModule.BookingSubSystem, this);
        }
Ejemplo n.º 6
0
        public ReservationRequestsViewModel(IDataServices services, IInteractionRequestController controller, IDialogService dialogService, IEventManager eventManager, IKarveNavigator navigation, IConfigurationService configurationService, IRegionManager regionManager) : base(services, controller, dialogService, eventManager, regionManager)
        {
            AssistCommand          = new DelegateCommand <object>(OnAssistCommand);
            ItemChangedCommand     = new DelegateCommand <object>(OnChangedField);
            CreateNewClient        = new DelegateCommand(NewClient);
            CreateNewGroup         = new DelegateCommand(NewGroup);
            CreateNewRequestReason = new DelegateCommand(NewRequestReason);
            CreateNewReseller      = new DelegateCommand(NewReseller);
            CreateNewFare          = new DelegateCommand(NewFare);
            CreateNewVehicle       = new DelegateCommand(NewVehicle);
            CreateNewOrigen        = new DelegateCommand(NewOrigin);
            SubSystem = DataSubSystem.BookingSubsystem;

            ViewModelUri            = new Uri("karve://booking/request/viewmodel?id=" + Guid.ToString());
            _navigator              = navigation;
            _helperViewFactory      = _navigator.GetHelperViewFactory();
            _userSettings           = configurationService.GetUserSettings();
            _deleteCommand          = new DelegateCommand <object>(this.DeleteViewCommand);
            _saveCommand            = new DelegateCommand <object>(SaveViewCommand);
            _dataReservationService = services.GetReservationRequestDataService();
            _assistDataService      = services.GetAssistDataServices();
            AssistMapper            = _assistDataService.Mapper;
            CompositeCommandOnly    = true;
            VehicleGridColumns      = _userSettings.FindSetting <string>(UserSettingConstants.VehicleSummaryGridColumnsKey);
            EventManager.RegisterObserverSubsystem("ReservationRequests", this);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// KarveViewModelBase. Base view model of the all structure
        /// </summary>
        /// <param name="services">DataServices to be used.</param>
        public KarveViewModelBase(IDataServices services, IInteractionRequestController requestController) :
            this(services)
        {
            DataServices = services;
            Controller   = requestController;

            HelperDataServices = services.GetHelperDataServices();
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Fare info view model
 /// </summary>
 /// <param name="eventManager">Event manager</param>
 /// <param name="configurationService">Configuration services</param>
 /// <param name="dataServices">Data Services</param>
 /// <param name="dialogService">Dialog services</param>
 /// <param name="assistService">Assist services</param>
 /// <param name="manager">Region manager</param>
 public FaresInfoViewModel(IEventManager eventManager,
                           IConfigurationService configurationService,
                           IDataServices dataServices,
                           IDialogService dialogService,
                           IRegionManager manager,
                           IInteractionRequestController controller) : base(eventManager, configurationService, dataServices, dialogService, manager, controller)
 {
     ConfigureAssist();
 }
Ejemplo n.º 9
0
 /// <summary>
 /// KarveViewModelBase. Configuration service.
 /// </summary>
 /// <param name="services"></param>
 /// <param name="requestController"></param>
 /// <param name="configurationService"></param>
 public KarveViewModelBase(IDataServices services, IInteractionRequestController requestController, IConfigurationService configurationService) :
     this(services)
 {
     DataServices         = services;
     Controller           = requestController;
     ConfigurationService = configurationService;
     HelperDataServices   = services.GetHelperDataServices();
     InitConfiguration(ConfigurationService);
 }
Ejemplo n.º 10
0
 /// <summary>
 ///  KarveControlViewModel. Base view model for all the control view models.
 /// </summary>
 /// <param name="services">Services</param>
 /// <param name="requestController">Request controller</param>
 /// <param name="dialogService">Dialog service</param>
 /// <param name="eventManager">Event manager</param>
 protected KarveControlViewModel(
     IConfigurationService configurationService,
     IDataServices services,
     IInteractionRequestController requestController,
     IDialogService dialogService,
     IEventManager eventManager) : base(services, requestController, dialogService,
                                        eventManager, configurationService)
 {
     PagingEvent += OnPagedEvent;
 }
Ejemplo n.º 11
0
 public AssistMockViewModel(IEventManager eventManager,
                            IConfigurationService configurationService,
                            IDataServices dataServices,
                            IDialogService dialogService,
                            IRegionManager regionManager,
                            IInteractionRequestController controller) : base(eventManager, configurationService,
                                                                             dataServices, dialogService, regionManager, controller)
 {
     LaunchContact  = new DelegateCommand(OnContactChargeAssist);
     LaunchBranches = new DelegateCommand(OnProvinceAssist);
 }
Ejemplo n.º 12
0
 protected HeaderedLineViewModelBase(IDataServices dataServices,
                                     IDialogService dialogServices,
                                     IEventManager manager,
                                     IRegionManager regionManager,
                                     IIdentifier identifier,
                                     IInteractionRequestController controller) : base(dataServices, controller, dialogServices, manager)
 {
     RegionManager       = regionManager;
     IdentifierGenerator = identifier;
     AssistDataService   = DataServices.GetAssistDataServices();
     LineVisible         = true;
     FooterVisible       = true;
 }
Ejemplo n.º 13
0
 public UsersControlViewModel(IDataServices services,
                              IInteractionRequestController requestController,
                              IDialogService dialogService,
                              IRegionManager manager,
                              IEventManager eventManager) : base(services, requestController, dialogService, eventManager)
 {
     _incidentService = services.GetUsersDataService();
     _regionManager   = manager;
     ItemName         = Usuarios;
     DefaultPageSize  = 50;
     ViewModelUri     = new Uri("user/viewmodel?id=" + UniqueId);
     InitViewModel();
 }
 public BookingIncidentControlViewModel(IDataServices services,
                                        IConfigurationService configurationService,
                                        IInteractionRequestController requestController,
                                        IDialogService dialogService,
                                        IRegionManager manager,
                                        IEventManager eventManager) : base(configurationService, services, requestController, dialogService, eventManager)
 {
     _incidentService = services.GetBookingIncidentDataService();
     _regionManager   = manager;
     ItemName         = "Incidencias";
     DefaultPageSize  = 50;
     ViewModelUri     = new Uri("karve://booking/incident/viewmodel?id=" + UniqueId);
     InitViewModel();
 }
Ejemplo n.º 15
0
 /// <summary>
 /// The MasterInfoViewModuleBase is a view model that overrides no requested operation in the InfoViewModels.
 /// </summary>
 /// <param name="eventManager">Event Manager.
 ///     It allows the communication throu viewmodel</param>
 /// <param name="configurationService">Configuration Service. It allows the reconfiguration of the view model</param>
 /// <param name="dataServices">DataServices. It allows to fetch the data.</param>
 /// <param name="dialogService">DialogService. It allows spotting the error.</param>
 /// <param name="controller">Interaction Request Contriller. I
 /// It allows the controller to</param>
 /// <param name="manager">RegionManager. It handles the region manager.</param>
 protected MasterInfoViewModuleBase(IEventManager eventManager,
                                    IConfigurationService configurationService,
                                    IDataServices dataServices,
                                    IDialogService dialogService,
                                    IRegionManager manager,
                                    IInteractionRequestController controller) : base(configurationService, eventManager, dataServices, dialogService, manager, controller)
 {
     _canDelete = true;
     DelegationProvinceMagnifierCommand = new DelegateCommand <object>(OnProvinceAssist);
     ContactChargeMagnifierCommand      = new DelegateCommand <object>(OnContactChargeAssist);
     ClientMagnifierCommand             = new DelegateCommand <object>(OnClientMagnifier);
     ResellerMagnifierCommand           = new DelegateCommand <object>(OnResellerMagnifier);
     ContactMagnifierCommand            = new DelegateCommand <object>(OnContactMagnifier);
 }
Ejemplo n.º 16
0
        public ReservationRequestControlViewModel(IDataServices services,
                                                  IInteractionRequestController requestController,
                                                  IDialogService dialogService,
                                                  IRegionManager manager,
                                                  IEventManager eventManager) : base(services, requestController, dialogService, eventManager)
        {
            _reservationRequestDataService = services.GetReservationRequestDataService();
            _regionManager  = manager;
            ItemName        = "Peticiones de Reserva";
            DefaultPageSize = 50;

            DirectSubsystem = "ReservationRequests";
            ViewModelUri    = new Uri("karve://booking/request/viewmodel?id=" + UniqueId);
            InitViewModel();
        }
 public ReservationRequestsViewModel(IDataServices services, IInteractionRequestController controller, IDialogService dialogService, IEventManager eventManager, IKarveNavigator navigation, IConfigurationService configurationService, IRegionManager regionManager, IUnityContainer unityContainer) : base(services, controller, dialogService, eventManager, regionManager, configurationService)
 {
     InitServices(services, configurationService);
     InitCommands();
     InitCrudCommands();
     SubSystem            = DataSubSystem.BookingSubsystem;
     ViewModelUri         = new Uri("karve://booking/request/viewmodel?id=" + Guid.ToString());
     _navigator           = navigation;
     _container           = unityContainer;
     _helperViewFactory   = _navigator.GetHelperViewFactory();
     AssistMapper         = _assistDataService.Mapper;
     CompositeCommandOnly = true;
     VehicleGridColumns   = _userSettings.FindSetting <string>(UserSettingConstants.VehicleSummaryGridColumnsKey);
     EventManager.RegisterObserverSubsystem(BookingModule.RequestGroup, this);
 }
Ejemplo n.º 18
0
 /// <summary>
 /// ProviderInfoViewModel.
 /// </summary>
 /// <param name="eventManager"></param>
 /// <param name="configurationService"></param>
 /// <param name="dataServices"></param>
 /// <param name="dialogService"></param>
 /// <param name="manager"></param>
 /// <param name="controller"></param>
 public ProviderInfoViewModel(IEventManager eventManager, IConfigurationService configurationService,
                              IDataServices dataServices, IDialogService dialogService,
                              IRegionManager manager, IInteractionRequestController controller) : base(eventManager, configurationService, dataServices, dialogService, manager, controller)
 {
     ConfigurationService = configurationService;
     MailBoxHandler      += MessageHandler;
     AccountAssistQuery   = _accountAssistQuery;
     EventManager.RegisterObserverSubsystem(MasterModuleConstants.ProviderSubsystemName, this);
     // TODO: all the mapping shall be isolated.
     mapper = MapperField.GetMapper();
     _onBranchesPrimaryKey += ProviderInfoViewModel__onBranchesPrimaryKey;
     _onContactsPrimaryKey += ProviderInfoViewModel__onContactsPrimaryKey;
     _uniqueCounter++;
     _assistDataService = dataServices.GetAssistDataServices();
     SubSystem          = DataSubSystem.SupplierSubsystem;
     ViewModelUri       = new Uri("karve://supplier/viewmodel?id=" + Guid.ToString());
     InitVmCommands();
 }
Ejemplo n.º 19
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="eventManager"></param>
 /// <param name="configurationService"></param>
 /// <param name="dataServices"></param>
 /// <param name="dialogService"></param>
 /// <param name="manager"></param>
 /// <param name="controller"></param>
 public CompanyInfoViewModel(IEventManager eventManager, IConfigurationService configurationService, IDataServices dataServices,
                             IDialogService dialogService,
                             IRegionManager manager,
                             IInteractionRequestController controller) : base(eventManager, configurationService, dataServices, dialogService,
                                                                              manager, controller)
 {
     AssistCommand      = new DelegateCommand <object>(OnAssistCommand);
     ItemChangedCommand = new DelegateCommand <object>(OnChangedField);
     ShowOfficesCommand = new DelegateCommand <object>(ShowOffices);
     _newCommand        = new DelegateCommand(OnNewCommand);
     _assistDataService = dataServices.GetAssistDataServices();
     AssistMapper       = _assistDataService.Mapper;
     AssistExecuted    += CompanyAssistResult;
     EventManager.RegisterObserverSubsystem(MasterModuleConstants.CompanySubSystemName, this);
     ViewModelUri = new Uri("karve://company/viewmodel?id=" + Guid.ToString());
     ItemName     = "Empresa";
     ActiveSubSystem();
 }
Ejemplo n.º 20
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LoginViewModel"/> class.
        ///  Login view model.
        /// </summary>
        /// <param name="configurationService">
        /// System configuration service
        /// </param>
        /// <param name="services">
        /// Data services
        /// </param>
        /// <param name="assistService">
        /// Magnifier request answer
        /// </param>
        /// <param name="interactionRequestController">
        /// Interaction controller.
        /// </param>
        /// <param name="service">
        /// Authentication service
        /// </param>

        public LoginViewModel(IConfigurationService configurationService,
                              IDataServices services,
                              IAssistDataService assistService,
                              IInteractionRequestController interactionRequestController,
                              IAuthorizationService service)
        {
            InitializeViewModel();
            LoginCommand              = new DelegateCommand <object>(this.OnLogin);
            MagnifierCommand          = new DelegateCommand <object>(this.OnAssistCommand);
            ItemChangedCommand        = new DelegateCommand <object>(this.OnChanged);
            this.dataServices         = services;
            this.authService          = service;
            this.assistService        = assistService;
            this.AssistMapper         = assistService.Mapper;
            this.configurationService = configurationService;
            Salutation = string.Empty;
            DataObject = new UserViewObject();
            InitVisibleOffice();
        }
Ejemplo n.º 21
0
 /// <summary>
 /// Booking Control View Model. It is a view model that lauch other tabs through Prism.
 /// </summary>
 /// <param name="regionManager">Region manager for handling the new view navigation.</param>
 /// <param name="services">Data layer services for accessing to the data layer.</param>
 /// <param name="container">Container for resolving the view models.</param>
 /// <param name="requestController">Controller for opening dialogs.</param>
 /// <param name="dialogService">Dialog service for opening error dialogs.</param>
 /// <param name="eventManager">Communication to every view models.</param>
 public BookingControlViewModel(IRegionManager regionManager,
                                IDataServices services,
                                IUnityContainer container,
                                IInteractionRequestController requestController,
                                IDialogService dialogService,
                                IEventManager eventManager,
                                IKarveNavigator navigator) : base(services, requestController, dialogService, eventManager)
 {
     _bookingDataService = DataServices.GetBookingDataService();
     _navigator          = navigator;
     _regionManager      = regionManager;
     _container          = container;
     // set the name to the listing grid.
     ItemName         = "Reservas";
     DefaultPageSize  = 50;
     _counterInterval = 0;
     CancelBook       = new DelegateCommand <object>(OnCancelBook);
     ViewModelUri     = new Uri("karve://booking/viewmodel?id=" + UniqueId);
     InitViewModel();
 }
Ejemplo n.º 22
0
 /// <summary>
 ///     Control the invoce control view model.
 /// </summary>
 /// <param name="dataServices">Data Services</param>
 /// <param name="container">Unity container</param>
 /// <param name="service">Service</param>
 /// <param name="manager">Region Manager</param>
 /// <param name="requestService">Request service</param>
 /// <param name="eventManager">Event manager</param>
 public InvoiceControlViewModel(IDataServices dataServices,
                                IUnityContainer container,
                                IDialogService service,
                                IRegionManager manager,
                                IInteractionRequestController requestService,
                                IEventManager eventManager) : base(dataServices, requestService, service, eventManager)
 {
     _regionManager  = manager;
     IsBusy          = false;
     _container      = container;
     OpenItemCommand = new DelegateCommand <object>(OpenCurrentItem);
     InitViewModel();
     ItemName             = "Facturas";
     ShowClientCommand    = new DelegateCommand <object>(OnShowClient);
     _invoiceDataServices = DataServices.GetInvoiceDataServices();
     ViewModelUri         = new Uri("karve://invoice/viewmodel?id=" + UniqueId);
     MailboxName          = ViewModelUri.ToString();
     EventManager.RegisterObserverSubsystem(InvoiceModule.InvoiceSubSystem, this);
     RegisterMailBox(ViewModelUri.ToString());
     StartAndNotify();
 }
Ejemplo n.º 23
0
        protected HeaderedLineViewModelBase(IDataServices dataServices,
                                            IDialogService dialogServices,
                                            IEventManager manager,
                                            IRegionManager regionManager,
                                            IIdentifier identifier,
                                            IConfigurationService configurationService,
                                            IInteractionRequestController controller) : base(dataServices, controller, dialogServices, manager, configurationService)
        {
            RegionManager       = regionManager;
            IdentifierGenerator = identifier;
            AssistDataService   = DataServices.GetAssistDataServices();
            LineVisible         = true;
            FooterVisible       = true;

            /* This instruct the toolbar to skip its is own handlers. Avoiding complexity.
             * It will be just the view to save itself with composite command and to alert it subsystem.
             *  This with the SetRegistrationPayLoad set properly it will permit to save itself.
             *  Each view will save itself, like in this scenario:
             *  https://prismlibrary.github.io/docs/wpf/Advanced-MVVM.html
             * It is better that all headered window will use a composite command.
             */
            CompositeCommandOnly = true;
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Commision agent info view model.
        /// </summary>
        /// <param name="configurationService"></param>
        /// <param name="eventManager"></param>
        /// <param name="services"></param>
        /// <param name="dialogService"></param>
        /// <param name="regionManager"></param>
        /// <param name="controller"></param>
        public CommissionAgentInfoViewModel(IConfigurationService configurationService,
                                            IEventManager eventManager,
                                            IDataServices services,
                                            IDialogService dialogService,
                                            IRegionManager regionManager, IInteractionRequestController controller
                                            ) : base(eventManager,
                                                     configurationService,
                                                     services,
                                                     dialogService,

                                                     regionManager,
                                                     controller)
        {
            _queries    = new Dictionary <string, string>();
            _visibility = Visibility.Collapsed;
            _commissionAgentDataServices = DataServices.GetCommissionAgentDataServices();
            _regionManager         = regionManager;
            _onBranchesPrimaryKey += CommissionAgentInfoViewModel__onBranchesPrimaryKey;
            _onContactsPrimaryKey += CommissionAgentInfoViewModel__onContactsPrimaryKey;
            _onVisitPrimaryKey    += CommissionAgentInfoViewModel__onVisitPrimaryKey;
            IsVisible              = Visibility.Collapsed;
            AssistQueryDictionary  = new Dictionary <string, string>();
            PrimaryKeyValue        = string.Empty;
            ConfigurationService   = configurationService;
            InitEvents();
            InitCommands();
            ViewModelUri = new Uri("karve://broker/viewmodel?id=" + Guid.ToString());
            _mapper      = MapperField.GetMapper();
            EventManager.RegisterObserverSubsystem(MasterModuleConstants.CommissionAgentSystemName, this);
            // update the assist.
            UpdateAssist(ref _leftSideDualDfSearchBoxes);
            UpdateChangeCommand(ref _leftSideDualDfSearchBoxes);
            // register itself in the broacast.
            EventManager.RegisterObserver(this);
            _countTime = 0;
        }
Ejemplo n.º 25
0
 /// <summary>
 ///  Control view for the office
 /// </summary>
 /// <param name="configurationService">Configuration service</param>
 /// <param name="eventManager">Event manager</param>
 /// <param name="services">Data Services</param>
 /// <param name="regionManager">Region manager</param>
 ///
 public OfficesControlViewModel(IConfigurationService configurationService, IEventManager eventManager, IDataServices services, IInteractionRequestController interactionService, IDialogService dialogService, IRegionManager regionManager) :
     base(configurationService, eventManager, services, interactionService, dialogService, regionManager)
 {
     _officeDataServices = services.GetOfficeDataServices();
     ItemName            = "Oficinas";
     InitViewModel();
 }
Ejemplo n.º 26
0
        /// <summary>
        /// InvoiceInfoViewModel.
        /// </summary>
        /// <param name="dataServices">DataServices</param>
        /// <param name="dialogServices"></param>
        /// <param name="manager"></param>
        /// <param name="container"></param>
        /// <param name="regionManager"></param>
        /// <param name="controller"></param>

        public InvoiceInfoViewModel(IDataServices dataServices,
                                    IDialogService dialogServices,
                                    IEventManager manager,
                                    IConfigurationService configurationService,
                                    IRegionManager regionManager,
                                    IInteractionRequestController controller) : base(dataServices,
                                                                                     controller,
                                                                                     dialogServices,
                                                                                     manager, configurationService)
        {
            _dataServices       = dataServices;
            _regionManager      = regionManager;
            _invoiceDataService = _dataServices.GetInvoiceDataServices();
            LineVisible         = true;
            CollectionView      = new ObservableCollection <InvoiceSummaryViewObject>();
            AssistMapper        = _dataServices.GetAssistDataServices().Mapper;
            ItemChangedCommand  = new Prism.Commands.DelegateCommand <IDictionary <string, object> >(OnChangedCommand);
            NavigateCommand     = new DelegateCommand <object>(OnNavigate);
            AssistCommand       = new DelegateCommand <object>(OnAssistCommand);
            AddNewClientCommand = new DelegateCommand <object>(OnAddNewClientCommand);
            OpenContractCommand = new DelegateCommand <object>(OnOpenContract);
            OpenVehiclesCommand = new DelegateCommand <object>(OnOpenVehicles);

            AssistExecuted += OnAssistExecuted;
            CompanyName     = String.Empty;
            AddressName     = String.Empty;
            List <string> colList;
            var           genericInovice = new InvoiceSummaryViewObject();

            colList = genericInovice.GetType().GetProperties().Select(value => value.Name).ToList();

            GridColumns = new List <string>()
            {
                "AgreementCode", "VehicleCode", "Opciones", "Description", "Quantity", "Price", "Discount", "Subtotal",
                "Unity", "Iva"
            };

            /*
             * This is a cell grid presentation item
             */
            var presenter = new ObservableCollection <CellPresenterItem>()
            {
                new NavigationAwareItem()
                {
                    DataTemplateName = "NavigateInvoiceItem", MappingName = "AgreementCode", RegionName = RegionNames.LineRegion
                },
                new NavigationAwareItem()
                {
                    DataTemplateName = "NavigateVehicleItem", MappingName = "VehicleCode", RegionName = RegionNames.LineRegion
                }
            };

            CellGridPresentation = presenter;
            EventManager.RegisterObserverSubsystem(InvoiceModule.InvoiceSubSystem, this);
            var gid = Guid.NewGuid();

            GridIdentifier  = GridIdentifiers.InvoiceLineGrids;
            ViewModelUri    = new Uri("karve://invoice/viewmodel?id=" + gid.ToString());
            MailBoxHandler += IncomingMailBox;
            SubSystem       = DataSubSystem.InvoiceSubsystem;
            RegisterMailBox(ViewModelUri.ToString());
        }
Ejemplo n.º 27
0
        /// <summary>
        ///  Constructor
        /// </summary>
        /// <param name="configurationService">This is the configurartion service</param>
        /// <param name="eventManager"> The event manager for sending/recieving messages from the view model</param>
        /// <param name="dialogService"></param>
        /// <param name="services">Data access layer interface</param>
        public VehicleInfoViewModel(IConfigurationService configurationService, IEventManager eventManager,
                                    IDialogService dialogService,
                                    IDataServices services, IRegionManager regionManager, IInteractionRequestController requestController) :
            base(eventManager, configurationService, services, dialogService, regionManager, requestController)
        {
            // by default is not initialized until it comes to Init completed.
            IsViewModelInitialized = false;
            SubSystem             = DataSubSystem.VehicleSubsystem;
            MailBoxHandler       += MessageHandler;
            _vehicleDataServices  = services.GetVehicleDataServices();
            _assistDataService    = services.GetAssistDataServices();
            ItemChangedCommand    = new DelegateCommand <object>(ChangeUnpack);
            MetaDataObject        = InitAssuranceObject();
            DataFieldCollection   = InitDataField();
            RevisionObject        = InitRevisionComposedFieldObjects();
            MaintenanceCollection = _maintenaince;
            _regionManager        = regionManager;
            _deleteEventHandler  += DeleteEventHandler;
            EventManager.RegisterObserverSubsystem(MasterModuleConstants.VehiclesSystemName, this);
            AssistCommand      = new DelegateCommand <object>(AssistCommandHelper);
            _queryStoreFactory = new QueryStoreFactory();
            _saveCommand       = new DelegateCommand <object>(OnSaveCommand);
            var gid = Guid.NewGuid();

            ViewModelUri = new Uri("karve://vehicle/viewmodel?id=" + gid.ToString());

            ActiveSubSystem();
        }
Ejemplo n.º 28
0
 public KarveRoutingBaseViewModel(IDataServices services, IInteractionRequestController controller, IDialogService dialogService, IEventManager eventManager, IRegionManager regionManager, IConfigurationService service) : this(services, controller, dialogService, eventManager, service)
 {
     RegionManager = regionManager;
 }
Ejemplo n.º 29
0
 /// <summary>
 /// Karve Routing View Model Constructor.
 /// </summary>
 /// <param name="services">Data Services. They enable data retrieving.</param>
 /// <param name="assistService">Interaction controller. It enables modal view that shows an incremental grid of data.</param>
 public KarveRoutingBaseViewModel(IDataServices services, IInteractionRequestController interactionRequest, IConfigurationService configurationService) : base(services, interactionRequest, configurationService)
 {
 }
Ejemplo n.º 30
0
 /// <summary>
 /// Karve Routing View Model Constructor.
 /// </summary>
 /// <param name="services"></param>
 /// <param name="controller"></param>
 /// <param name="dialogService"></param>
 /// <param name="eventManager"></param>
 public KarveRoutingBaseViewModel(IDataServices services, IInteractionRequestController controller, IDialogService dialogService, IEventManager eventManager) : base(services, controller, dialogService)
 {
     EventManager = eventManager;
 }