예제 #1
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);
        }
예제 #2
0
        public RpcComputerRepository(IRepositoryFactory repositoryFactory, Persistence.Models.User user)
        {
            _repositoryFactory = repositoryFactory;
            _user = user;

            _computerRepository = _repositoryFactory.GetComputerRepository();
        }
예제 #3
0
        public TaskRepository(IDbConnection connection, IComputerRepository computerRepository, IScriptRepository scriptRepository, IUserRepository userRepository)
        {
            _connection = connection;

            _computerRepository = computerRepository;
            _scriptRepository   = scriptRepository;
            _userRepository     = userRepository;
        }
예제 #4
0
 public ComputerService(IComputerRepository repository, IOptions <MongoConfig> config)
 {
     _repository = repository;
     _config     = config.Value;
     _client     = new MongoClient(_config.Client);
     _database   = _client.GetDatabase(_config.Database);
     _collection = _database.GetCollection <Log>(_config.Collection);
 }
 public BookingController(IComputerRepository computerRepository, IQueueRepository queueRepository,
                          IHttpContextAccessor httpContextAccessor, UserManager <ApplicationUser> userManager)
 {
     _computerRepository = computerRepository;
     _queueRepository    = queueRepository;
     _currentUserId      = httpContextAccessor.HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
     _userManager        = userManager;
 }
예제 #6
0
 public AdminController(IComputerRepository computerRepository, IStateRepository stateRepository, ILoanRepository loanRepository, IUserRepository userRepository, IMapper mapper)
 {
     _computerRepository = computerRepository;
     _stateRepository    = stateRepository;
     _loanRepository     = loanRepository;
     _userRepository     = userRepository;
     _mapper             = mapper;
 }
 public DataManager(
     IComputerRepository computerRepository,
     IManufacturerRepository manufacturerRepository,
     IUserRepository userRepository)
 {
     _computerRepository     = computerRepository;
     _manufacturerRepository = manufacturerRepository;
     _userRepository         = userRepository;
 }
예제 #8
0
        public IComputerRepository GetComputerRepository()
        {
            if (_computerRepository == null)
            {
                _computerRepository = GetRepository(x => x.GetComputerRepository());
            }

            return(_computerRepository);
        }
예제 #9
0
        public AnnouncementController(IAnnouncementRepository repository,
                                      ISectionRepository sectionRepository,
                                      ICategoryRepository categoryRepository,
                                      IAnnouncementImageRepository announcementImageRepository,
                                      ISubsectionRepository subsectionRepository,
                                      ICityRepository cityRepository,
                                      ICurrencyRepository currencyRepository,
                                      IConfigRepository configRepository,
                                      IAnnouncementBookmarkRepository bookmarkRepository,
                                      IAnnouncementsPremiumsRefRepository announcementsPremiumsRefRepository,
                                      IProfileRepository profileRepository,
                                      IComputerRepository computerRepository,
                                      IComputerAnnouncementRefRepository computerAnnouncementRefRepository)
        {
            _repository         = repository;
            _repository.Context = rc;

            _sectionRepository         = sectionRepository;
            _sectionRepository.Context = rc;

            _categoryRepository         = categoryRepository;
            _categoryRepository.Context = rc;

            _announcementImageRepository         = announcementImageRepository;
            _announcementImageRepository.Context = rc;

            _subsectionRepository         = subsectionRepository;
            _subsectionRepository.Context = rc;

            _cityRepository         = cityRepository;
            _cityRepository.Context = rc;

            _currencyRepository         = currencyRepository;
            _currencyRepository.Context = rc;

            _configRepository         = configRepository;
            _configRepository.Context = rc;

            _bookmarkRepository         = bookmarkRepository;
            _bookmarkRepository.Context = rc;

            _announcementsPremiumsRefRepository         = announcementsPremiumsRefRepository;
            _announcementsPremiumsRefRepository.Context = rc;

            _profileRepository         = profileRepository;
            _profileRepository.Context = rc;

            _computerRepository         = computerRepository;
            _computerRepository.Context = rc;

            _computerAnnouncementRefRepository         = computerAnnouncementRefRepository;
            _computerAnnouncementRefRepository.Context = rc;

            ViewBag.Slogan = ProjectConfiguration.Get.AnnouncementConfig.Slogan;
            ViewBag.SelectedSiteCategory = CategorySearch.Announcement;
        }
        public IComputerRepository GetComputerRepository()
        {
            if (_computerRepository == null)
            {
                var scriptRepository = GetRepository(x => x.GetScriptRepository());
                var userRepository   = GetRepository(x => x.GetUserRepository());
                _computerRepository = new ComputerRepository(_connection, scriptRepository, userRepository);
            }

            return(_computerRepository);
        }
