Ejemplo n.º 1
0
        public ActionResult AddOrUpdate(Guid?id, Guid?classroomId, Guid?tutorId)
        {
            var model = new PupilModel();

            if (id.HasValue)
            {
                model = PupilModel.ToModel(PupilRepository.GetById(id.Value));
            }
            if (classroomId.HasValue)
            {
                model.ClassroomId = classroomId.Value;
            }
            if (tutorId.HasValue)
            {
                model.TutorId = tutorId.Value;
            }
            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult Get(Guid id)
        {
            var model = PupilModel.ToModel(PupilRepository.GetById(id));

            return(View(model));
        }
Ejemplo n.º 3
0
        public ActionResult GetAll()
        {
            var models = PupilRepository.All().Select(c => PupilModel.ToModel(c));

            return(View(models));
        }