Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("BodegaTripaId,activo,NumeroPieles,peso,DescarneId,ClasificacionTripaId,Personal")] Bodegatripa bodegatripa)
        {
            if (id != bodegatripa.BodegaTripaId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bodegatripa);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BodegatripaExists(bodegatripa.BodegaTripaId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClasificacionTripaId"] = new SelectList(_context.ClasificacionTripa, "ClasificacionTripaId", "Detalle", bodegatripa.ClasificacionTripaId);
            ViewData["DescarneId"]           = new SelectList(_context.Descarne, "DescarneId", "DescarneId", bodegatripa.DescarneId);
            return(View(bodegatripa));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("BodegaTripaId,activo,NumeroPieles,peso,DescarneId,ClasificacionTripaId,Personal")] Bodegatripa bodegatripa)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bodegatripa);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClasificacionTripaId"] = new SelectList(_context.ClasificacionTripa, "ClasificacionTripaId", "Detalle", bodegatripa.ClasificacionTripaId);
            ViewData["DescarneId"]           = new SelectList(_context.Descarne, "DescarneId", "DescarneId", bodegatripa.DescarneId);
            return(View(bodegatripa));
        }