/// <summary> /// Reitinialize the sql executor and all the services provided by this interface with /// a new connection string. /// </summary> /// <param name="sqlExecutor">Executor to be used.</param> /// <param name="connectionValue">Connection value.</param> private void InitServices(ISqlExecutor sqlExecutor, string connectionValue = "") { if (!string.IsNullOrEmpty(connectionValue)) { sqlExecutor.ConnectionString = connectionValue; TestConnection(sqlExecutor, connectionValue); } _executor = sqlExecutor; _supplierDataServices = new SupplierDataAccessLayer(sqlExecutor); _helperDataServices = new HelperDataAccessLayer(sqlExecutor); _commissionAgentDataServices = new CommissionAgentAccessLayer(sqlExecutor); _vehicleDataServices = new VehiclesDataAccessLayer(sqlExecutor); _settingsDataService = new SettingsDataService(sqlExecutor); _clientDataServices = new ClientDataAccessLayer(sqlExecutor); _officeDataService = new OfficeDataService(sqlExecutor); _companyDataService = new CompanyDataServices(sqlExecutor); _contractDataService = new ContractDataServices(sqlExecutor); _invoiceDataService = new InvoiceDataServices(sqlExecutor); _bookingDataService = new BookingDataAccessLayer(sqlExecutor, null); _fareDataService = new FareDataServices(sqlExecutor); _reservationRequestDataService = new ReservationRequestDataAccessLayer(sqlExecutor); _budgetDataService = new BudgetDataAccessLayer(sqlExecutor); _bookingIncidentDataService = new BookingIncidentDataAccessLayer(sqlExecutor); _userDataService = new UserDataService(sqlExecutor); }
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); }
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(); }
private void InitServices(IDataServices services, IConfigurationService configurationService) { _userSettings = configurationService.UserSettings; _dataReservationService = services.GetReservationRequestDataService(); _assistDataService = services.GetAssistDataServices(); }