Ejemplo n.º 1
0
        public ActionResult Edit(string id, Nse nse)
        {
            if (id != nse.Id)
            {
                return(NotFound());
            }
            if (ModelState.IsValid)
            {
                nseService.Update(id, nse);
                return(RedirectToAction(nameof(Index)));
            }
            else
            {
                return(View(nse));
            }

            /*try
             * {
             *  // TODO: Add update logic here
             *
             *  return RedirectToAction(nameof(Index));
             * }
             * catch
             * {
             *  return View();
             * }*/
        }
Ejemplo n.º 2
0
 public ActionResult Edit(string id, Nse nse)
 {
     if (id != nse.Id)
     {
         return(NotFound());
     }
     if (ModelState.IsValid)
     {
         _nseService.Update(id, nse);
         return(RedirectToAction(nameof(Index)));
     }
     else
     {
         return(View(nse));
     }
 }