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(); * }*/ }
public ActionResult Create(Nse nse) { if (ModelState.IsValid) { _nseService.Create(nse); return(RedirectToAction(nameof(Index))); } return(View(nse)); }
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)); } }
public ActionResult Create(Nse nse) { if (ModelState.IsValid) { nseService.Create(nse); return(RedirectToAction(nameof(Index))); } return(View(nse)); /*try * { * // TODO: Add insert logic here * * return RedirectToAction(nameof(Index)); * } * catch * { * return View(nse); * }*/ }
public void Remove(Nse nseIn) { _nse.DeleteOne(ne => ne.Id == nseIn.Id); }
public void Update(string id, Nse nseIn) { _nse.ReplaceOne(ne => ne.Id == id, nseIn); }
public Nse Create(Nse nse) { _nse.InsertOne(nse); return(nse); }