예제 #11
0
        public WebHookSession ToRepositoryType(IRepositoryModelCache cache, IComputerRepository computerRepository)
        {
            var result = new WebHookSession(
                computer: ComputerModel.ToRepositoryType(cache, Computer_Id, computerRepository),
                id: Id,
                lastPing: LastPing,
                token: Token
                );

            cache?.Set(result.Id, result);

            return(result);
        }
예제 #12
0
        public Network ToRepositoryType(IRepositoryModelCache cache, IComputerRepository computerRepository, IUserRepository userRepository)
        {
            var result = new Network(
                address: Address,
                attatchedComputer: ComputerModel.ToRepositoryType(cache, AttatchedComputer_Id, computerRepository),
                devices: null,
                id: Id,
                lastPing: LastPing,
                name: Name,
                owner: UserModel.ToRepositoryType(cache, Owner_Id, userRepository)
                );

            cache?.Set(result.Id, result);

            return(result);
        }
예제 #13
0
        public static CleaningResult Clean(this IScriptRepository repository, ITaskRepository taskRepository, IComputerRepository computerRepository, ListFilter filter = null)
        {
            if (filter == null)
            {
                filter = new ListFilter
                {
                    SortDirection = SortDirection.Ascending
                };
            }

            var allScripts = repository.List(filter).Items;

            var unusedScripts = allScripts.Where(x =>
                {
                    var getOwnersFunctions = new Func<Script, object[]>[]
                        {
                            taskRepository.Get,
                            computerRepository.Get
                        };

                    foreach (var getOwnersFunction in getOwnersFunctions)
                    {
                        var owners = getOwnersFunction(x);

                        if (owners.Any())
                        {
                            return false;
                        }
                    }

                    return true;
                }).ToArray();

            foreach (var script in unusedScripts)
            {
                repository.Remove(script);
            }

            var result = new CleaningResult(filter, allScripts.Length, unusedScripts.Length);

            return result;
        }
예제 #14
0
        public Task ToRepositoryType(IRepositoryModelCache cache, IComputerRepository computerRepository, IScriptRepository scriptRepository, IUserRepository userRepository)
        {
            var cachedValue = cache?.Get <Task>(Id);

            if (cachedValue != null)
            {
                return(cachedValue);
            }

            var result = new Task(
                expiration: Expiration,
                id: Id,
                origin: Origin,
                owner: UserModel.ToRepositoryType(cache, Owner_Id, userRepository),
                receivedTimestamp: ReceivedTimestamp,
                script: ScriptModel.ToRepositoryType(cache, Script_Id, scriptRepository),
                target: ComputerModel.ToRepositoryType(cache, Target_Id, computerRepository)
                );

            cache?.Set(result.Id, result);

            return(result);
        }
