예제 #1
0
        public void GetByFilterTest()
        {
            BussinessTypeModel model = new BussinessTypeModel();
            var result = obj.GetByFilter(model);

            Assert.IsInstanceOfType(result, typeof(IEnumerable));
        }
예제 #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);
        }
예제 #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;
        }