public ActionResult Edit(int id, Monitor model) { try { MonitorRepository repo = new MonitorRepository(); repo.UpdateMonitor(model); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Create(Monitor model) { try { MonitorRepository repo = new MonitorRepository(); repo.AddMonitor(model); return RedirectToAction("Index"); } catch { return View(model); } }
// GET: Monitor/Edit/5 public ActionResult Edit(int id) { MonitorRepository repo = new MonitorRepository(); Monitor model = repo.GetMonitorById(id); return View(model); }
// GET: Monitor public ActionResult Index() { MonitorRepository repo = new MonitorRepository(); List<Monitor> model = repo.GetAllMonitors(); return View(model); }