Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Dia,HoraDesde,HoraHasta,IdProfesional")] Disponibilidad disponibilidad)
        {
            if (id != disponibilidad.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(disponibilidad);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DisponibilidadExists(disponibilidad.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(disponibilidad));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,DuracionHoras,Monto")] Prestacion prestacion)
        {
            if (id != prestacion.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(prestacion);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PrestacionExists(prestacion.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(prestacion));
        }
 public async Task <IActionResult> Edit(int id, [Bind("Nombre, Id")] Centro centro, string calle, string localidad, int altura, string provincia)
 {
     if (ModelState.IsValid)
     {
         try
         {
             Direccion direccion = new Direccion()
             {
                 Calle     = calle,
                 Altura    = altura,
                 Localidad = localidad,
                 Provincia = provincia
             };
             centro.Direccion = direccion;
             _context.Update(centro);
             await _context.SaveChangesAsync();
         }
         catch (DbUpdateConcurrencyException)
         {
             if (!CentroExists(centro.Id))
             {
                 return(NotFound());
             }
             else
             {
                 throw;
             }
         }
         return(RedirectToAction(nameof(Index)));
     }
     return(View(centro));
 }
Beispiel #4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Apellido,Dni,Rol,Username")] Administrador administrador)
        {
            if (id != administrador.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(administrador);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AdministradorExists(administrador.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(administrador));
        }
        public async Task <IActionResult> Edit(int id, [Bind("PrestacionId,CentroId,Id,Nombre,Apellido,Dni,Rol,Username")] Profesional profesional)
        {
            if (id != profesional.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(profesional);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProfesionalExists(profesional.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CentroId"]     = new SelectList(_context.Centros, "Id", "Nombre", profesional.CentroId);
            ViewData["PrestacionId"] = new SelectList(_context.Prestaciones, "Id", "Nombre", profesional.PrestacionId);
            return(View(profesional));
        }
Beispiel #6
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Fecha,IdPaciente,IdProfesional,IdCentro")] Turno turno)
        {
            if (id != turno.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(turno);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TurnoExists(turno.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdCentro"]      = new SelectList(_context.Centros, "Id", "Nombre", turno.IdCentro);
            ViewData["IdPaciente"]    = new SelectList(_context.Pacientes, "Id", "Apellido", turno.IdPaciente);
            ViewData["IdProfesional"] = new SelectList(_context.Profesionales, "Id", "Apellido", turno.IdProfesional);
            return(View(turno));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Calle,Altura,Localidad,Provincia")] Direccion direccion)
        {
            if (id != direccion.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(direccion);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DireccionExists(direccion.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(direccion));
        }
Beispiel #8
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Descripcion,IdUsuario")] Mail mail)
        {
            if (id != mail.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(mail);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MailExists(mail.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdUsuario"] = new SelectList(_context.Set <Usuario>(), "Id", "Apellido", mail.IdUsuario);
            return(View(mail));
        }