コード例 #1
0
        public ActionResult Add()
        {
            MultiDrop model = new MultiDrop();

            ViewBag.Locations = RepoLocation.FindAll();
            return(View("Form", model));
        }
コード例 #2
0
        public ActionResult Edit(int id)
        {
            Context.Multidrop dbitem = RepoMultidrop.FindByPK(id);
            MultiDrop         model  = new MultiDrop(dbitem);

            ViewBag.name      = model.tujuan;
            ViewBag.Locations = RepoLocation.FindAll();
            return(View("Form", model));
        }
コード例 #3
0
        public ActionResult Edit(MultiDrop model)
        {
            if (ModelState.IsValid)
            {
                Context.Multidrop dbitem = RepoMultidrop.FindByPK(model.Id);
                model.setDb(dbitem);
                RepoMultidrop.save(dbitem);

                return(RedirectToAction("Index"));
            }
            ViewBag.Locations = RepoLocation.FindAll();
            return(View("Form", model));
        }