Esempio n. 1
0
 public ComputerController(IScanService scanService = null, IComputerService computerService = null, IDataBaseService dataBaseService = null)
 {
     // IOC injection
     dataBaseService  = dataBaseService ?? new DataBaseService();
     _computerService = computerService ?? new ComputerService(dataBaseService);
     _scanService     = scanService ?? new ScanService(dataBaseService, _computerService);
 }
Esempio n. 2
0
        public TrainingFlowWindowVm(ISeatQueries seatQueries, Guid sessionId, IDocumentCreator documentCreator, ISessionQueries sessionQueries, IApplicationService applicationService, IComputerService computerService)
        {
            _seatQueries        = seatQueries ?? throw new ArgumentNullException(nameof(seatQueries));
            _sessionId          = sessionId;
            _documentCreator    = documentCreator ?? throw new ArgumentNullException(nameof(documentCreator));
            _sessionQueries     = sessionQueries ?? throw new ArgumentNullException(nameof(sessionQueries));
            _applicationService = applicationService ?? throw new ArgumentNullException(nameof(applicationService));
            _computerService    = computerService ?? throw new ArgumentNullException(nameof(computerService));
            RefreshCommand      = new RelayCommandAsync(ExecuteRefreshAsync);

            SelectedSeats = new ObservableCollection <ISeatValidatedResult>();
            SelectedSeats.CollectionChanged += (sender, args) =>
            {
                PrintCertificatOfAttendanceCommand.RaiseCanExecuteChanged();
                PrintSurveyCommand.RaiseCanExecuteChanged();
                PrintDegreeCommand.RaiseCanExecuteChanged();
                MissingCommand.RaiseCanExecuteChanged();
            };

            PrintTimesheetCommand = new RelayCommand(ExecutePrintFeuillePresence);
            PrintCertificatOfAttendanceCommand = new RelayCommand(ExecutePrintCertificatAssiduite, () => SelectedSeats.Any());
            PrintSurveyCommand      = new RelayCommand(ExecutePrintQuestionnaire, () => SelectedSeats.Any());
            PrintDegreeCommand      = new RelayCommand(ExecutePrintDiplome, () => SelectedSeats.Any());
            MissingCommand          = new RelayCommandAsync(ExecuteAbsenceAsync, () => SelectedSeats.Any());
            PrintAllDocumentCommand = new RelayCommandAsync(ExecutePrintAllDocumentAsync);
        }
Esempio n. 3
0
        public ComputerController()
        {
            const string connectionString = @"server=192.168.11.70\SQLEXPRESS,1433;database=abraham;uid=sa;password=toto;Application Name=Homer";

            _repository = new ComputerRepository(connectionString);
            _service    = new ComputerService(_repository);
        }
        public LoginWindowsVm(IApplicationService applicationService, IUserQueries userQueries, IComputerService computerService)
        {
            _applicationService = applicationService ?? throw new ArgumentNullException(nameof(applicationService));
            _userQueries        = userQueries ?? throw new ArgumentNullException(nameof(userQueries));
            _computerService    = computerService ?? throw new ArgumentNullException(nameof(computerService));

            SetValiderCommandCanExecute(() => !string.IsNullOrWhiteSpace(Username) && !string.IsNullOrWhiteSpace(Password) && !Connecting);
        }
Esempio n. 5
0
 /// <summary>
 ///  Inicializuje novou instanci třídy ControlLibrary.ComputerModel reprezentující
 ///    konkrétní počítač.
 /// </summary>
 /// <param name="name">Název počítače.</param>
 /// <param name="hostname">Hostname (adresa) počítače.</param>
 /// <param name="macAddress">MAC adresa počítače.</param>
 public ComputerModel(string name, string hostname, MacAddress macAddress)
 {
     Name            = name;
     Hostname        = hostname;
     MacAddress      = macAddress;
     ComputerService = ComputerServiceFactory.GetComputerService(Hostname, MacAddress);
     ComputerName    = $"{ Name }: { Hostname }, { MacAddress.Address }";
 }
