internal static List<货品信息ViewModel> GetList(货品信息Filter filter) { using (var client = new BDKRWS.BDKRWSClient()) { return client.货品信息_GetList(filter); } }
public List<货品信息ViewModel> 货品信息_GetList(货品信息Filter filter) { using (var context = new BDKRContext()) { var q = from t in context.货品信息S select t; if (filter.关键词 != null && filter.关键词.Length > 0) q = from t in q where (t.名称 != null && t.名称.Contains(filter.关键词)) || (t.拼音 != null && t.拼音.Contains(filter.关键词)) select t; if (filter.货品类别编码 != null && filter.货品类别编码.Length > 0) { q = from t in q where filter.货品类别编码.Contains(filter.货品类别编码) select t; } //TODO:价格区间暂时未做 var list = new List<货品信息ViewModel>(); q.ToList() .ForEach(t => { list.Add(t.ConvertToViewModel()); }); return list; } }
private void InitEditors() { EditorHelper.CheckedComboBoxEditor_货品类别(货品类别CheckComboBox.Properties); var filter = new 货品信息Filter(); 货品信息FilterBindingSource.DataSource = filter; }