Exemple #1
0
        public IEnumerable<Knowledge> FindByCriteria(KnowledgeCriteria c)
        {
            return this.DbContext.Knowledges.Where(o =>
                (!c.IdSrh.HasValue || o.Id.Equals(c.IdSrh.Value))
                && (!c.IdFromSrh.HasValue || o.Id >= c.IdFromSrh.Value)
                && (!c.IdToSrh.HasValue || o.Id <= c.IdToSrh.Value)
                && (String.IsNullOrEmpty(c.SubjectSrh) || o.Subject.Contains(c.SubjectSrh))
                && (String.IsNullOrEmpty(c.ContentSrh) || o.Content.Contains(c.ContentSrh))
                && (String.IsNullOrEmpty(c.KnowledgeTypeSrh) || o.KnowledgeType.Contains(c.KnowledgeTypeSrh))

            );
        }
Exemple #2
0
 public ActionResult Search(KnowledgeCriteria c)
 {
     var m = new LigerGridModel();
     this.BeforeGetData(c);
     var r = this.Service.Search(c);
     this.AfterGetData(m, c, r);
     m.Total = r.RecordCount;
     r.Data.ForEach(o => {
         this.AddRowToGridModel(m, o);
     });
     this.AfterBuildGridModel(m, c, r);
     return this.Json(m, JsonRequestBehavior.AllowGet);
 }