Example #1
0
        public async Task <List <GoodCellModel> > SearchComputerDrivesGoodCells(ComputerDrivesSelector computerDrivesSelector)
        {
            var normalParameters = _parametersCreator.GetComputerDrivesParameters(computerDrivesSelector)
                                   .Append(_parametersCreator.CreateDiscriminatorParameter <ComputerDrive>()).ToArray();
            var goodsDbInformation = await _context.GetGoodsDbInformation("GetComputerDrives", normalParameters);

            return(goodsDbInformation.GoodCells);
        }
Example #2
0
 public ComputerDrivesInformationSearcherFactory(IGoodsInformationSearcher goodsInformationSearcher,
                                                 IGoodCellsSearcher goodCellsSearcher,
                                                 ICacheKeyCreator keyCreator,
                                                 ComputerDrivesSelector computerDrivesSelector)
 {
     _goodsInformationSearcher = goodsInformationSearcher;
     _goodCellsSearcher        = goodCellsSearcher;
     _keyCreator             = keyCreator;
     _computerDrivesSelector = computerDrivesSelector;
 }
Example #3
0
        public List <QuestionsBase <string> > GroupComputerDrives(ComputerDrivesSelector computerDrivesSelector, List <DBQuestionBase> dBQuestions)
        {
            var questions = new List <QuestionsBase <string> >()
            {
                _questionsCreator.GroupCapacity(dBQuestions),
                _questionsCreator.GroupComputerDriveTypes(dBQuestions),
                _questionsCreator.GroupFormFactorTypes(dBQuestions),
            };

            questions.AddRange(GroupComputerParts(computerDrivesSelector, dBQuestions));
            return(questions);
        }
        public List <SqlParameter> GetComputerDrivesParameters(ComputerDrivesSelector computerDrivesSelector)
        {
            List <SqlParameter> sqlParameters = new List <SqlParameter>();

            sqlParameters.AddRange(GetComputerPartsParameters(computerDrivesSelector));
            if (computerDrivesSelector.Capacities != null)
            {
                sqlParameters.Add(CreateCapacitiesParameter(computerDrivesSelector.Capacities));
            }
            if (computerDrivesSelector.Types != null)
            {
                sqlParameters.Add(CreateComputerDriveTypesParameter(computerDrivesSelector.Types));
            }
            if (computerDrivesSelector.FormFactorTypes != null)
            {
                sqlParameters.Add(CreateFormFactorTypesParameter(computerDrivesSelector.FormFactorTypes));
            }
            return(sqlParameters);
        }
Example #5
0
        public async Task <GoodsInformation <string> > SearchComputerDrivesInformation(ComputerDrivesSelector computerDrivesSelector)
        {
            var normalParameters = _parametersCreator.GetComputerDrivesParameters(computerDrivesSelector)
                                   .Append(_parametersCreator.CreateDiscriminatorParameter <ComputerDrive>()).ToArray();
            var goodsDbInformation = await _context.GetGoodsDbInformation("GetComputerDrives", normalParameters);

            var questions = _questionsGrouper.GroupComputerDrives(computerDrivesSelector, goodsDbInformation.DBQuestions);

            return(new GoodsInformation <string>(_parametersCreator.GetCount(normalParameters), goodsDbInformation.GoodCells, questions));
        }
 public async Task <GoodsInformation <string> > GetComputerDrivesInformation([FromBody] ComputerDrivesSelector computerDrivesSelector)
 {
     return(await _goodsInformationCreator.CreateGoodsInformation(computerDrivesSelector, new ComputerDrivesInformationSearcherFactory(_goodsInformationSearcher, _goodCellsSearcher, _keyCreator, computerDrivesSelector)));
 }