public ActionResult ChangeRemoconInfo(ChangeRemoconInfoModel model) {

            var target = db.iRemocons.Where(p => p.ID == model.id).Single();

            if (ModelState.IsValid) {

                System.Net.IPAddress address;
                if (!System.Net.IPAddress.TryParse(model.IPAddress, out address)) {
                    ModelState.AddModelError("", "IPアドレスの書式が正しくありません。");
                    return View(model);
                }
                if (!Regex.IsMatch(model.IPAddress, @"[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}")) {
                    ModelState.AddModelError("", "IPアドレスの書式が正しくありません。");
                    return View(model);
                }

                foreach (var x in db.iRemocons) {
                    if (x.ID != model.id && x.IPAddress.Equals(model.IPAddress)) {
                        ModelState.AddModelError("", "既に登録済みのIPアドレスです。");
                        return View(model);
                    }
                }

                target.IPAddress = model.IPAddress;
                target.Detail = model.Detail;
                db.SaveChanges();

                return RedirectToAction("Index", "Home");

            }

            // ここで問題が発生した場合はフォームを再表示します
            return View(model);
        }
        public ActionResult ChangeRemoconInfo(int id) {

            var target = db.iRemocons.Where(p => p.ID == id).Single();

            ChangeRemoconInfoModel CRmodel = new ChangeRemoconInfoModel();
            CRmodel.id = target.ID;
            CRmodel.IPAddress = target.IPAddress;
            CRmodel.Detail = target.Detail;

            return View(CRmodel);
        }