Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,IP,Adress_Mac,Name,ParcID,AD")] Pc pc)
        {
            if (id != pc.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(pc);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PcExists(pc.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ParcID"] = new SelectList(_context.Parcs, "ID", "Name", pc.ParcID);
            return(View(pc));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Description")] App app)
        {
            if (id != app.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(app);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AppExists(app.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(app));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Address,Tel,Fax")] Parc parc)
        {
            if (id != parc.ID)
            {
                return(NotFound());
            }

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