Example #1
0
        public IEnumerable<StudentVisitRecord> FindByCriteria(StudentVisitRecordCriteria c)
        {
            return this.DbContext.Student_VisitRecord.Include("Clazz").Include("Student").Include("Reviewer").Include("Visitor").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)
                && (!c.ClazzIdSrh.HasValue || o.ClazzId.Equals(c.ClazzIdSrh.Value))
                && (!c.ClazzIdFromSrh.HasValue || o.ClazzId >= c.ClazzIdFromSrh.Value)
                && (!c.ClazzIdToSrh.HasValue || o.ClazzId <= c.ClazzIdToSrh.Value)
                && (!c.StudentIdSrh.HasValue || o.StudentId.Equals(c.StudentIdSrh.Value))
                && (!c.StudentIdFromSrh.HasValue || o.StudentId >= c.StudentIdFromSrh.Value)
                && (!c.StudentIdToSrh.HasValue || o.StudentId <= c.StudentIdToSrh.Value)
                && (!c.TimeSrh.HasValue || o.Time.Equals(c.TimeSrh.Value))
                && (!c.VisitorIdSrh.HasValue || o.VisitorId.Equals(c.VisitorIdSrh.Value))
                && (!c.VisitorIdFromSrh.HasValue || o.VisitorId >= c.VisitorIdFromSrh.Value)
                && (!c.VisitorIdToSrh.HasValue || o.VisitorId <= c.VisitorIdToSrh.Value)
                && (String.IsNullOrEmpty(c.GoalSrh) || o.Goal.Contains(c.GoalSrh))
                && (String.IsNullOrEmpty(c.ContentSrh) || o.Content.Contains(c.ContentSrh))
                && (String.IsNullOrEmpty(c.QuestionSrh) || o.Question.Contains(c.QuestionSrh))
                && (!c.ReviewerIdSrh.HasValue || (o.ReviewerId.HasValue 			&& o.ReviewerId.Value.Equals(c.ReviewerIdSrh.Value)))
                && (!c.ReviewerIdFromSrh.HasValue || (o.ReviewerId.HasValue 			&& o.ReviewerId.Value >= c.ReviewerIdFromSrh.Value))
                && (!c.ReviewerIdToSrh.HasValue || (o.ReviewerId.HasValue 			&& o.ReviewerId.Value <= c.ReviewerIdToSrh.Value))
                && (!c.ReviewTimeSrh.HasValue || (o.ReviewTime.HasValue 			&& o.ReviewTime.Value.Equals(c.ReviewTimeSrh.Value)))
                && (!c.ReviewTimeFromSrh.HasValue || (o.ReviewTime.HasValue 			&& o.ReviewTime.Value >= c.ReviewTimeFromSrh.Value))
                && (!c.ReviewTimeToSrh.HasValue || (o.ReviewTime.HasValue 			&& o.ReviewTime.Value <= c.ReviewTimeToSrh.Value))
                && (String.IsNullOrEmpty(c.ReviewCommentSrh) || o.ReviewComment.Contains(c.ReviewCommentSrh))

            );
        }
Example #2
0
 public ActionResult Search(StudentVisitRecordCriteria c)
 {
     c.sortname = "time";
     c.sortorder = "desc";
     var m = new Student_Visit_ViewModel {
         Criteria = c,
         CurrentUser = AppContext.CurrentUser,
         Records = this.Service.Search(c).Data,
         ShowConfirmEdit = true,
         ShowDelete = true,
         ShowInput = false
     };
     return this.View(m);
 }