コード例 #1
0
 public ActionResult Edit(int id, Monitor model)
 {
     try
     {
         MonitorRepository repo = new MonitorRepository();
         repo.UpdateMonitor(model);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
コード例 #2
0
 public ActionResult Create(Monitor model)
 {
     try
     {
         MonitorRepository repo = new MonitorRepository();
         repo.AddMonitor(model);
         return RedirectToAction("Index");
     }
     catch
     {
         return View(model);
     }
 }
コード例 #3
0
 // GET: Monitor/Edit/5
 public ActionResult Edit(int id)
 {
     MonitorRepository repo = new MonitorRepository();
     Monitor model = repo.GetMonitorById(id);
     return View(model);
 }
コード例 #4
0
 // GET: Monitor
 public ActionResult Index()
 {
     MonitorRepository repo = new MonitorRepository();
     List<Monitor> model = repo.GetAllMonitors();
     return View(model);
 }