Exemple #1
0
        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);
        }
Exemple #2
0
        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));
        }
Exemple #3
0
 public MiceInformationSearcherFactory(IGoodsInformationSearcher goodsInformationSearcher,
                                       IGoodCellsSearcher goodCellsSearcher,
                                       ICacheKeyCreator keyCreator,
                                       MiceSelector miceSelector)
 {
     _goodsInformationSearcher = goodsInformationSearcher;
     _goodCellsSearcher        = goodCellsSearcher;
     _keyCreator   = keyCreator;
     _miceSelector = miceSelector;
 }
Exemple #4
0
        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)));
 }