예제 #1
0
        public async Task <List <GoodCellModel> > SearchKeyboardsGoodCells(KeyboardsSelector keyboardsSelector)
        {
            var normalParameters = _parametersCreator.GetKeyboardsParameters(keyboardsSelector)
                                   .Append(_parametersCreator.CreateDiscriminatorParameter <Keyboard>()).ToArray();
            var goodsDbInformation = await _context.GetGoodsDbInformation("GetKeyboards", normalParameters);

            return(goodsDbInformation.GoodCells);
        }
예제 #2
0
        public async Task <GoodsInformation <string> > SearchKeyboardsInformation(KeyboardsSelector keyboardsSelector)
        {
            var normalParameters = _parametersCreator.GetKeyboardsParameters(keyboardsSelector)
                                   .Append(_parametersCreator.CreateDiscriminatorParameter <Keyboard>()).ToArray();
            var goodsDbInformation = await _context.GetGoodsDbInformation("GetKeyboards", normalParameters);

            var questions = _questionsGrouper.GroupKeyboards(keyboardsSelector, goodsDbInformation.DBQuestions);

            return(new GoodsInformation <string>(_parametersCreator.GetCount(normalParameters), goodsDbInformation.GoodCells, questions));
        }
예제 #3
0
        public List <QuestionsBase <string> > GroupKeyboards(KeyboardsSelector keyboardsSelector, List <DBQuestionBase> dBQuestions)
        {
            var questions = new List <QuestionsBase <string> >()
            {
                _questionsCreator.GroupKeyboardTypes(dBQuestions),
            };

            questions.AddRange(GroupComputerAccessories(keyboardsSelector, dBQuestions));
            return(questions);
        }
예제 #4
0
 public KeyboardsInformationSearcherFactory(IGoodsInformationSearcher goodsInformationSearcher,
                                            IGoodCellsSearcher goodCellsSearcher,
                                            ICacheKeyCreator keyCreator,
                                            KeyboardsSelector keyboardsSelector)
 {
     _goodsInformationSearcher = goodsInformationSearcher;
     _goodCellsSearcher        = goodCellsSearcher;
     _keyCreator        = keyCreator;
     _keyboardsSelector = keyboardsSelector;
 }
        public List <SqlParameter> GetKeyboardsParameters(KeyboardsSelector keyboardsSelector)
        {
            List <SqlParameter> sqlParameters = new List <SqlParameter>();

            sqlParameters.AddRange(GetComputerAccessoriesParameters(keyboardsSelector));
            if (keyboardsSelector.Types != null)
            {
                sqlParameters.Add(CreateKeyboardTypesParameter(keyboardsSelector.Types));
            }
            return(sqlParameters);
        }
예제 #6
0
 public async Task <GoodsInformation <string> > GetKeyboardsInformation([FromBody] KeyboardsSelector keyboardsSelector)
 {
     return(await _goodsInformationCreator.CreateGoodsInformation(keyboardsSelector, new KeyboardsInformationSearcherFactory(_goodsInformationSearcher, _goodCellsSearcher, _keyCreator, keyboardsSelector)));
 }