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); }
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)); }
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); }
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); }
public async Task <GoodsInformation <string> > GetKeyboardsInformation([FromBody] KeyboardsSelector keyboardsSelector) { return(await _goodsInformationCreator.CreateGoodsInformation(keyboardsSelector, new KeyboardsInformationSearcherFactory(_goodsInformationSearcher, _goodCellsSearcher, _keyCreator, keyboardsSelector))); }