Пример #1
0
        private void butSearch_Click(object sender, EventArgs e)
        {
            MakerModel model = new MakerModel();
            model.MakerName = txtFilter.Text.ToString();

            var list = _repo.GetByFilter(model);
            dgvList.Rows.Clear();
            ListToGrid(list);
        }
Пример #2
0
        public IEnumerable<MakerModel> GetByFilter(MakerModel model)
        {
            IEnumerable<MakerModel> query = GetAll();

            if (model.MakerCode != null) { query = query.Where(p => p.MakerCode.Contains(model.MakerCode.ToString())); }
            if (model.MakerName != null) { query = query.Where(p => p.MakerName.Contains(model.MakerName.ToString())); }

            return query;
        }