Example #1
0
        public async Task <List <GoodCellModel> > SearchFlashDrivesGoodCells(FlashDrivesSelector flashDrivesSelector)
        {
            var normalParameters = _parametersCreator.GetFlashDrivesParameters(flashDrivesSelector)
                                   .Append(_parametersCreator.CreateDiscriminatorParameter <FlashDrive>()).ToArray();
            var goodsDbInformation = await _context.GetGoodsDbInformation("GetFlashDrives", normalParameters);

            return(goodsDbInformation.GoodCells);
        }
Example #2
0
        public async Task <GoodsInformation <string> > SearchFlashDrivesInformation(FlashDrivesSelector flashDrivesSelector)
        {
            var normalParameters = _parametersCreator.GetFlashDrivesParameters(flashDrivesSelector)
                                   .Append(_parametersCreator.CreateDiscriminatorParameter <FlashDrive>()).ToArray();
            var goodsDbInformation = await _context.GetGoodsDbInformation("GetFlashDrives", normalParameters);

            var questions = _questionsGrouper.GroupFlashDrives(flashDrivesSelector, goodsDbInformation.DBQuestions);

            return(new GoodsInformation <string>(_parametersCreator.GetCount(normalParameters), goodsDbInformation.GoodCells, questions));
        }
 public FlashDrivesInformationSearcherFactory(IGoodsInformationSearcher goodsInformationSearcher,
                                              IGoodCellsSearcher goodCellsSearcher,
                                              ICacheKeyCreator keyCreator,
                                              FlashDrivesSelector flashDrivesSelector)
 {
     _goodsInformationSearcher = goodsInformationSearcher;
     _goodCellsSearcher        = goodCellsSearcher;
     _keyCreator          = keyCreator;
     _flashDrivesSelector = flashDrivesSelector;
 }
Example #4
0
        public List <QuestionsBase <string> > GroupFlashDrives(FlashDrivesSelector flashDrivesSelector, List <DBQuestionBase> dBQuestions)
        {
            var questions = new List <QuestionsBase <string> >()
            {
                _questionsCreator.GroupCapacity(dBQuestions),
                _questionsCreator.GroupUSBSpecificationTypes(dBQuestions),
            };

            questions.AddRange(GroupComputerTechnologies(flashDrivesSelector, dBQuestions));
            return(questions);
        }
        public List <SqlParameter> GetFlashDrivesParameters(FlashDrivesSelector flashDrivesSelector)
        {
            List <SqlParameter> sqlParameters = new List <SqlParameter>();

            sqlParameters.AddRange(GetComputerTechnologiesParameters(flashDrivesSelector));
            if (flashDrivesSelector.Capacities != null)
            {
                sqlParameters.Add(CreateCapacitiesParameter(flashDrivesSelector.Capacities));
            }
            if (flashDrivesSelector.USBSpecificationTypes != null)
            {
                sqlParameters.Add(CreateUSBSpecificationTypesParameter(flashDrivesSelector.USBSpecificationTypes));
            }
            return(sqlParameters);
        }
 public async Task <GoodsInformation <string> > GetFlashDrivesInformation([FromBody] FlashDrivesSelector flashDrivesSelector)
 {
     return(await _goodsInformationCreator.CreateGoodsInformation(flashDrivesSelector, new FlashDrivesInformationSearcherFactory(_goodsInformationSearcher, _goodCellsSearcher, _keyCreator, flashDrivesSelector)));
 }