Beispiel #1
0
 public ActionResult GetByFilter(string filter)
 {
     return(Json(EvaluationRepository.All()
                 .Where(e =>
                        (e.Classrooms.Title.ToLower()
                         + e.Date.ToString()
                         + e.TotalPoint.ToString()
                         + e.Users.LastName.ToLower()
                         + e.Users.FirstName.ToLower()).Contains(filter.ToLower()))
                 .Select(e => e.Id), JsonRequestBehavior.AllowGet));
 }
        // GET: /Eval/ReadEvaluations
        public ActionResult ReadEvaluations()
        {
            IList <EvaluationModels> models = new List <EvaluationModels>();

            using (EvaluationRepository repository = new EvaluationRepository())
            {
                IQueryable <Evaluations> a = repository.All();

                models = repository.All().Select(x => new EvaluationModels
                {
                    id            = x.Id,
                    classroomId   = x.Classroom_Id,
                    userId        = x.User_Id,
                    periodId      = x.Period_Id,
                    date          = x.Date,
                    totalPoint    = x.TotalPoint,
                    classroomName = x.Classrooms.Title,
                    userName      = x.Users.UserName
                }).ToList();
            }
            return(View(models));
        }
Beispiel #3
0
        public ActionResult GetAll()
        {
            var models = EvaluationRepository.All().Select(a => EvaluationModel.ToModel(a));

            return(View(models));
        }