예제 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Producto,Categoria,Descripcion,Precio,URL_IMAGEN")] Models.FRUTERIA_MAR fRUTERIA_MAR)
        {
            if (id != fRUTERIA_MAR.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(fRUTERIA_MAR);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FRUTERIA_MARExists(fRUTERIA_MAR.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(fRUTERIA_MAR));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Id,Producto,Categoria,Descripcion,Precio,URL_IMAGEN")] Models.FRUTERIA_MAR fRUTERIA_MAR)
        {
            if (ModelState.IsValid)
            {
                _context.Add(fRUTERIA_MAR);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(fRUTERIA_MAR));
        }