Esempio n. 1
0
        public async Task <IActionResult> Edit(int id, [Bind("IdCliente,Identificacion,Nombres,Apellidos,Direccion,Longitud,Latitud,Telefono,Correo,IdAspNetUser,DeviceId,Habilitado,FechaRegistro,IdSector,SistemaOperativo")] Cliente cliente)
        {
            if (id != cliente.IdCliente)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cliente);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClienteExists(cliente.IdCliente))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdAspNetUser"] = new SelectList(_context.AspNetUsers, "Id", "Id", cliente.IdAspNetUser);
            ViewData["IdSector"]     = new SelectList(_context.Sector, "IdSector", "IdSector", cliente.IdSector);
            return(View(cliente));
        }
        public async Task <IActionResult> Edit(int id, [Bind("IdBodega,NombreBodega,Direccion,TelfContacto,NombreContacto")] Bodega bodega)
        {
            if (id != bodega.IdBodega)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bodega);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BodegaExists(bodega.IdBodega))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(bodega));
        }
        public async Task <IActionResult> Edit(int id, [Bind("IdSector,Nombre,IdCiudad")] Sector sector)
        {
            if (id != sector.IdSector)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sector);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SectorExists(sector.IdSector))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdCiudad"] = new SelectList(_context.Ciudad, "IdCiudad", "Nombre", sector.IdCiudad);
            return(View(sector));
        }
Esempio n. 4
0
        public async Task <IActionResult> Edit(int id, [Bind("IdDistribuidor,Identificacion,Nombres,Apellidos,Telefono,Correo,PlacaVehiculo,Prioridad,IdTipoSuscripcion,IdAspNetUser,DeviceId,Habilitado,FirebaseId,IdSector,Direccion,FechaRegistro,IdBodega")] Distribuidor distribuidor)
        {
            if (id != distribuidor.IdDistribuidor)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(distribuidor);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DistribuidorExists(distribuidor.IdDistribuidor))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdBodega"] = new SelectList(_context.Bodega, "IdBodega", "IdBodega", distribuidor.IdBodega);
            ViewData["IdSector"] = new SelectList(_context.Sector, "IdSector", "IdSector", distribuidor.IdSector);
            return(View(distribuidor));
        }