Exemplo n.º 1
0
        private void butSearch_Click(object sender, EventArgs e)
        {
            PackingStyleModel model = new PackingStyleModel();
            model.CodeNum = txtCoating.Text.ToString();
            model.StyleType = cmbStyleType.SelectedIndex;

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

            if (model.CodeNum != null) { query = query.Where(p => p.CodeNum.Contains(model.CodeNum.ToString())); }
            if (model.StyleType > 0)
            {
                query = query.Where(p => p.StyleType.Equals(model.StyleType));
            }

            return query;
        }