Esempio n. 6
0
 public ProgramsForm(GameMenu game, IComputerService computerService)
 {
     InitializeComponent();
     this.FormBorderStyle = FormBorderStyle.FixedSingle;
     this.MinimizeBox     = false;
     this.MaximizeBox     = false;
     _game = game;
     this.computerService = computerService;
 }
Esempio n. 7
0
 public AppointmentService(
     ILogger <AppointmentService> logger,
     ICalendarService calendarService,
     IComputerService computerService)
 {
     _logger          = logger;
     _calendarService = calendarService;
     _computerService = computerService;
 }
Esempio n. 8
0
 public ComputerController(IErrorService errorService, IComputerService computerService,
                           IDeparmentTypeService deparmentTypeService, IComputerTypeService computerTypeService,
                           IProducerTypeService producerTypeService
                           ) :
     base(errorService)
 {
     _computerService      = computerService;
     _deparmentTypeService = deparmentTypeService;
     _computerTypeService  = computerTypeService;
     _producerTypeService  = producerTypeService;
 }
Esempio n. 9
0
        public CreateAgreementWindowVm(SessionInfos sessionInfos, IApplicationService applicationService, IContactQueries contactQueries, List <SeatItem> selectedPlaces, IComputerService computerService)
        {
            _sessionInfos              = sessionInfos ?? throw new ArgumentNullException(nameof(sessionInfos));
            _applicationService        = applicationService ?? throw new ArgumentNullException(nameof(applicationService));
            _contactQueries            = contactQueries ?? throw new ArgumentNullException(nameof(contactQueries));
            _selectedPlaces            = selectedPlaces ?? throw new ArgumentNullException(nameof(selectedPlaces));
            _computerService           = computerService ?? throw new ArgumentNullException(nameof(computerService));
            AddContactCommand          = new RelayCommandAsync(ExecuteAddContactAsync);
            UnknowTypeAgreementCommand = new RelayCommand(ExecuteUnknowTypeConvention);

            SetValiderCommandCanExecute(() => SelectedContact != null && AgreementType != AgreementType.Unknow);
        }
Esempio n. 10
0
 public void Dispose()
 {
     _service              = null;
     _mockComputerRepo     = null;
     _mockComponentRepo    = null;
     _win32ComputerSystem  = null;
     _win32ComputerSystems = null;
     _computer1            = null;
     _computer2            = null;
     _computer3            = null;
     _computers            = null;
     _includes             = null;
     GC.SuppressFinalize(this);
 }
