Example #1
0
        // GET: Estudante
        public ActionResult Index()
        {
            EstudanteServiceRemoto.EstudanteServiceClient cliente       = new EstudanteServiceRemoto.EstudanteServiceClient();
            List <EstudanteServiceRemoto.EstudanteDTO>    estudantesDTO = cliente.GetAllEstudantes();

            return(View(Mapper.Map <List <Estudante> >(estudantesDTO)));
        }
        // GET: Inscricao
        public ActionResult CadastrarEstudante()
        {
            EstudanteServiceRemoto.EstudanteServiceClient clienteWSEstudante = new EstudanteServiceRemoto.EstudanteServiceClient();
            CursoServiceRemoto.CursoServiceClient clienteWSCurso = new CursoServiceRemoto.CursoServiceClient();

            var estudantes = clienteWSEstudante.GetAllEstudantes();
            var cursos = clienteWSCurso.GetAll();

            List<SelectListItem> selectEstudantes = estudantes.Select(e => new SelectListItem()
            {
                Text = string.Format("{0} {1} - Cod. {2}", e.Nome, e.SobreNome, e.Id),
                Value = e.Id.ToString()

            }).ToList();

            List<SelectListItem> selectCursos = cursos.Select(c => new SelectListItem()
            {
                Text = c.Nome,
                Value = c.Id.ToString()
            }).ToList();

            ViewBag.CursoId = selectCursos;
            ViewBag.EstudanteId = selectEstudantes;

            return View();
        }
Example #3
0
        // GET: Inscricao
        public ActionResult CadastrarEstudante()
        {
            EstudanteServiceRemoto.EstudanteServiceClient clienteWSEstudante = new EstudanteServiceRemoto.EstudanteServiceClient();
            CursoServiceRemoto.CursoServiceClient         clienteWSCurso     = new CursoServiceRemoto.CursoServiceClient();

            var estudantes = clienteWSEstudante.GetAllEstudantes();
            var cursos     = clienteWSCurso.GetAll();

            List <SelectListItem> selectEstudantes = estudantes.Select(e => new SelectListItem()
            {
                Text  = string.Format("{0} {1} - Cod. {2}", e.Nome, e.SobreNome, e.Id),
                Value = e.Id.ToString()
            }).ToList();

            List <SelectListItem> selectCursos = cursos.Select(c => new SelectListItem()
            {
                Text  = c.Nome,
                Value = c.Id.ToString()
            }).ToList();

            ViewBag.CursoId     = selectCursos;
            ViewBag.EstudanteId = selectEstudantes;

            return(View());
        }
 // GET: Estudante
 public ActionResult Index()
 {
     EstudanteServiceRemoto.EstudanteServiceClient cliente = new EstudanteServiceRemoto.EstudanteServiceClient();
     List<EstudanteServiceRemoto.EstudanteDTO> estudantesDTO = cliente.GetAllEstudantes();
     return View(Mapper.Map<List<Estudante>>(estudantesDTO));
 }