public async Task<IActionResult> Create([Bind("ID,Nombre,Apellido,Direccion,Dni,Telefono,Mail")] Paciente paciente) { if (ModelState.IsValid) { _context.Add(paciente); await _context.SaveChangesAsync(); return RedirectToAction(nameof(Index)); } return View(paciente); }
public async Task <IActionResult> Create([Bind("ID,Mail,Pass")] Admin admin) { if (ModelState.IsValid) { _context.Add(admin); await _context.SaveChangesAsync(); adminContext = admin; return(RedirectToAction(nameof(Index))); } return(View(admin)); }
public async Task <IActionResult> Create([Bind("ID,TipoTurno,FechaTurno,PacienteID")] Turno turno) { if (ModelState.IsValid) { _context.Add(turno); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["PacienteID2"] = new SelectList((from s in _context.pacientes select new { ID = s.ID, FullName = s.Apellido + " " + s.Nombre }), "ID", "FullName", turno.PacienteID); //ViewData["PacienteID"] = new SelectList(_context.pacientes, "ID", "Apellido", turno.PacienteID); return(View(turno)); }