public async Task <IActionResult> Edit(int id, [Bind("ID,Nombre")] Departamento departamento)
        {
            if (id != departamento.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(departamento);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DepartamentoExists(departamento.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(departamento));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,Nombre,Descripcion")] Ubicacion ubicacion)
        {
            if (id != ubicacion.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(ubicacion);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UbicacionExists(ubicacion.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(ubicacion));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,Nombre,NumSerie,TipoMaterial,Descripcion,Cantidad,Proveedor,FechaRecepcion,FechaGarantia,FechaRetirada,InfoGarantia,TipoUso,Estado,RowVersion,DepartamentoId,UbicacionId")] Material material)
        {
            if (id != material.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(material);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MaterialExists(material.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DepartamentoId"] = new SelectList(_context.Departamentos, "ID", "Nombre", material.DepartamentoId);
            ViewData["UbicacionId"]    = new SelectList(_context.Ubicaciones, "ID", "Nombre", material.UbicacionId);
            return(View(material));
        }