Esempio n. 11
0
 public ComputerForm(GameMenu game, IComputerService computerService)
 {
     InitializeComponent();
     this.FormBorderStyle = FormBorderStyle.FixedSingle;
     this.MinimizeBox     = false;
     this.MaximizeBox     = false;
     _game = game;
     this.computerService = computerService;
     compUpgrade.Text     = "Comp: " + (_game.Computer.Comp + 1);
     memoryUpgrade.Text   = "Memory: " + (_game.Computer.Memory + 1);
     hddUpgrade.Text      = "HDD: " + (_game.Computer.HDD + 1);
     modemUpgrade.Text    = "Modem: " + (_game.Computer.Modem + 1);
     cdUpgrade.Text       = "Cd: " + (_game.Computer.Cd + 1);
 }
        /// <summary>重新加载</summary>
        private void Reload()
        {
            if (this.restartCount > 0)
            {
                KernelContext.Log.Info(string.Format(I18n.Strings["application_is_reloading"], MembershipConfiguration.ApplicationName));

                // 重新加载配置信息
                MembershipConfigurationView.Instance.Reload();
            }
            else
            {
                KernelContext.Log.Info(string.Format(I18n.Strings["application_is_loading"], MembershipConfiguration.ApplicationName));
            }

            // 创建对象构建器(Spring.NET)
            string springObjectFile = MembershipConfigurationView.Instance.Configuration.Keys["SpringObjectFile"].Value;

            SpringObjectBuilder objectBuilder = SpringObjectBuilder.Create(MembershipConfiguration.ApplicationName, springObjectFile);

            this.m_PasswordEncryptionManagement = objectBuilder.GetObject <IPasswordEncryptionManagement>(typeof(IPasswordEncryptionManagement));

            this.m_AuthorizationObjectService = objectBuilder.GetObject <IAuthorizationObjectService>(typeof(IAuthorizationObjectService));
            this.m_AccountService             = objectBuilder.GetObject <IAccountService>(typeof(IAccountService));
            this.m_AccountLogService          = objectBuilder.GetObject <IAccountLogService>(typeof(IAccountLogService));
            this.m_AccountGrantService        = objectBuilder.GetObject <IAccountGrantService>(typeof(IAccountGrantService));
            this.m_AccountBindingService      = objectBuilder.GetObject <IAccountBindingService>(typeof(IAccountBindingService));
            this.m_AccountFriendService       = objectBuilder.GetObject <IAccountFriendService>(typeof(IAccountFriendService));
            this.m_MemberService                   = objectBuilder.GetObject <IMemberService>(typeof(IMemberService));
            this.m_OrganizationUnitService         = objectBuilder.GetObject <IOrganizationUnitService>(typeof(IOrganizationUnitService));
            this.m_RoleService                     = objectBuilder.GetObject <IRoleService>(typeof(IRoleService));
            this.m_GeneralRoleService              = objectBuilder.GetObject <IGeneralRoleService>(typeof(IGeneralRoleService));
            this.m_StandardGeneralRoleService      = objectBuilder.GetObject <IStandardGeneralRoleService>(typeof(IStandardGeneralRoleService));
            this.m_StandardRoleService             = objectBuilder.GetObject <IStandardRoleService>(typeof(IStandardRoleService));
            this.m_StandardOrganizationUnitService = objectBuilder.GetObject <IStandardOrganizationUnitService>(typeof(IStandardOrganizationUnitService));
            this.m_GroupService                    = objectBuilder.GetObject <IGroupService>(typeof(IGroupService));
            this.m_ComputerService                 = objectBuilder.GetObject <IComputerService>(typeof(IComputerService));
            this.m_CatalogService                  = objectBuilder.GetObject <ICatalogService>(typeof(ICatalogService));
            this.m_CatalogItemService              = objectBuilder.GetObject <ICatalogItemService>(typeof(ICatalogItemService));
            this.m_ContactService                  = objectBuilder.GetObject <IContactService>(typeof(IContactService));
            this.m_AssignedJobService              = objectBuilder.GetObject <IAssignedJobService>(typeof(IAssignedJobService));
            this.m_JobFamilyService                = objectBuilder.GetObject <IJobFamilyService>(typeof(IJobFamilyService));
            this.m_JobGradeService                 = objectBuilder.GetObject <IJobGradeService>(typeof(IJobGradeService));
            this.m_JobService         = objectBuilder.GetObject <IJobService>(typeof(IJobService));
            this.m_SettingService     = objectBuilder.GetObject <ISettingService>(typeof(ISettingService));
            this.m_CatalogService     = objectBuilder.GetObject <ICatalogService>(typeof(ICatalogService));
            this.m_CatalogItemService = objectBuilder.GetObject <ICatalogItemService>(typeof(ICatalogItemService));

            KernelContext.Log.Info(string.Format(I18n.Strings["application_is_successfully_loaded"], MembershipConfiguration.ApplicationName));
        }
Esempio n. 13
0
 public FakeDataController(
     IErrorService errorService,
     IComputerService computerService,
     IComputerTypeService computerTypeService,
     IDeparmentTypeService deparmentTypeService,
     IProducerTypeService producerTypeService,
     IComputerUsingHistoryService computerUsingHistoryService) :
     base(errorService)
 {
     this._computerService        = computerService;
     _computerTypeService         = computerTypeService;
     _deparmentTypeService        = deparmentTypeService;
     _producerTypeService         = producerTypeService;
     _computerUsingHistoryService = computerUsingHistoryService;
 }
