Exemplo n.º 1
0
        public void GetByFilterTest()
        {
            BussinessTypeModel model = new BussinessTypeModel();
            var result = obj.GetByFilter(model);

            Assert.IsInstanceOfType(result, typeof(IEnumerable));
        }
Exemplo n.º 2
0
        private void butSearch_Click(object sender, EventArgs e)
        {
            BussinessTypeModel model = new BussinessTypeModel();
            model.BussinessName = txtFilter.Text.ToString();

            var list = _repo.GetByFilter(model);
            dgvList.Rows.Clear();
            ListToGrid(list);
        }
Exemplo n.º 3
0
        public IEnumerable<BussinessTypeModel> GetByFilter(BussinessTypeModel model)
        {
            IEnumerable<BussinessTypeModel> query = GetAll();

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

            return query;
        }