Example #1
0
        public async Task <IActionResult> Edit(int id, [Bind("CodJornada,Nombre")] TbJornadas tbJornadas)
        {
            if (id != tbJornadas.CodJornada)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tbJornadas);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TbJornadasExists(tbJornadas.CodJornada))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tbJornadas));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("CodJornada,Nombre")] TbJornadas tbJornadas)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tbJornadas);
                await _context.SaveChangesAsync();

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