Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Fecha,Descripcion")] Receta receta)
        {
            if (id != receta.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(receta);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RecetaExists(receta.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(receta));
        }
Beispiel #2
0
        public async Task <IActionResult> Edit(int id, [Bind("RegistrosID,DoctorID,PacienteID,RecepcionistaID,Fecha,Detalles")] Registro registro)
        {
            if (id != registro.RegistrosID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(registro);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RegistroExists(registro.RegistrosID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(registro));
        }
Beispiel #3
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Nombres,Apellidos,Dirección,Numero,Edad")] Paciente paciente)
        {
            if (id != paciente.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(paciente);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PacienteExists(paciente.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(paciente));
        }
Beispiel #4
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Nombres,Apellidos,Cedula,Dirección,Numero,Turno,Disponibilidad")] Doctor doctor)
        {
            if (id != doctor.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(doctor);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DoctorExists(doctor.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(doctor));
        }