public async Task <IActionResult> Edit(Guid id, [Bind("Descricao,Id")] EstadoPaciente estadoPaciente) { if (id != estadoPaciente.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(estadoPaciente); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EstadoPacienteExists(estadoPaciente.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(estadoPaciente)); }
public async Task <IActionResult> Create([Bind("Descricao,Id")] EstadoPaciente estadoPaciente) { if (ModelState.IsValid) { estadoPaciente.Id = Guid.NewGuid(); _context.Add(estadoPaciente); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(estadoPaciente)); }
public Paciente(string identidad, string nombres, string apellidos, string direccion, string correo, string celular, DateTime fecha, Sexo sexo, EstadoPaciente status) { Identidad = identidad; Nombres = nombres; Apellidos = apellidos; Direccion = direccion; Correo = correo; Celular = celular; FechaNacimiento = fecha; SexoPaciente = sexo; Estado = status; }
private int ObtenerEstado(EstadoPaciente estadoPaciente) { switch (estadoPaciente) { case EstadoPaciente.Activo: return(1); case EstadoPaciente.Inactivo: return(0); default: return(1); } }