Esempio n. 14
0
        public ComputerController(IApplicationDbContext applcationDbContext,
                                  IComputerService computerService,
                                  ITransientInterface transientInterface_1,
                                  ITransientInterface transientInterface_2,
                                  IScopedInterface scopedInterface_1,
                                  IScopedInterface scopedInterface_2,
                                  ISingletonInterface singletonInterface_1,
                                  ISingletonInterface singletonInterface_2
                                  )
        {
            _computerService = computerService;

            _transientInterface_1 = transientInterface_1;
            _transientInterface_2 = transientInterface_2;

            _scopedInterface_1 = scopedInterface_1;
            _scopedInterface_2 = scopedInterface_2;

            _singletoneInterface_1 = singletonInterface_1;
            _singletoneInterface_2 = singletonInterface_2;
        }
Esempio n. 15
0
        public ManageAgreementWindowVm(Guid agreementId, ISeatQueries seatQueries,
                                       IApplicationService applicationService, IContactQueries contactQueries, IAgreementQueries agreementQueries,
                                       IComputerService computerService, IDocumentCreator documentCreator, IDocumentRepository documentRepository)
        {
            _agreementId        = agreementId;
            _applicationService = applicationService ?? throw new ArgumentNullException(nameof(applicationService));
            _seatQueries        = seatQueries ?? throw new ArgumentNullException(nameof(seatQueries));
            _contactQueries     = contactQueries ?? throw new ArgumentNullException(nameof(contactQueries));
            _documentCreator    = documentCreator ?? throw new ArgumentNullException(nameof(documentCreator));
            _documentRepository = documentRepository ?? throw new ArgumentNullException(nameof(documentRepository));
            _agreementQueries   = agreementQueries ?? throw new ArgumentNullException(nameof(agreementQueries));
            _computerService    = computerService ?? throw new ArgumentNullException(nameof(computerService));

            ChooseDocumentCommand         = new RelayCommand(ExecuteChooseDocumentAsync);
            PrintCommand                  = new RelayCommandAsync(ExecutePrintAsync);
            SendMailCommand               = new RelayCommandAsync(ExecuteSendEmailAsync);
            OpenSignedDocumentCommand     = new RelayCommandAsync(ExecuteOpenSignedDocumentAsync);
            ReassignSignedDocumentCommand = new RelayCommand(ExecuteReassignSignedDocument);
            RemindAgreementCommand        = new RelayCommandAsync(ExecuteRemingAgreementAsync);
            SavePricesCommand             = new RelayCommandAsync(ExecuteSavePricesAsync, () => CanSavePrices);

            SetValiderCommandCanExecute(() => File.Exists(DocumentPath));
        }
 public ComputerController(IComputerService computerService)
 {
     _computerService = computerService;
 }
Esempio n. 17
0
 public ComputerPriceResolver(IComputerService computerService) => _computerService = computerService;
Esempio n. 18
0
 public ComputerWeightResolver(IComputerService computerService) => _computerService = computerService;
Esempio n. 19
0
 public ScanService(IDataBaseService dataBaseService = null, IComputerService computerService = null)
 {
     // IOC injection
     _dataBaseService = dataBaseService ?? new DataBaseService();
     _computerService = computerService ?? new ComputerService(dataBaseService);
 }
Esempio n. 20
0
 public HomeController(IComputerService computerService, IHistoryService historyService)
 {
     _computerService = computerService;
     _historyService  = historyService;
 }
Esempio n. 21
0
 public ComputerController(IComputerService service)
 {
     _service = service;
 }
        public ComponentsHolder(IComputerService service)
        {
            this.service = service;

            GetComponents();
        }
 public string ShutDown([FromServices] IComputerService computerService)
 {
     computerService.ShutDown();
     return("关机完成!!!");
 }
 public string PowerOn([FromServices] IComputerService computerService)
 {
     computerService.PowerON();
     return("开机成功!!!");
 }
Esempio n. 25
0
 public ComputerController(IComputerService computerService, IUserService userService)
 {
     ComputerService = computerService;
     UserService     = userService;
 }
Esempio n. 26
0
 private void SetupService()
 {
     _service = new ComputerService(_mockComputerRepo.Object, _mockComponentRepo.Object);
 }
Esempio n. 27
0
 public PrivateDataController(IUserService userService, IComputerService computerService)
 {
     _userService     = userService;
     _computerService = computerService;
 }