public async Task <List <GoodCellModel> > SearchMiceGoodCells(MiceSelector miceSelector) { var normalParameters = _parametersCreator.GetMiceParameters(miceSelector) .Append(_parametersCreator.CreateDiscriminatorParameter <Mause>()).ToArray(); var goodsDbInformation = await _context.GetGoodsDbInformation("GetMice", normalParameters); return(goodsDbInformation.GoodCells); }
public async Task <GoodsInformation <string> > SearchMiceInformation(MiceSelector miceSelector) { var normalParameters = _parametersCreator.GetMiceParameters(miceSelector) .Append(_parametersCreator.CreateDiscriminatorParameter <Mause>()).ToArray(); var goodsDbInformation = await _context.GetGoodsDbInformation("GetMice", normalParameters); var questions = _questionsGrouper.GroupMice(miceSelector, goodsDbInformation.DBQuestions); return(new GoodsInformation <string>(_parametersCreator.GetCount(normalParameters), goodsDbInformation.GoodCells, questions)); }
public MiceInformationSearcherFactory(IGoodsInformationSearcher goodsInformationSearcher, IGoodCellsSearcher goodCellsSearcher, ICacheKeyCreator keyCreator, MiceSelector miceSelector) { _goodsInformationSearcher = goodsInformationSearcher; _goodCellsSearcher = goodCellsSearcher; _keyCreator = keyCreator; _miceSelector = miceSelector; }
public List <QuestionsBase <string> > GroupMice(MiceSelector miceSelector, List <DBQuestionBase> dBQuestions) { var questions = new List <QuestionsBase <string> >() { _questionsCreator.GroupMauseTypes(dBQuestions), _questionsCreator.GroupButtonsCount(dBQuestions), }; questions.AddRange(GroupComputerAccessories(miceSelector, dBQuestions)); return(questions); }
public List <SqlParameter> GetMiceParameters(MiceSelector miceSelector) { List <SqlParameter> sqlParameters = new List <SqlParameter>(); sqlParameters.AddRange(GetComputerAccessoriesParameters(miceSelector)); if (miceSelector.Types != null) { sqlParameters.Add(CreateMauseTypesParameter(miceSelector.Types)); } if (miceSelector.ButtonsCount != null) { sqlParameters.Add(CreateButtonsCountParameter(miceSelector.ButtonsCount)); } return(sqlParameters); }
public async Task <GoodsInformation <string> > GetMiceInformation([FromBody] MiceSelector miceSelector) { return(await _goodsInformationCreator.CreateGoodsInformation(miceSelector, new MiceInformationSearcherFactory(_goodsInformationSearcher, _goodCellsSearcher, _keyCreator, miceSelector))); }