예제 #15
0
        public RealtyController(IRealtyRepository realtyRepository, ICityRepository cityRepository,
                                IRealtyCategoryRepository categoryRepository, IRealtySectionRepository sectionRepository,
                                ICurrencyRepository currencyRepository, IRealtyPhotoRepository photoRepository,
                                IRealtyBookmarkRepository bookmarkRepository, IProfileRepository profileRepository, IComputerRepository computerRepository, IComputerRealtyRefRepository computerRealtyRefRepository)
        {
            _realtyRepository         = realtyRepository;
            _realtyRepository.Context = rc;

            _cityRepository         = cityRepository;
            _cityRepository.Context = rc;

            _categoryRepository         = categoryRepository;
            _categoryRepository.Context = rc;

            _sectionRepository         = sectionRepository;
            _sectionRepository.Context = rc;

            _currencyRepository         = currencyRepository;
            _currencyRepository.Context = rc;

            _photoRepository         = photoRepository;
            _photoRepository.Context = rc;

            _bookmarkRepository         = bookmarkRepository;
            _bookmarkRepository.Context = rc;

            _profileRepository         = profileRepository;
            _profileRepository.Context = rc;

            _computerRepository         = computerRepository;
            _computerRepository.Context = rc;

            _computerRealtyRefRepository         = computerRealtyRefRepository;
            _computerRealtyRefRepository.Context = rc;

            ViewBag.SelectedSiteCategory = CategorySearch.Realty;
        }
예제 #16
0
        public static Computer ToRepositoryType(IRepositoryModelCache cache, int?id, IComputerRepository computerRepository)
        {
            if (id == null)
            {
                return(null);
            }

            var cachedValue = cache?.Get <Computer>(id);

            if (cachedValue != null)
            {
                return(cachedValue);
            }

            if (computerRepository == null)
            {
                return(new ComputerModel
                {
                    Id = id.Value
                }.ToRepositoryType(cache, (IScriptRepository)null, (IUserRepository)null));
            }

            return(computerRepository.Get(id.Value, cache));
        }
예제 #17
0
 public StatisticService(IComputerRepository computerRepository)
 {
     _computerRepository = computerRepository;
 }
 public ComputersService(IComputerRepository computerRepository, IGraphicsCardRepository graphicsCardRepository, IMapper mapper)
 {
     _mapper                 = mapper;
     _computerRepository     = computerRepository;
     _graphicsCardRepository = graphicsCardRepository;
 }
 public ComputerBusiness(IComputerRepository repository, ComputerConverter converter)
 {
     _computerRepository = repository;
     _converter          = converter;
 }
예제 #20
0
 public ComputerService(IComputerRepository repository)
 {
     _repository = repository;
 }
예제 #21
0
 public ComputerService(IComputerRepository computerRepository) => _computerRepository = computerRepository;
 public ComputerController(IComputerRepository repository, ILogger <ComputerController> logger)
 {
     _repository = repository;
     _logger     = logger;
 }
예제 #23
0
        //[Inject]
        //private readonly IComputerAnnouncementRefRepository _computerAnnouncementRefRepository;

        public AnonymousUserService()
        {
            _computerRepository         = DependencyResolver.Current.GetService <IComputerRepository>();
            _computerRepository.Context = new ReklamaContext();
        }
예제 #24
0
 public PhonesController(IComputerRepository computerRepository)
 {
     _computerRepository = computerRepository;
 }
 public ProductsManager(IComputerRepository computerRepository)
 {
     this._computerRepository = computerRepository;
 }
예제 #26
0
 public HomeController(IComputerRepository computerRepository)
 {
     _computerRepository = computerRepository;
 }
 public ComputerController(IComputerRepository computerRepo)
 {
     this.computerRepo = computerRepo;
 }
예제 #28
0
 public NetworkRepository(IDbConnection connection, IComputerRepository computerRepository, IUserRepository userRepository)
 {
     _connection         = connection;
     _computerRepository = computerRepository;
     _userRepository     = userRepository;
 }
예제 #29
0
 public HomeController(IComputerRepository computerRepository, IQueueRepository queueRepository)
 {
     _computerRepository = computerRepository;
     _queueRepository    = queueRepository;
 }
예제 #30
0
 public ComputerController(IComputerRepository repository, ApplicationDbContext context)
 {
     this.repository = repository;
     this.context    = context;
 }
예제 #31
0
 public SyncWholeNetwork(IComputerRepository computerRepository, IDeviceRepository deviceRepository, INetworkRepository networkRepository)
 {
     _computerRepository = computerRepository;
     _deviceRepository   = deviceRepository;
     _networkRepository  = networkRepository;
 }